Quantity Breaks 5
Quantity breaks for a live event: one seat on the light half, or a group on the dark stage where a seat
Use it in a prompt
Use offer/quantity-breaks-5 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/offer/quantity-breaks-5.tsx. - Import it and pass your copy and images (Props tab):
import { QuantityBreaks5 } from "@/components/funneldna/offer/quantity-breaks-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/quantity-breaks-5/component.tsx 813 lines
// layout: split-contrast
// Quantity breaks for a live event: one seat on the light half, or a group on the dark stage where a seat
// stepper steps the per-seat price down at supplied group sizes, lights the tier reached and keeps a live total.
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, Minus, Plus, Users } from 'lucide-react'
import { Backdrop, FX_HOST } from '../fx/fx'
import seminar from '../fx/backdrops/seminar'
export type GroupTier = {
/** Smallest group size that gets this price. */
minSeats: number
/** Tier name that lights up when the group reaches it, e.g. Crew. */
name: string
/** Price per seat at this tier, same currency as seatPrice. */
seatPrice: number
}
export type SeatChoice = {
kind: 'solo' | 'group'
seats: number
/** Price per seat for this choice. */
seatPrice: number
total: number
/** Group tier reached, if any. */
tier?: string
}
export type QuantityBreaks5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type QuantityBreaks5Copy = {
orLabel: string
soloSeatWord: string
soloTitle: string
soloLead: string
/** Placeholder: {price} */
soloPrice: string
/** The value said in words beside the price. */
soloValue: string
soloAction: string
soloNote: string
groupTitle: string
/** Title used when no group tiers are supplied (single-price fallback). */
groupTitleSingle: string
ladderLabel: string
/** Placeholder: {seats} */
tierMin: string
perSeatUnit: string
seatsLabel: string
seatOne: string
seatMany: string
removeSeat: string
addSeat: string
/** Placeholder: {price} */
perSeat: string
/** Placeholder: {tier} */
perSeatTier: string
/** Placeholder: {saving} */
saving: string
/** Placeholders: {more} {seatWord} {tier} {price} */
nextTier: string
bestTier: string
/** Placeholder: {max} */
limit: string
reasonsTitle: string
/** Placeholders: {seats} {seatWord} */
totalLabel: string
/** Placeholder: {seats} */
groupAction: string
groupNote: string
loading: string
error: string
/** Screen-reader update. Placeholders: {seats} {seatWord} {price} {total} */
live: string
}
export type QuantityBreaks5Props = {
/** Event name, filled into {event} in the lead. */
eventName?: string
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
/** Placeholder: {event} */
lead?: string
/** Price of one seat booked alone. */
seatPrice?: number
/** Group price steps. Empty array = single-price fallback (every group seat at seatPrice). */
groupTiers?: GroupTier[]
/** Smallest group the stepper allows; defaults to the first tier size, else 2. */
minGroupSeats?: number
/** Seats allowed per booking (a booking limit, not scarcity). */
maxSeats?: number
/** Starting group size; defaults to the smallest group. */
defaultSeats?: number
/** Currency prefix, e.g. $. */
currency?: string
locale?: string
/** Product cut-out for the solo half (slot: product). */
soloImage?: string
soloImageAlt?: string
soloIncludes?: string[]
/** Numbered reasons to book as a group. */
reasons?: string[]
/** fx backdrop asset behind the group half; reads the scene slot itself. */
backdrop?: string
copy?: Partial<QuantityBreaks5Copy>
state?: QuantityBreaks5State
/** Receives the chosen seats; the builder wires checkout. */
onAction?: (choice: SeatChoice) => void | Promise<void>
className?: string
}
export function QuantityBreaks5({
eventName = 'Pottery Weekend Retreat',
headline = 'Come solo, or bring your crew and pay less per seat',
highlight = 'pay less per seat',
lead = 'Two days at the wheel at the {event}. Book one seat, or set your group size and watch every seat get cheaper.',
seatPrice = 347,
groupTiers = DEFAULT_TIERS,
minGroupSeats,
maxSeats = 10,
defaultSeats,
currency = '$',
locale = 'en-US',
soloImage,
soloImageAlt = '',
soloIncludes = DEFAULT_INCLUDES,
reasons = DEFAULT_REASONS,
backdrop = seminar,
copy,
state = 'default',
onAction,
className,
}: QuantityBreaks5Props) {
const c = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const fmt = (n: number) => money(n, currency, locale)
const word = (n: number) => (n === 1 ? c.seatOne : c.seatMany)
const tiers = React.useMemo(
() =>
(groupTiers ?? [])
.filter((t) => t && t.minSeats > 0 && Number.isFinite(t.seatPrice))
.slice()
.sort((a, b) => a.minSeats - b.minSeats),
[groupTiers],
)
const cap = Math.max(1, Math.floor(maxSeats))
const ladder = tiers.filter((t) => t.minSeats <= cap)
const hasTiers = ladder.length > 0
const floor = clamp(Math.floor(minGroupSeats ?? ladder[0]?.minSeats ?? 2), 1, cap)
const [picked, setPicked] = React.useState(() => Math.floor(defaultSeats ?? floor))
const [pending, setPending] = React.useState<'solo' | 'group' | null>(null)
const [failed, setFailed] = React.useState<'solo' | 'group' | null>(null)
const mounted = React.useRef(true)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const seats = clamp(picked, floor, cap)
let tier: GroupTier | undefined
for (const t of ladder) if (t.minSeats <= seats) tier = t
const next = ladder.find((t) => t.minSeats > seats)
const per = tier ? tier.seatPrice : seatPrice
const total = per * seats
const saving = seatPrice - per
const idx = tier ? ladder.indexOf(tier) : -1
const curMin = tier ? tier.minSeats : floor
const frac = next ? (seats - curMin) / Math.max(1, next.minSeats - curMin) : 0
const railPct = hasTiers ? Math.min(100, ((idx + 1 + frac) / ladder.length) * 100) : 0
const atCap = seats >= cap
const more = next ? next.minSeats - seats : 0
const nudge = next
? tpl(c.nextTier, { more, seatWord: word(more), tier: next.name, price: fmt(next.seatPrice) })
: hasTiers && tier
? c.bestTier
: ''
const limitText = atCap ? tpl(c.limit, { max: cap }) : ''
const perDetail = [
tier ? tpl(c.perSeatTier, { tier: tier.name }) : '',
saving >= 0.01 ? tpl(c.saving, { saving: fmt(saving) }) : '',
]
.filter(Boolean)
.join(' \u00b7 ')
const disabled = state === 'disabled'
const force = state === 'hover' || state === 'active' ? state : undefined
const groupError = state === 'error' || failed === 'group'
const soloError = failed === 'solo'
function change(n: number) {
if (disabled) return
setPicked(clamp(n, floor, cap))
setFailed(null)
}
async function act(kind: 'solo' | 'group') {
if (disabled || pending || !onAction) return
const choice: SeatChoice =
kind === 'solo'
? { kind, seats: 1, seatPrice, total: seatPrice }
: { kind, seats, seatPrice: per, total, tier: tier?.name }
setFailed(null)
setPending(kind)
try {
await onAction(choice)
} catch {
if (mounted.current) setFailed(kind)
} finally {
if (mounted.current) setPending(null)
}
}
return (
<section
className={'cf-quantity-breaks-5' + (className ? ' ' + className : '')}
data-force={force}
data-disabled={disabled || undefined}
aria-labelledby={uid + '-h'}
>
<style>{CSS}</style>
<div className='qb5-wrap'>
<header className='qb5-head'>
<h2 className='qb5-h2' id={uid + '-h'}>
<Marked text={headline} mark={highlight} />
</h2>
{lead ? <p className='qb5-lead'>{tpl(lead, { event: eventName })}</p> : null}
</header>
<div className='qb5-panel'>
<div className='qb5-solo'>
<div className='qb5-solo-top'>
<p className='qb5-one'>
<span className='qb5-one-n'>1</span>
<span className='qb5-one-w'>{c.soloSeatWord}</span>
</p>
{soloImage ? (
<img
className='qb5-solo-img'
src={soloImage}
alt={soloImageAlt}
width={296}
height={296}
loading='lazy'
decoding='async'
/>
) : null}
</div>
<h3 className='qb5-h3'>{c.soloTitle}</h3>
{c.soloLead ? <p className='qb5-p'>{c.soloLead}</p> : null}
{soloIncludes.length ? (
<ul className='qb5-list'>
{soloIncludes.map((item) => (
<li key={item}>
<Check className='qb5-tick' size={18} strokeWidth={2.5} aria-hidden />
<span>{item}</span>
</li>
))}
</ul>
) : null}
<div className='qb5-solo-buy'>
<p className='qb5-price'>
<strong className='qb5-price-n'>{tpl(c.soloPrice, { price: fmt(seatPrice) })}</strong>
{c.soloValue ? <span className='qb5-price-v'>{c.soloValue}</span> : null}
</p>
<button
type='button'
className='qb5-btn qb5-btn--quiet'
disabled={disabled}
aria-busy={pending === 'solo' || undefined}
onClick={() => act('solo')}
>
{pending === 'solo' ? (
<>
<Loader2 className='qb5-spin' size={20} strokeWidth={2.5} aria-hidden />
{c.loading}
</>
) : (
c.soloAction
)}
</button>
{soloError ? (
<p className='qb5-error' role='alert'>
<AlertCircle className='qb5-ico' size={16} strokeWidth={2.5} aria-hidden />
{c.error}
</p>
) : null}
{c.soloNote ? (
<p className='qb5-note qb5-note--light'>
<Lock className='qb5-ico' size={16} strokeWidth={2.5} aria-hidden />
{c.soloNote}
</p>
) : null}
</div>
</div>
<div className='qb5-group'>
<div className='qb5-stage' aria-hidden='true'>
<div style={{ ...FX_HOST, position: 'absolute', inset: 0 }}>
<Backdrop src={backdrop} treatment='scrim-dark' position='center' />
</div>
</div>
<span className='qb5-or' aria-hidden='true'>
{c.orLabel}
</span>
<div className='qb5-group-in'>
<h3 className='qb5-h3'>{hasTiers ? c.groupTitle : c.groupTitleSingle}</h3>
{hasTiers ? (
<div className='qb5-ladder' role='group' aria-label={c.ladderLabel}>
<div className='qb5-tiers'>
{ladder.map((t) => {
const on = tier === t
return (
<button
key={t.name + t.minSeats}
type='button'
className='qb5-tier'
aria-pressed={on}
disabled={disabled}
onClick={() => change(t.minSeats)}
>
<span className='qb5-tier-name'>
{on ? <Check size={16} strokeWidth={2.5} aria-hidden /> : null}
{t.name}
</span>
<span className='qb5-tier-price'>
{fmt(t.seatPrice)}
<span className='qb5-tier-unit'>{c.perSeatUnit}</span>
</span>
<span className='qb5-tier-min'>{tpl(c.tierMin, { seats: t.minSeats })}</span>
</button>
)
})}
</div>
<div className='qb5-rail' aria-hidden='true'>
<span className='qb5-rail-fill' style={{ width: railPct + '%' }} />
</div>
</div>
) : null}
<div className='qb5-pick'>
<div className='qb5-stepper' role='group' aria-labelledby={uid + '-seats'}>
<button
type='button'
className='qb5-step'
aria-label={c.removeSeat}
disabled={disabled || seats <= floor}
onClick={() => change(seats - 1)}
>
<Minus size={24} strokeWidth={2.5} aria-hidden />
</button>
<div className='qb5-count'>
<span className='qb5-count-n'>
<span key={seats}>{seats}</span>
</span>
<span className='qb5-count-w' id={uid + '-seats'}>
{c.seatsLabel}
</span>
</div>
<button
type='button'
className='qb5-step'
aria-label={c.addSeat}
disabled={disabled || seats >= cap}
onClick={() => change(seats + 1)}
>
<Plus size={24} strokeWidth={2.5} aria-hidden />
</button>
</div>
<div className='qb5-per'>
<p className='qb5-per-n'>{tpl(c.perSeat, { price: fmt(per) })}</p>
{perDetail ? <p className='qb5-per-s'>{perDetail}</p> : null}
</div>
</div>
{nudge || limitText ? (
<p className='qb5-nudge'>
{next || !nudge ? (
<Users className='qb5-ico' size={18} strokeWidth={2.5} aria-hidden />
) : (
<Check className='qb5-ico' size={18} strokeWidth={2.5} aria-hidden />
)}
{[nudge, limitText].filter(Boolean).join(' ')}
</p>
) : null}
{reasons.length ? (
<div className='qb5-reasons'>
{c.reasonsTitle ? <p className='qb5-reasons-h'>{c.reasonsTitle}</p> : null}
<ol>
{reasons.map((r, i) => (
<li key={r}>
<span className='qb5-num'>{i + 1}</span>
<span>{r}</span>
</li>
))}
</ol>
</div>
) : null}
<div className='qb5-checkout'>
<div className='qb5-total'>
<span className='qb5-total-l'>{tpl(c.totalLabel, { seats, seatWord: word(seats) })}</span>
<span className='qb5-total-n'>
<span key={total}>{fmt(total)}</span>
</span>
</div>
<button
type='button'
className='qb5-btn qb5-btn--primary'
disabled={disabled}
aria-busy={pending === 'group' || undefined}
onClick={() => act('group')}
>
{pending === 'group' ? (
<>
<Loader2 className='qb5-spin' size={20} strokeWidth={2.5} aria-hidden />
{c.loading}
</>
) : (
tpl(c.groupAction, { seats })
)}
</button>
{groupError ? (
<p className='qb5-error' role='alert'>
<AlertCircle className='qb5-ico' size={16} strokeWidth={2.5} aria-hidden />
{c.error}
</p>
) : null}
{c.groupNote ? (
<p className='qb5-note'>
<Lock className='qb5-ico' size={16} strokeWidth={2.5} aria-hidden />
{c.groupNote}
</p>
) : null}
</div>
<p className='qb5-sr' aria-live='polite'>
{tpl(c.live, { seats, seatWord: word(seats), price: fmt(per), total: fmt(total) })}
</p>
</div>
</div>
</div>
</div>
</section>
)
}
export default QuantityBreaks5
const DEFAULT_TIERS: GroupTier[] = [
{ minSeats: 2, name: 'Duo', seatPrice: 319 },
{ minSeats: 4, name: 'Crew', seatPrice: 289 },
{ minSeats: 6, name: 'Studio', seatPrice: 259 },
]
const DEFAULT_INCLUDES = ['Two full days on the wheel', 'Clay, glazes and two firings', 'Take home every piece you make']
const DEFAULT_REASONS = [
'Every seat drops to the group price you light up above.',
'Your crew shares one wheel bay and one glaze shelf.',
'One booking and one checkout covers everyone.',
]
const DEFAULT_COPY: QuantityBreaks5Copy = {
orLabel: 'or',
soloSeatWord: 'seat',
soloTitle: 'Come on your own',
soloLead: 'Your own wheel and a place in a small, friendly studio group.',
soloPrice: 'Just {price}',
soloValue: 'for two full days of studio time',
soloAction: 'Yes! I want my solo seat',
soloNote: 'One seat \u00b7 Secure checkout',
groupTitle: 'Bring your crew, pay less per seat',
groupTitleSingle: 'Bring your crew, book every seat at once',
ladderLabel: 'Group price per seat',
tierMin: '{seats}+ seats',
perSeatUnit: '/seat',
seatsLabel: 'Seats',
seatOne: 'seat',
seatMany: 'seats',
removeSeat: 'Remove a seat',
addSeat: 'Add a seat',
perSeat: 'Just {price} a seat',
perSeatTier: '{tier} pricing',
saving: '{saving} less per seat than coming solo',
nextTier: 'Add {more} more {seatWord} to unlock {tier} pricing at {price} a seat.',
bestTier: 'Your crew has the best group price.',
limit: 'Up to {max} seats per booking.',
reasonsTitle: 'Three reasons crews book together',
totalLabel: 'Total for {seats} {seatWord}',
groupAction: 'Yes! Book our {seats} seats',
groupNote: 'One checkout for the whole crew',
loading: 'Starting your booking\u2026',
error: 'We couldn\u2019t start your booking. Please try again.',
live: '{seats} {seatWord}, {price} a seat, total {total}.',
}
function Marked({ text, mark }: { text: string; mark?: string }) {
const i = mark ? text.indexOf(mark) : -1
if (!mark || i < 0) return <>{text}</>
return (
<>
{text.slice(0, i)}
<span className='qb5-mark'>{mark}</span>
{text.slice(i + mark.length)}
</>
)
}
function tpl(s: string, v: Record<string, string | number>) {
return s.replace(/\{(\w+)\}/g, (m, k: string) => (k in v ? String(v[k]) : m))
}
function clamp(n: number, min: number, max: number) {
if (!Number.isFinite(n)) return min
return Math.min(max, Math.max(min, n))
}
function money(n: number, currency: string, locale: string) {
const whole = Math.abs(n - Math.round(n)) < 0.005
return (
currency +
n.toLocaleString(locale, { minimumFractionDigits: whole ? 0 : 2, maximumFractionDigits: whole ? 0 : 2 })
)
}
const CSS = `
.cf-quantity-breaks-5{
--qb5-shadow:var(--shadow, oklch(0.22 0.03 260));
--qb5-pad:clamp(24px, 3.4vw, 44px);
--qb5-soft:color-mix(in oklab, var(--band-ink) 84%, var(--band));
position:relative;
background:var(--surface);
color:var(--ink);
font-family:var(--font-body);
padding:clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-quantity-breaks-5 *,.cf-quantity-breaks-5 *::before,.cf-quantity-breaks-5 *::after{box-sizing:border-box}
.cf-quantity-breaks-5 :where(h2,h3,p,ul,ol){margin:0}
.cf-quantity-breaks-5 :where(ul,ol){list-style:none;padding:0}
.cf-quantity-breaks-5 button{font:inherit}
.cf-quantity-breaks-5 .qb5-wrap{max-width:1120px;margin-inline:auto}
.cf-quantity-breaks-5 .qb5-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cf-quantity-breaks-5 .qb5-ico{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;flex:none}
/* header */
.cf-quantity-breaks-5 .qb5-head{max-width:46rem;margin:0 auto clamp(32px, 4vw, 48px);text-align:center}
.cf-quantity-breaks-5 .qb5-h2{
font-family:var(--font-display);
font-weight:var(--display-weight, 800);
letter-spacing:var(--display-tracking, -0.025em);
text-transform:var(--display-case, none);
font-size:clamp(2rem, 3.6vw, 3.25rem);
line-height:1.06;
text-wrap:balance;
color:var(--ink);
}
.cf-quantity-breaks-5 .qb5-mark{
background-image:linear-gradient(transparent 58%, color-mix(in oklch, var(--marker, #fae37c) 82%, transparent) 58%, color-mix(in oklch, var(--marker, #fae37c) 82%, transparent) 94%, transparent 94%);
-webkit-box-decoration-break:clone;
box-decoration-break:clone;
padding-inline:.06em;
}
.cf-quantity-breaks-5 .qb5-lead{
max-width:40rem;margin:16px auto 0;
font-size:clamp(1.125rem, 1.5vw, 1.375rem);line-height:1.4;font-weight:500;
color:var(--muted);text-wrap:pretty;
}
/* split panel */
.cf-quantity-breaks-5 .qb5-panel{
position:relative;
display:grid;
grid-template-columns:minmax(0, 5fr) minmax(0, 7fr);
background:var(--card);
border:1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12));
border-radius:var(--card-radius, var(--radius, 14px));
box-shadow:var(--card-shadow, var(--shadow-lg));
overflow:clip;
}
.cf-quantity-breaks-5 .qb5-h3{
font-family:var(--font-display);
font-weight:var(--display-weight, 800);
text-transform:var(--display-case, none);
font-size:clamp(1.3125rem, 1.8vw, 1.625rem);
line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;
}
/* light half: going alone */
.cf-quantity-breaks-5 .qb5-solo{
display:flex;flex-direction:column;
padding:var(--qb5-pad);
background:var(--card);color:var(--ink);
animation:qb5-rise .45s cubic-bezier(.2,.7,.2,1) both;
}
.cf-quantity-breaks-5 .qb5-solo-top{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:24px}
.cf-quantity-breaks-5 .qb5-one{display:flex;align-items:baseline;gap:8px}
.cf-quantity-breaks-5 .qb5-one-n{
font-family:var(--font-display);font-weight:800;
font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-0.03em;
font-variant-numeric:tabular-nums;
}
.cf-quantity-breaks-5 .qb5-one-w{font-size:.875rem;font-weight:800;line-height:1.2;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.cf-quantity-breaks-5 .qb5-solo-img{
display:block;width:clamp(104px, 11vw, 148px);height:auto;aspect-ratio:1;
object-fit:contain;margin-block:-8px;
filter:drop-shadow(0 2px 3px oklch(from var(--qb5-shadow) l c h / 0.3)) drop-shadow(0 12px 14px oklch(from var(--qb5-shadow) l c h / 0.22));
}
.cf-quantity-breaks-5 .qb5-p{margin-top:12px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-quantity-breaks-5 .qb5-list{display:grid;gap:10px;margin-top:20px}
.cf-quantity-breaks-5 .qb5-list li{display:flex;align-items:flex-start;gap:10px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-quantity-breaks-5 .qb5-tick{flex:none;margin-top:.15em;color:var(--success)}
.cf-quantity-breaks-5 .qb5-solo-buy{margin-top:auto;padding-top:28px;display:grid;gap:12px}
.cf-quantity-breaks-5 .qb5-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin-bottom:8px}
.cf-quantity-breaks-5 .qb5-price-n{
font-family:var(--font-display);font-weight:800;
font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-0.03em;
font-variant-numeric:tabular-nums;color:var(--ink);
}
.cf-quantity-breaks-5 .qb5-price-v{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
/* dark half: bringing the team */
.cf-quantity-breaks-5 .qb5-group{
position:relative;isolation:isolate;
padding:var(--qb5-pad);
background:var(--band);color:var(--band-ink);
}
.cf-quantity-breaks-5 .qb5-stage{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none}
.cf-quantity-breaks-5 .qb5-group-in{
position:relative;z-index:1;display:flex;flex-direction:column;
animation:qb5-rise .45s cubic-bezier(.2,.7,.2,1) .07s both;
}
.cf-quantity-breaks-5 .qb5-or{
position:absolute;z-index:3;left:0;top:50%;transform:translate(-50%, -50%);
display:inline-flex;align-items:center;justify-content:center;
min-height:40px;padding:4px 16px;border-radius:999px;
background:var(--card);color:var(--ink);
border:1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12));
box-shadow:var(--shadow-md);
font-family:var(--font-display);font-weight:800;font-size:.875rem;line-height:1.2;
text-transform:uppercase;letter-spacing:.08em;
}
/* tier ladder */
.cf-quantity-breaks-5 .qb5-ladder{margin-top:24px}
.cf-quantity-breaks-5 .qb5-tiers{display:grid;grid-template-columns:repeat(auto-fit, minmax(min(100%, 88px), 1fr));gap:8px}
.cf-quantity-breaks-5 .qb5-tier{
appearance:none;cursor:pointer;text-align:left;
display:grid;align-content:start;gap:2px;
padding:12px 14px;
border-radius:var(--radius, 12px);
border:1px solid oklch(from var(--band-ink) l c h / 0.18);
background:oklch(from var(--band) calc(l - 0.03) c h / 0.84);
color:var(--band-ink);
transition:background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.cf-quantity-breaks-5 .qb5-tier:hover:not(:disabled){background:oklch(from var(--band) calc(l + 0.05) c h / 0.92);border-color:oklch(from var(--band-ink) l c h / 0.34)}
.cf-quantity-breaks-5 .qb5-tier[aria-pressed='true']{
background:var(--accent-fill, var(--accent));
color:var(--accent-fill-ink, var(--card));
border-color:transparent;
box-shadow:var(--shadow-md);
animation:qb5-pop .3s cubic-bezier(.2,.7,.2,1) both;
}
.cf-quantity-breaks-5 .qb5-tier[aria-pressed='true']:hover:not(:disabled){background:oklch(from var(--accent-fill, var(--accent)) calc(l - 0.04) c h)}
.cf-quantity-breaks-5 .qb5-tier:disabled{cursor:not-allowed;opacity:.6}
.cf-quantity-breaks-5 .qb5-tier-name{display:flex;align-items:center;gap:6px;font-family:var(--font-display);font-weight:800;font-size:1.0625rem;line-height:1.2}
.cf-quantity-breaks-5 .qb5-tier-name svg{flex:none}
.cf-quantity-breaks-5 .qb5-tier-price{
display:flex;flex-wrap:wrap;align-items:baseline;gap:0 2px;margin-top:4px;
font-family:var(--font-display);font-weight:800;
font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;font-variant-numeric:tabular-nums;
}
.cf-quantity-breaks-5 .qb5-tier-unit,.cf-quantity-breaks-5 .qb5-tier-min{font-family:var(--font-body);font-size:.875rem;font-weight:700;line-height:1.2}
.cf-quantity-breaks-5 .qb5-rail{position:relative;height:6px;margin-top:12px;border-radius:999px;background:oklch(from var(--band-ink) l c h / 0.16);overflow:hidden}
.cf-quantity-breaks-5 .qb5-rail-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--accent-fill, var(--accent));transition:width .45s cubic-bezier(.2,.7,.2,1)}
/* stepper + per-seat line */
.cf-quantity-breaks-5 .qb5-pick{margin-top:24px;display:flex;flex-wrap:wrap;align-items:center;gap:16px 24px}
.cf-quantity-breaks-5 .qb5-stepper{
display:grid;grid-template-columns:64px minmax(112px, auto) 64px;align-items:center;
padding:6px;border-radius:calc(var(--radius, 12px) + 6px);
background:oklch(from var(--band) calc(l - 0.06) c h / 0.92);
border:1px solid oklch(from var(--band-ink) l c h / 0.16);
}
.cf-quantity-breaks-5 .qb5-step{
width:64px;height:64px;display:grid;place-items:center;cursor:pointer;
border:0;border-radius:var(--radius, 12px);
background:oklch(from var(--band-ink) l c h / 0.12);color:var(--band-ink);
transition:background .16s ease, transform .16s ease;
}
.cf-quantity-breaks-5 .qb5-step:hover:not(:disabled){background:oklch(from var(--band-ink) l c h / 0.2)}
.cf-quantity-breaks-5 .qb5-step:active:not(:disabled){transform:translateY(1px);background:oklch(from var(--band-ink) l c h / 0.26)}
.cf-quantity-breaks-5 .qb5-step:disabled{opacity:.38;cursor:not-allowed}
.cf-quantity-breaks-5 .qb5-count{display:grid;justify-items:center;padding-inline:12px}
.cf-quantity-breaks-5 .qb5-count-n{
font-family:var(--font-display);font-weight:800;
font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-0.03em;
font-variant-numeric:tabular-nums;
}
.cf-quantity-breaks-5 .qb5-count-n > span,.cf-quantity-breaks-5 .qb5-total-n > span{display:inline-block;animation:qb5-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-quantity-breaks-5 .qb5-count-w{margin-top:4px;font-size:.875rem;font-weight:800;line-height:1.2;text-transform:uppercase;letter-spacing:.08em}
.cf-quantity-breaks-5 .qb5-per{flex:1 1 220px;min-width:0}
.cf-quantity-breaks-5 .qb5-per-n{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1.15;text-wrap:balance}
.cf-quantity-breaks-5 .qb5-per-s{margin-top:6px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--qb5-soft);text-wrap:pretty}
.cf-quantity-breaks-5 .qb5-nudge{margin-top:16px;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
/* numbered reasons */
.cf-quantity-breaks-5 .qb5-reasons{margin-top:28px}
.cf-quantity-breaks-5 .qb5-reasons-h{font-family:var(--font-display);font-weight:800;font-size:1.0625rem;line-height:1.3}
.cf-quantity-breaks-5 .qb5-reasons ol{display:grid;gap:10px;margin-top:12px}
.cf-quantity-breaks-5 .qb5-reasons li{display:grid;grid-template-columns:28px minmax(0, 1fr);align-items:baseline;gap:8px;font-size:clamp(1.0625rem, 1.25vw, 1.125rem);line-height:1.45;color:var(--qb5-soft);text-wrap:pretty}
.cf-quantity-breaks-5 .qb5-num{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem, 1.8vw, 1.625rem);line-height:1;color:var(--band-ink);font-variant-numeric:tabular-nums}
/* live total + action */
.cf-quantity-breaks-5 .qb5-checkout{margin-top:28px;display:grid;gap:12px}
.cf-quantity-breaks-5 .qb5-total{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px}
.cf-quantity-breaks-5 .qb5-total-l{font-size:1.0625rem;font-weight:700;line-height:1.3}
.cf-quantity-breaks-5 .qb5-total-n{
font-family:var(--font-display);font-weight:800;
font-size:clamp(2.5rem, 4.2vw, 3.75rem);line-height:1;letter-spacing:-0.03em;
font-variant-numeric:tabular-nums;
}
.cf-quantity-breaks-5 .qb5-note{font-size:.9375rem;line-height:1.4;font-weight:500;text-align:center;text-wrap:pretty;color:var(--qb5-soft)}
.cf-quantity-breaks-5 .qb5-note--light{color:var(--muted)}
.cf-quantity-breaks-5 .qb5-error{padding:12px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
/* buttons */
.cf-quantity-breaks-5 .qb5-btn{
display:inline-flex;align-items:center;justify-content:center;gap:10px;
width:100%;padding:0 28px;border:1px solid transparent;cursor:pointer;
border-radius:var(--button-radius, var(--radius, 12px));
font-family:var(--button-font, var(--font-display));
font-weight:var(--button-weight, 800);
text-transform:var(--button-case, none);
font-size:clamp(1.125rem, 1.55vw, 1.375rem);line-height:1.15;text-align:center;text-wrap:balance;
transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-quantity-breaks-5 .qb5-btn--primary{
min-height:72px;border:0;
color:var(--button-ink, var(--cta-ink));
text-shadow:var(--button-text-shadow, none);
background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l + 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.02) c h));
box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--qb5-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--qb5-shadow) l c h / 0.45));
}
.cf-quantity-breaks-5 .qb5-btn--primary:hover:not(:disabled),
.cf-quantity-breaks-5[data-force='hover'] .qb5-btn--primary:not(:disabled){
background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.01) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.07) c h));
box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--qb5-shadow) l c h / 0.34), 0 12px 20px -6px oklch(from var(--qb5-shadow) l c h / 0.55));
}
.cf-quantity-breaks-5 .qb5-btn--primary:active:not(:disabled),
.cf-quantity-breaks-5[data-force='active'] .qb5-btn--primary:not(:disabled){
transform:translateY(1px);
background:linear-gradient(oklch(from var(--button-bg, var(--cta)) calc(l - 0.04) c h), oklch(from var(--button-bg-2, var(--cta-2)) calc(l - 0.08) c h));
box-shadow:inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - 0.22) c h / 0.5), inset 0 -2px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--qb5-shadow) l c h / 0.3);
}
.cf-quantity-breaks-5 .qb5-btn--quiet{
min-height:64px;
background:var(--button-2-bg, var(--secondary));
color:var(--button-2-ink, var(--secondary-ink));
border-color:var(--button-2-border, transparent);
box-shadow:var(--button-2-shadow, var(--shadow-sm));
}
.cf-quantity-breaks-5 .qb5-btn--quiet:hover:not(:disabled){background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.04) c h)}
.cf-quantity-breaks-5 .qb5-btn--quiet:active:not(:disabled){transform:translateY(1px);background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - 0.07) c h)}
.cf-quantity-breaks-5 .qb5-btn:disabled{cursor:not-allowed;opacity:.5;box-shadow:none;transform:none;text-shadow:none}
.cf-quantity-breaks-5 .qb5-btn[aria-busy='true']{cursor:progress}
.cf-quantity-breaks-5 .qb5-spin{flex:none;animation:qb5-spin .8s linear infinite}
/* focus */
.cf-quantity-breaks-5 :focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / 0.6);outline-offset:3px}
.cf-quantity-breaks-5 .qb5-group :focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
@keyframes qb5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes qb5-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes qb5-spin{to{transform:rotate(360deg)}}
/* phone: halves stack, full-width stepper, sticky bottom total */
@media (max-width: 720px){
.cf-quantity-breaks-5 .qb5-panel{grid-template-columns:minmax(0, 1fr)}
.cf-quantity-breaks-5 .qb5-solo{padding-bottom:40px}
.cf-quantity-breaks-5 .qb5-group{padding-top:44px}
.cf-quantity-breaks-5 .qb5-or{left:50%;top:0}
.cf-quantity-breaks-5 .qb5-tier{padding:10px 12px}
.cf-quantity-breaks-5 .qb5-pick{display:grid;gap:16px}
.cf-quantity-breaks-5 .qb5-stepper{width:100%;grid-template-columns:64px minmax(0, 1fr) 64px}
.cf-quantity-breaks-5 .qb5-checkout{
position:sticky;bottom:0;z-index:4;
margin:28px calc(var(--qb5-pad) * -1) calc(var(--qb5-pad) * -1);
padding:16px var(--qb5-pad) 18px;gap:10px;
background:oklch(from var(--band) calc(l - 0.05) c h);
box-shadow:0 -1px 2px oklch(from var(--qb5-shadow) l c h / 0.3), 0 -10px 18px -8px oklch(from var(--qb5-shadow) l c h / 0.5);
}
.cf-quantity-breaks-5 .qb5-total{flex-wrap:nowrap;align-items:center}
.cf-quantity-breaks-5 .qb5-total-n{font-size:2rem}
.cf-quantity-breaks-5 .qb5-btn{padding:0 16px}
.cf-quantity-breaks-5 .qb5-btn--primary{min-height:60px}
.cf-quantity-breaks-5 .qb5-btn--quiet{min-height:60px}
}
@media (prefers-reduced-motion: reduce){
.cf-quantity-breaks-5 *,.cf-quantity-breaks-5 *::before,.cf-quantity-breaks-5 *::after{animation:none !important;transition:none !important}
.cf-quantity-breaks-5 .qb5-btn:active,.cf-quantity-breaks-5 .qb5-step:active{transform:none}
}
`
pieces/offer/quantity-breaks-5/specimen.tsx 37 lines
import __studioImage7f6a7fb2 from "../assets/a9442e2e90762044.webp";
// Specimen: the Pottery Weekend Retreat seat selector, opening on a crew of four.
import * as React from 'react'
import { QuantityBreaks5, type QuantityBreaks5State } from '../quantity-breaks-5'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function QuantityBreaks5Specimen({ state = 'default' }: { state?: QuantityBreaks5State }) {
return (
<QuantityBreaks5
state={state}
eventName='Pottery Weekend Retreat'
headline='Come solo, or bring your crew and pay less per seat'
highlight='pay less per seat'
seatPrice={347}
groupTiers={[
{ minSeats: 2, name: 'Duo', seatPrice: 319 },
{ minSeats: 4, name: 'Crew', seatPrice: 289 },
{ minSeats: 6, name: 'Studio', seatPrice: 259 },
]}
maxSeats={10}
defaultSeats={4}
soloImage={slot(
'product',
__studioImage7f6a7fb2,
)}
soloImageAlt='A handmade stoneware mug with a speckled glaze and blue rim'
copy={{
soloNote: 'One seat \u00b7 ' + defaults.sample.guarantee,
groupNote: 'One checkout for the whole crew \u00b7 ' + defaults.sample.guarantee,
}}
/>
)
}
| Name | Type | Details |
|---|---|---|
eventName OptionalQuantityBreaks5 |
string |
Default 'Pottery Weekend Retreat'
|
headline OptionalQuantityBreaks5 |
string |
Default 'Come solo, or bring your crew and pay less per seat'
|
highlight OptionalQuantityBreaks5 |
string |
Default 'pay less per seat'
|
lead OptionalQuantityBreaks5 |
string |
Default 'Two days at the wheel at the {event}. Book one seat, or set your group size and watch every seat get cheaper.'
|
seatPrice OptionalQuantityBreaks5 |
number |
Default 347
|
groupTiers OptionalQuantityBreaks5 |
GroupTier[] |
Default DEFAULT_TIERS
|
minGroupSeats OptionalQuantityBreaks5 |
number |
|
maxSeats OptionalQuantityBreaks5 |
number |
Default 10
|
defaultSeats OptionalQuantityBreaks5 |
number |
|
currency OptionalQuantityBreaks5 |
string |
Default '$'
|
locale OptionalQuantityBreaks5 |
string |
Default 'en-US'
|
soloImage OptionalQuantityBreaks5 |
string |
|
soloImageAlt OptionalQuantityBreaks5 |
string |
Default ''
|
soloIncludes OptionalQuantityBreaks5 |
string[] |
Default DEFAULT_INCLUDES
|
reasons OptionalQuantityBreaks5 |
string[] |
Default DEFAULT_REASONS
|
backdrop OptionalQuantityBreaks5 |
string |
Default seminar
|
copy OptionalQuantityBreaks5 |
Partial<QuantityBreaks5Copy> |
|
state OptionalQuantityBreaks5 |
QuantityBreaks5State |
Default 'default'
|
onAction OptionalQuantityBreaks5 |
(choice: SeatChoice) => void | Promise<void> |
|
className OptionalQuantityBreaks5 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
43adf3b56422e1e1.webp
image/webp · 58.2 KB
-
a9442e2e90762044.webp
image/webp · 75 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB