Bundle Picker 6
Turns a package choice into a reply-card order with transparent savings.
Use it in a prompt
Use offer/bundle-picker-6 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/bundle-picker-6.tsx. - Import it and pass your copy and images (Props tab):
import { BundlePicker6 } from "@/components/funneldna/offer/bundle-picker-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/bundle-picker-6/component.tsx 552 lines
// Turns a package choice into a reply-card order with transparent savings.
// layout: certificate-document
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, Lock, Star } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
import { Mark } from '../marks/marks'
export type OrderCardPackage = {
/** Number of units in the package, e.g. 1, 3, 6. */
units: number
/** Total price of the package in the chosen currency. */
price: number
/** Optional photo of this exact package. Without it, productImage is arranged by count. */
image?: string
imageAlt?: string
/** Value posted for this package; defaults to the unit count. */
id?: string
}
export type OrderCardState = 'default' | 'hover' | 'active' | 'disabled' | 'loading' | 'error' | 'success'
export type OrderCardContext = {
units: number
unitWord: string
total: string
perUnit: string
savings: string
}
export type BundlePicker6Props = {
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
packages?: OrderCardPackage[]
unit?: { one: string; other: string }
/** One cut-out unit photo on a plain light background, arranged 1 / 3 / 6 by the card. */
productImage?: string
productAlt?: string
/** Generated guarantee seal (plain light background). */
sealGuaranteeImage?: string
/** Legacy alias for sealGuaranteeImage. */
sealImage?: string
sealAlt?: string
/** Index ticked on load; defaults to the best-value package. */
defaultSelected?: number
currency?: string
locale?: string
buttonLabel?: (ctx: OrderCardContext) => string
loadingLabel?: string
bestValueLabel?: string
perUnitLabel?: string
standardLabel?: string
totalWord?: string
saveWord?: string
fieldLabels?: { pkg: string; total: string; save: string }
guarantee?: string
guaranteeNote?: string
secureLabel?: string
showPaymentMarks?: boolean
errorMessage?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
successTitle?: (ctx: OrderCardContext) => string
/** Deprecated: ignored. The builder wires what happens after the action. */
successBody?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
changeLabel?: string
/** "success" is accepted for older callers and renders as default. */
state?: OrderCardState
onSelect?: (pkg: OrderCardPackage, index: number) => void
/** Called on submit with the ticked package. Without it the button does nothing visible. */
onSubmit?: (pkg: OrderCardPackage, index: number) => void | Promise<void>
/** Templates use {unit}, {units}, {total} and {percent}; imageLabel also uses {quantity} and {product}. */
copy?: Partial<BundlePicker6Copy>
paymentLabels?: Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>>
className?: string
style?: React.CSSProperties
}
export function BundlePicker6({
headline = 'Stock up and pay less for every bottle',
highlight = 'pay less for every bottle',
lead = 'Tick one, three or six bottles. The more you take, the less each bottle costs.',
packages = DEFAULT_PACKAGES,
unit = { one: 'Bottle', other: 'Bottles' },
productImage,
productAlt = 'Amber supplement bottle',
sealImage,
sealGuaranteeImage = sealImage,
sealAlt = 'Gold guarantee seal',
defaultSelected,
currency = 'USD',
locale = 'en-US',
buttonLabel = ({ units, unitWord }) => `Yes! Send Me ${units} ${unitWord}`,
loadingLabel = 'Adding to your order…',
bestValueLabel = 'Best value',
perUnitLabel,
standardLabel = 'Standard price',
totalWord = 'total',
saveWord = 'You save',
fieldLabels = { pkg: 'Package', total: 'Total', save: 'You save' },
guarantee = '30-day money-back guarantee',
guaranteeNote = 'Whichever package you tick.',
secureLabel = '',
showPaymentMarks = true,
errorMessage = 'We couldn’t add that to your order. Please try again.',
state,
onSelect,
onSubmit,
copy,
paymentLabels,
className,
style,
}: BundlePicker6Props) {
const text = { legend: 'Choose your package', perUnit: 'per {unit}', bestSaving: ' · Save {percent}%', regular: 'regular ', selected: '{units} {unit} selected, {total} total', imageLabel: '{quantity}: {product}', payments: 'Accepted cards', ...copy }
const uid = React.useId()
const titleId = `${uid}-title`
const groupName = `${uid}-package`
const perUnit = perUnitLabel ?? formatCopy(text.perUnit, { unit: unit.one.toLowerCase() })
const money = React.useCallback(
(n: number) => {
const whole = Math.abs(n - Math.round(n)) < 0.005
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: whole ? 0 : 2,
}).format(whole ? Math.round(n) : n)
},
[locale, currency]
)
const rows = React.useMemo(() => {
const valid = packages.filter((p) => p.units > 0)
const base = valid.reduce((m, p) => (p.units < m.units ? p : m), valid[0] ?? packages[0])
const baseUnit = base && base.units > 0 ? base.price / base.units : 0
return packages.map((p) => {
const per = p.units > 0 ? p.price / p.units : p.price
const compare = baseUnit * p.units
const raw = compare - p.price
const savings = raw > 0.005 ? raw : 0
const pct = savings > 0 && compare > 0 ? Math.round((savings / compare) * 100) : 0
return { per, compare, savings, pct, baseUnit }
})
}, [packages])
const bestIndex = React.useMemo(() => {
if (rows.length < 2) return -1
const min = Math.min(...rows.map((r) => r.per))
const hits = rows.filter((r) => Math.abs(r.per - min) < 0.005)
if (hits.length !== 1 || min >= rows[0].baseUnit - 0.005) return -1
return rows.findIndex((r) => Math.abs(r.per - min) < 0.005)
}, [rows])
const [selected, setSelected] = React.useState(() => {
if (typeof defaultSelected === 'number' && defaultSelected >= 0 && defaultSelected < packages.length) return defaultSelected
return bestIndex >= 0 ? bestIndex : 0
})
const sel = Math.min(Math.max(selected, 0), Math.max(packages.length - 1, 0))
const [status, setStatus] = React.useState<Status>(() => statusFrom(state))
React.useEffect(() => {
setStatus(statusFrom(state))
}, [state])
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const disabled = state === 'disabled'
const loading = status === 'loading'
const locked = disabled || loading
const forced = state === 'hover' || state === 'active' ? state : undefined
const ctxFor = (i: number): OrderCardContext => {
const p = packages[i] ?? packages[0]
const r = rows[i] ?? rows[0]
return {
units: p.units,
unitWord: p.units === 1 ? unit.one : unit.other,
total: money(p.price),
perUnit: money(r.per),
savings: r.savings > 0 ? money(r.savings) : '',
}
}
const ctx = ctxFor(sel)
const choose = (i: number) => {
if (locked) return
setSelected(i)
onSelect?.(packages[i], i)
}
const submit = async (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault()
if (disabled || loading || !onSubmit) return
const pkg = packages[sel]
setStatus('loading')
try {
await onSubmit(pkg, sel)
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
return (
<div className={['bp6 cf-bundle-picker-6', className].filter(Boolean).join(' ')} style={style}>
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&display=swap' />
<style>{CSS}</style>
<form className='bp6-doc' onSubmit={submit} aria-labelledby={titleId} noValidate data-disabled={disabled || undefined}>
<header className='bp6-top'>
<h2 id={titleId} className='bp6-h'>
{withMarker(headline, highlight)}
</h2>
{lead ? <p className='bp6-lead'>{lead}</p> : null}
<span className='bp6-orn' aria-hidden='true'>
<i />
<Star size={14} fill='currentColor' strokeWidth={0} />
<i />
</span>
</header>
<fieldset className='bp6-set' disabled={locked}>
<legend className='bp6-sr'>{text.legend}</legend>
<div className='bp6-grid' style={{ '--n': Math.min(Math.max(packages.length, 1), 3) } as React.CSSProperties}>
{packages.map((p, i) => {
const on = i === sel
const r = rows[i]
const word = p.units === 1 ? unit.one : unit.other
const qty = `${p.units} ${word}`
const best = i === bestIndex
const hasArt = Boolean(p.image || productImage)
return (
<label key={p.id ?? i} className='bp6-pkg' data-on={on || undefined} data-best={best || undefined}>
<input
className='bp6-sr'
type='radio'
name={groupName}
value={p.id ?? String(p.units)}
checked={on}
onChange={() => choose(i)}
/>
{best ? (
<span className='bp6-tab'>
{bestValueLabel}
{r.pct > 0 ? formatCopy(text.bestSaving, { percent: r.pct }) : ''}
</span>
) : null}
<span className='bp6-head'>
<span className='bp6-box' aria-hidden='true'>
{on ? (
<span className='bp6-tick'>
<Mark name='check' width={40} height={40} />
</span>
) : null}
</span>
<span className='bp6-qty'>{qty}</span>
</span>
{hasArt ? (
<span className='bp6-art'>
{p.image ? (
<img className='bp6-shot' src={p.image} alt={p.imageAlt ?? formatCopy(text.imageLabel, { quantity: qty, product: productAlt })} loading='lazy' decoding='async' />
) : (
<Bottles count={p.units} src={productImage as string} label={formatCopy(text.imageLabel, { quantity: qty, product: productAlt })} />
)}
</span>
) : null}
<span className='bp6-rule' aria-hidden='true' />
<span className='bp6-price'>
<span className='bp6-per'>{money(r.per)}</span>
<span className='bp6-per-u'>{perUnit}</span>
</span>
<span className='bp6-total'>
<span className='bp6-total-l'>
<b>{money(p.price)}</b> {totalWord}
{r.savings > 0 ? (
<s>
<span className='bp6-sr'>{text.regular}</span>
{money(r.compare)}
</s>
) : null}
</span>
{r.savings > 0 ? (
<span className='bp6-save'>
{saveWord} {money(r.savings)}
</span>
) : (
<span className='bp6-std'>{standardLabel}</span>
)}
</span>
</label>
)
})}
</div>
</fieldset>
<p className='bp6-sr' aria-live='polite'>
{formatCopy(text.selected, { units: ctx.units, unit: ctx.unitWord, total: ctx.total })}
</p>
<div className='bp6-sum'>
<div className='bp6-fields' style={{ '--cols': ctx.savings ? 3 : 2 } as React.CSSProperties}>
<div className='bp6-field'>
<span className='bp6-flabel'>{fieldLabels.pkg}</span>
<span className='bp6-fval'>{`${ctx.units} ${ctx.unitWord}`}</span>
</div>
<div className='bp6-field'>
<span className='bp6-flabel'>{fieldLabels.total}</span>
<span className='bp6-fval'>{ctx.total}</span>
</div>
{ctx.savings ? (
<div className='bp6-field'>
<span className='bp6-flabel'>{fieldLabels.save}</span>
<span className='bp6-fval'>{ctx.savings}</span>
</div>
) : null}
</div>
{guarantee ? (
<div className='bp6-seal'>
{sealGuaranteeImage ? <img src={sealGuaranteeImage} alt={sealAlt} width={92} height={92} loading='lazy' decoding='async' /> : null}
<span>
<b className='bp6-gt'>{guarantee}</b>
{guaranteeNote ? <span className='bp6-gn'>{guaranteeNote}</span> : null}
</span>
</div>
) : null}
</div>
<div className='bp6-action'>
{status === 'error' ? (
<p className='bp6-err' role='alert'>
<AlertCircle size={20} aria-hidden='true' />
<span>{errorMessage}</span>
</p>
) : null}
<button type='submit' className='bp6-btn' disabled={disabled} aria-busy={loading || undefined} data-force={forced}>
<span className='bp6-btn-l'>{loading ? loadingLabel : buttonLabel(ctx)}</span>
{loading ? <Loader2 className='bp6-spin' size={22} aria-hidden='true' /> : null}
</button>
<p className='bp6-secure'>
{secureLabel ? (
<span className='bp6-lock'>
<Lock size={16} aria-hidden='true' />
{secureLabel}
</span>
) : null}
{showPaymentMarks ? (
<span className='bp6-pay' role='list' aria-label={text.payments}>
{PAY.map(([label, Icon]) => (
<span key={label} role='listitem'>
<Icon width={38} aria-label={paymentLabels?.[label] ?? label} />
</span>
))}
</span>
) : null}
</p>
</div>
</form>
</div>
)
}
export default BundlePicker6
export const BundlePickerOrderCard = BundlePicker6
export type BundlePickerOrderCardProps = BundlePicker6Props
type BundlePicker6Copy = { legend: string; perUnit: string; bestSaving: string; regular: string; selected: string; imageLabel: string; payments: string }
function formatCopy(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (placeholder, key: string) => values[key] === undefined ? placeholder : String(values[key]))
}
type Status = 'idle' | 'loading' | 'error'
const DEFAULT_PACKAGES: OrderCardPackage[] = [
{ units: 1, price: 47 },
{ units: 3, price: 129 },
{ units: 6, price: 234 },
]
const PAY = [
['Visa', Visa],
['Mastercard', Mastercard],
['American Express', AmericanExpress],
['Discover', Discover],
] as const
function statusFrom(state?: OrderCardState): Status {
if (state === 'loading' || state === 'error') return state
return 'idle'
}
function withMarker(text: string, phrase?: string) {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='bp6-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function Bottles({ count, src, label }: { count: number; src: string; label: string }) {
const n = Math.max(1, Math.min(Math.round(count), 6))
const layout = n === 1 ? 'single' : n <= 3 ? 'row' : 'stack'
const rows = n <= 3 ? [n] : [Math.ceil(n / 2), Math.floor(n / 2)]
return (
<span className='bp6-bottles' data-layout={layout} role='img' aria-label={label}>
{rows.map((c, r) => (
<span key={r} className='bp6-brow' data-back={layout === 'stack' && r === 0 ? '' : undefined}>
{Array.from({ length: c }, (_, k) => (
<img key={k} className='bp6-bottle' src={src} alt='' loading='lazy' decoding='async' draggable={false} />
))}
</span>
))}
</span>
)
}
// Reduced-motion !important preserves the existing motion and selected-state cascade.
const CSS = `
.cf-bundle-picker-6{--u:1;container-type:inline-size;container-name:bp6;width:100%;font-family:var(--font-body,Georgia,'Times New Roman',serif);color:var(--ink,#101828);-webkit-font-smoothing:antialiased}
.cf-bundle-picker-6 *,.cf-bundle-picker-6 *::before,.cf-bundle-picker-6 *::after{box-sizing:border-box}
:where(.cf-bundle-picker-6) .bp6-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;accent-color:var(--field-focus, var(--accent))}
:where(.cf-bundle-picker-6) .bp6-doc{--bp6-paper:color-mix(in oklch, var(--ink) 4%, var(--card));--bp6-panel:var(--card);--bp6-ink:var(--ink);--bp6-rule:oklch(from var(--bp6-ink) l c h / 0.26);--bp6-rule-soft:oklch(from var(--bp6-ink) l c h / 0.13);--bp6-pen:var(--accent,#0f5fc2);--bp6-red:var(--danger);--bp6-gold:var(--accent-fill,var(--accent));--bp6-marker:var(--marker, color-mix(in oklch, var(--accent) 12%, var(--card)));position:relative;isolation:isolate;max-width:1000px;margin:0 auto;padding:48px 44px 34px;background-color:var(--bp6-paper);background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .32 0 0 0 0 .14 0 0 0 .09 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");border:2px solid var(--card-border, var(--bp6-ink));border-radius:var(--card-radius, var(--radius, 6px));box-shadow:var(--card-shadow, inset 0 0 0 7px var(--bp6-paper), inset 0 0 0 8px var(--bp6-rule), var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)))}
:where(.cf-bundle-picker-6) .bp6-top{text-align:center}
:where(.cf-bundle-picker-6) .bp6-h{margin:0 auto;font-family:var(--font-display,Georgia,serif);font-weight:var(--display-weight, 800);font-size:clamp(30px,5.2cqi,54px);line-height:1.06;letter-spacing:var(--display-tracking, -.018em);color:var(--bp6-ink);text-wrap:balance;font-optical-sizing:auto;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-mark{background:linear-gradient(180deg,transparent 50%,var(--bp6-marker) 50%,var(--bp6-marker) 93%,transparent 93%);padding:0 .14em;margin:0 -.06em;border-radius:.35em .12em .4em .15em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
:where(.cf-bundle-picker-6) .bp6-lead{margin:16px auto 0;max-width:46ch;font-size:19px;font-weight:500;line-height:1.5;color:var(--muted,#4a5565);text-wrap:pretty}
:where(.cf-bundle-picker-6) .bp6-orn{display:flex;align-items:center;justify-content:center;gap:12px;margin:22px auto 34px;color:var(--bp6-gold)}
:where(.cf-bundle-picker-6) .bp6-orn i{display:block;width:72px;height:1.5px;background:var(--bp6-rule)}
:where(.cf-bundle-picker-6) .bp6-set{margin:0;padding:0;border:0;min-width:0}
:where(.cf-bundle-picker-6) .bp6-grid{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:20px;align-items:stretch;padding-top:6px}
:where(.cf-bundle-picker-6) .bp6-pkg{position:relative;isolation:isolate;display:flex;flex-direction:column;align-items:center;text-align:center;padding:32px 20px 22px;background:var(--bp6-panel);border:2px solid var(--card-border, var(--bp6-rule));border-radius:var(--card-radius, var(--radius, 6px));box-shadow:var(--card-shadow, inset 0 0 0 5px var(--bp6-panel), inset 0 0 0 6px var(--bp6-rule-soft), var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));cursor:pointer;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
@media (hover:hover){:where(.cf-bundle-picker-6) .bp6-pkg:hover{transform:translateY(-2px);border-color:oklch(from var(--bp6-ink) l c h / 0.55);box-shadow:inset 0 0 0 5px var(--bp6-panel), inset 0 0 0 6px var(--bp6-rule-soft), var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}}
:where(.cf-bundle-picker-6) .bp6-pkg[data-on]{border-color:var(--bp6-ink);transform:translateY(-3px);box-shadow:0 0 0 1px var(--bp6-ink), inset 0 0 0 5px var(--bp6-panel), inset 0 0 0 6px var(--bp6-rule), var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-bundle-picker-6) .bp6-pkg:has(input:focus-visible){outline:3px solid var(--bp6-pen);outline-offset:4px}
:where(.cf-bundle-picker-6) .bp6-set:disabled .bp6-pkg{cursor:default}
:where(.cf-bundle-picker-6) .bp6-doc[data-disabled] .bp6-pkg{cursor:not-allowed;opacity:.55;transform:none}
:where(.cf-bundle-picker-6) .bp6-tab{position:absolute;top:-14px;left:50%;transform:translateX(-50%);z-index:2;display:inline-flex;align-items:center;padding:6px 14px;border-radius:4px;background:var(--band);color:var(--band-ink,#ffffff);font-size:14px;font-weight:700;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-bundle-picker-6) .bp6-head{display:inline-flex;align-items:center;gap:12px}
:where(.cf-bundle-picker-6) .bp6-box{position:relative;width:26px;height:26px;flex:none;border:2px solid var(--bp6-ink);border-radius:var(--field-radius, var(--radius, 3px));background:var(--field, var(--card));border-color:var(--field-border, var(--ink))}
:where(.cf-bundle-picker-6) .bp6-tick{position:absolute;left:-2px;top:-15px;line-height:0;color:var(--success);pointer-events:none;animation:bp6-tick .26s cubic-bezier(.2,1.4,.4,1) both}
:where(.cf-bundle-picker-6) .bp6-qty{font-family:var(--font-display,Georgia,serif);font-weight:var(--display-weight, 800);font-size:30px;line-height:1.08;letter-spacing:var(--display-tracking, -.01em);color:var(--bp6-ink);white-space:nowrap;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-art{display:flex;align-items:flex-end;justify-content:center;width:100%;height:calc(var(--u)*158px);margin-top:18px}
:where(.cf-bundle-picker-6) .bp6-shot{display:block;height:100%;width:auto;max-width:100%;object-fit:contain;mix-blend-mode:normal}
:where(.cf-bundle-picker-6) .bp6-bottles{display:flex;flex-direction:column;align-items:center}
:where(.cf-bundle-picker-6) .bp6-brow{display:flex;justify-content:center}
:where(.cf-bundle-picker-6) .bp6-bottle{display:block;flex:none;width:calc(var(--u)*158px);height:calc(var(--u)*158px);object-fit:contain;mix-blend-mode:normal;user-select:none}
:where(.cf-bundle-picker-6) .bp6-bottles[data-layout='row'] .bp6-bottle{width:calc(var(--u)*112px);height:calc(var(--u)*112px)}
:where(.cf-bundle-picker-6) .bp6-bottles[data-layout='row'] .bp6-bottle+.bp6-bottle{margin-left:calc(var(--u)*-46px)}
:where(.cf-bundle-picker-6) .bp6-brow[data-back] .bp6-bottle{width:calc(var(--u)*86px);height:calc(var(--u)*86px)}
:where(.cf-bundle-picker-6) .bp6-brow[data-back] .bp6-bottle+.bp6-bottle{margin-left:calc(var(--u)*-34px)}
:where(.cf-bundle-picker-6) .bp6-bottles[data-layout='stack'] .bp6-brow:not([data-back]){margin-top:calc(var(--u)*-30px)}
:where(.cf-bundle-picker-6) .bp6-bottles[data-layout='stack'] .bp6-brow:not([data-back]) .bp6-bottle{width:calc(var(--u)*98px);height:calc(var(--u)*98px)}
:where(.cf-bundle-picker-6) .bp6-bottles[data-layout='stack'] .bp6-brow:not([data-back]) .bp6-bottle+.bp6-bottle{margin-left:calc(var(--u)*-40px)}
:where(.cf-bundle-picker-6) .bp6-rule{display:block;width:100%;margin:16px 0 18px;border-top:1.5px dashed var(--bp6-rule);margin-top:auto;padding-top:16px;height:0;box-sizing:content-box}
:where(.cf-bundle-picker-6) .bp6-art+.bp6-rule{margin-top:16px}
:where(.cf-bundle-picker-6) .bp6-price{display:flex;align-items:baseline;justify-content:center;flex-wrap:wrap;gap:4px 8px}
:where(.cf-bundle-picker-6) .bp6-per{font-family:var(--font-display,Georgia,serif);font-weight:var(--display-weight, 800);font-size:42px;line-height:1.1;letter-spacing:var(--display-tracking, -.02em);color:var(--bp6-ink);font-variant-numeric:tabular-nums lining-nums;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-per-u{font-size:16px;font-weight:600;color:var(--muted,#4a5565)}
:where(.cf-bundle-picker-6) .bp6-total{display:block;margin-top:12px;font-size:16px;line-height:1.45;color:var(--ink,#101828)}
:where(.cf-bundle-picker-6) .bp6-total-l{display:block}
:where(.cf-bundle-picker-6) .bp6-total b{font-weight:700;font-variant-numeric:tabular-nums}
:where(.cf-bundle-picker-6) .bp6-total s{margin-left:8px;color:var(--danger);text-decoration-thickness:1.5px;text-decoration-color:var(--danger)}
:where(.cf-bundle-picker-6) .bp6-save{display:block;font-weight:700;color:var(--success);background:var(--success-soft)}
:where(.cf-bundle-picker-6) .bp6-std{display:block;color:var(--muted,#4a5565)}
:where(.cf-bundle-picker-6) .bp6-sum{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px 32px;align-items:start;margin-top:30px}
:where(.cf-bundle-picker-6) .bp6-fields{display:grid;grid-template-columns:repeat(var(--cols,3),minmax(0,1fr));gap:10px}
:where(.cf-bundle-picker-6) .bp6-field{min-width:0;padding:10px 14px 8px;background:var(--bp6-panel);border:1.5px solid var(--card-border, var(--bp6-rule));border-radius:var(--card-radius, var(--radius, 4px));box-shadow:none}
:where(.cf-bundle-picker-6) .bp6-flabel{display:block;font-size:14px;font-weight:600;line-height:1.3;color:var(--muted,#4a5565)}
:where(.cf-bundle-picker-6) .bp6-fval{display:block;margin-top:2px;font-family:var(--signature-font, var(--signature-face, var(--font-display)));font-weight:700;font-size:31px;line-height:1.1;color:var(--bp6-pen);white-space:nowrap}
:where(.cf-bundle-picker-6) .bp6-seal{display:flex;align-items:center;gap:14px}
:where(.cf-bundle-picker-6) .bp6-seal img{display:block;flex:none;width:92px;height:92px;object-fit:contain;mix-blend-mode:normal}
:where(.cf-bundle-picker-6) .bp6-gt{display:block;font-family:var(--font-display,Georgia,serif);font-weight:var(--display-weight, 700);font-size:20px;line-height:1.2;color:var(--bp6-ink);text-wrap:balance;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-gn{display:block;margin-top:4px;max-width:24ch;font-size:15px;line-height:1.4;color:var(--muted,#4a5565);text-wrap:pretty}
:where(.cf-bundle-picker-6) .bp6-action{display:grid;justify-items:center;gap:14px;margin-top:28px}
:where(.cf-bundle-picker-6) .bp6-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:12px;width:100%;max-width:640px;min-height:68px;padding:14px 24px;border:1px solid color-mix(in oklch,var(--button-bg-2, var(--cta-2,#b42318)) 78%,var(--ink));border-radius:var(--button-radius, var(--radius, 8px));background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));color:var(--button-ink, var(--cta-ink,#ffffff));font-family:var(--button-font, var(--font-display,Georgia,serif));font-weight:var(--button-weight, 800);font-size:clamp(20px,2.8cqi,26px);line-height:1.15;letter-spacing:.005em;text-wrap:balance;cursor:pointer;text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .35), var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h));transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;text-transform:var(--button-case, none)}
:where(.cf-bundle-picker-6) .bp6-btn[aria-busy='true']::before{content:'';width:22px;flex:none}
:where(.cf-bundle-picker-6) .bp6-btn-l{min-width:0}
@media (hover:hover){:where(.cf-bundle-picker-6) .bp6-btn:hover:not(:disabled){transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .4), var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h));background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h)}}
:where(.cf-bundle-picker-6) .bp6-btn[data-force='hover']{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .4), var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h));background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h)}
:where(.cf-bundle-picker-6) .bp6-btn:active:not(:disabled),:where(.cf-bundle-picker-6) .bp6-btn[data-force='active']{transform:translateY(1px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35), 0 1px 1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2), inset 0 -1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h));background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h)}
:where(.cf-bundle-picker-6) .bp6-btn:focus-visible{outline:3px solid var(--bp6-ink);outline-offset:3px}
:where(.cf-bundle-picker-6) .bp6-btn:disabled{cursor:not-allowed;background:var(--card);border-color:var(--card);color:var(--ink);text-shadow:none;box-shadow:var(--button-2-shadow, var(--shadow-sm));filter:none;transform:none}
:where(.cf-bundle-picker-6) .bp6-btn[aria-busy='true']{cursor:progress}
:where(.cf-bundle-picker-6) .bp6-spin{flex:none;animation:bp6-spin .8s linear infinite}
:where(.cf-bundle-picker-6) .bp6-secure{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px 14px;margin:0;font-size:15px;font-weight:600;color:var(--muted,#4a5565)}
:where(.cf-bundle-picker-6) .bp6-lock{display:inline-flex;align-items:center;gap:6px}
:where(.cf-bundle-picker-6) .bp6-pay{display:inline-flex;align-items:center;gap:6px}
:where(.cf-bundle-picker-6) .bp6-pay svg{display:block}
:where(.cf-bundle-picker-6) .bp6-err{display:flex;align-items:flex-start;gap:10px;width:100%;max-width:640px;margin:0;padding:12px 16px;border:1.5px solid var(--bp6-red);border-radius:6px;background:var(--danger-soft);color:var(--danger);font-size:16px;font-weight:600;line-height:1.4;text-wrap:pretty;animation:bp6-in .25s ease both}
:where(.cf-bundle-picker-6) .bp6-err svg{flex:none;margin-top:1px}
@keyframes bp6-tick{from{opacity:0;transform:scale(.3) rotate(-14deg)}to{opacity:1;transform:none}}
@keyframes bp6-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes bp6-spin{to{transform:rotate(360deg)}}
@container bp6 (max-width: 980px){:where(.cf-bundle-picker-6) .bp6-doc{--u:.88}}
@container bp6 (max-width: 820px){
:where(.cf-bundle-picker-6) .bp6-doc{--u:.56;padding:34px 20px 26px}
:where(.cf-bundle-picker-6) .bp6-grid{grid-template-columns:minmax(0,1fr);gap:24px}
:where(.cf-bundle-picker-6) .bp6-pkg{display:grid;grid-template-columns:136px minmax(0,1fr);grid-template-areas:'art head' 'art price' 'art total';column-gap:14px;row-gap:8px;align-items:start;text-align:left;padding:26px 16px 18px}
:where(.cf-bundle-picker-6) .bp6-head{grid-area:head}
:where(.cf-bundle-picker-6) .bp6-art{grid-area:art;align-self:center;margin:0;height:calc(var(--u)*158px)}
:where(.cf-bundle-picker-6) .bp6-rule{display:none}
:where(.cf-bundle-picker-6) .bp6-price{grid-area:price;justify-content:flex-start}
:where(.cf-bundle-picker-6) .bp6-total{grid-area:total;margin-top:0}
:where(.cf-bundle-picker-6) .bp6-tab{left:14px;transform:none}
:where(.cf-bundle-picker-6) .bp6-qty{font-size:25px;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-per{font-size:32px;text-transform:var(--display-case, none)}
:where(.cf-bundle-picker-6) .bp6-sum{grid-template-columns:minmax(0,1fr)}
}
@container bp6 (max-width: 480px){
:where(.cf-bundle-picker-6) .bp6-doc{--u:.46;padding:30px 14px 22px;box-shadow:var(--card-shadow, inset 0 0 0 5px var(--bp6-paper), inset 0 0 0 6px var(--bp6-rule), var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)))}
:where(.cf-bundle-picker-6) .bp6-pkg{grid-template-columns:118px minmax(0,1fr);column-gap:10px;padding:26px 12px 16px}
:where(.cf-bundle-picker-6) .bp6-lead{font-size:17px}
:where(.cf-bundle-picker-6) .bp6-orn{margin:18px auto 30px}
:where(.cf-bundle-picker-6) .bp6-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
:where(.cf-bundle-picker-6) .bp6-field:first-child{grid-column:1/-1}
:where(.cf-bundle-picker-6) .bp6-fval{font-size:28px}
:where(.cf-bundle-picker-6) .bp6-seal img{width:78px;height:78px}
:where(.cf-bundle-picker-6) .bp6-btn{padding:14px 16px;text-transform:var(--button-case, none);font-family:var(--button-font, var(--font-body))}
}
@media (prefers-reduced-motion: reduce){
.cf-bundle-picker-6 *,.cf-bundle-picker-6 *::before,.cf-bundle-picker-6 *::after{animation:none!important;transition:none!important}
:where(.cf-bundle-picker-6) .bp6-pkg,:where(.cf-bundle-picker-6) .bp6-pkg[data-on],:where(.cf-bundle-picker-6) .bp6-btn,:where(.cf-bundle-picker-6) .bp6-btn[data-force='hover']{transform:none!important}
}
`
pieces/offer/bundle-picker-6/specimen.tsx 31 lines
import { slot } from "../../slots";
import __studioImageda7b65b0 from "../assets/1009c39bfdddf6a3.webp";
import __studioImagea623ab98 from "../assets/8a68b729ae7ed6b3.webp";
import * as React from 'react'
import defaults from '../../studio-defaults.json'
import { BundlePicker6, type OrderCardState } from '../bundle-picker-6'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function BundlePicker6Specimen({ state }: { state?: string }) {
const sample = defaults.sample
const single = Number(String(sample.price).replace(/[^0-9.]/g, '')) || 47
return (
<div>
<BundlePicker6
state={state as OrderCardState | undefined}
packages={[
{ units: 1, price: single },
{ units: 3, price: 129 },
{ units: 6, price: 234 },
]}
guarantee={sample.guarantee}
secureLabel='Secure checkout'
productImage={slot("product", __studioImageda7b65b0)}
productAlt='Amber supplement bottle with a blank cream label'
sealGuaranteeImage={slot("seal-guarantee", __studioImagea623ab98)}
sealAlt='Gold guarantee seal'
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalBundlePicker6 |
string |
Default 'Stock up and pay less for every bottle'
|
highlight OptionalBundlePicker6 |
string |
Default 'pay less for every bottle'
|
lead OptionalBundlePicker6 |
string |
Default 'Tick one, three or six bottles. The more you take, the less each bottle costs.'
|
packages OptionalBundlePicker6 |
OrderCardPackage[] |
Default DEFAULT_PACKAGES
|
unit OptionalBundlePicker6 |
{ one: string; other: string } |
Default { one: 'Bottle', other: 'Bottles' }
|
productImage OptionalBundlePicker6 |
string |
|
productAlt OptionalBundlePicker6 |
string |
Default 'Amber supplement bottle'
|
sealGuaranteeImage OptionalBundlePicker6 |
string |
Default sealImage
|
sealImage OptionalBundlePicker6 |
string |
|
sealAlt OptionalBundlePicker6 |
string |
Default 'Gold guarantee seal'
|
defaultSelected OptionalBundlePicker6 |
number |
|
currency OptionalBundlePicker6 |
string |
Default 'USD'
|
locale OptionalBundlePicker6 |
string |
Default 'en-US'
|
buttonLabel OptionalBundlePicker6 |
(ctx: OrderCardContext) => string |
Default ({ units, unitWord }) => `Yes! Send Me ${units} ${unitWord}`
|
loadingLabel OptionalBundlePicker6 |
string |
Default 'Adding to your order…'
|
bestValueLabel OptionalBundlePicker6 |
string |
Default 'Best value'
|
perUnitLabel OptionalBundlePicker6 |
string |
|
standardLabel OptionalBundlePicker6 |
string |
Default 'Standard price'
|
totalWord OptionalBundlePicker6 |
string |
Default 'total'
|
saveWord OptionalBundlePicker6 |
string |
Default 'You save'
|
fieldLabels OptionalBundlePicker6 |
{ pkg: string; total: string; save: string } |
Default { pkg: 'Package', total: 'Total', save: 'You save' }
|
guarantee OptionalBundlePicker6 |
string |
Default '30-day money-back guarantee'
|
guaranteeNote OptionalBundlePicker6 |
string |
Default 'Whichever package you tick.'
|
secureLabel OptionalBundlePicker6 |
string |
Default ''
|
showPaymentMarks OptionalBundlePicker6 |
boolean |
Default true
|
errorMessage OptionalBundlePicker6 |
string |
Default 'We couldn’t add that to your order. Please try again.'
|
successTitle OptionalBundlePicker6 |
(ctx: OrderCardContext) => string |
|
successBody OptionalBundlePicker6 |
string |
|
changeLabel OptionalBundlePicker6 |
string |
|
state OptionalBundlePicker6 |
OrderCardState |
|
onSelect OptionalBundlePicker6 |
(pkg: OrderCardPackage, index: number) => void |
|
onSubmit OptionalBundlePicker6 |
(pkg: OrderCardPackage, index: number) => void | Promise<void> |
|
copy OptionalBundlePicker6 |
Partial<BundlePicker6Copy> |
|
paymentLabels OptionalBundlePicker6 |
Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>> |
|
className OptionalBundlePicker6 |
string |
|
style OptionalBundlePicker6 |
React.CSSProperties |
|
headline OptionalBundlePickerOrderCard |
string |
|
highlight OptionalBundlePickerOrderCard |
string |
|
lead OptionalBundlePickerOrderCard |
string |
|
packages OptionalBundlePickerOrderCard |
OrderCardPackage[] |
|
unit OptionalBundlePickerOrderCard |
{ one: string; other: string } |
|
productImage OptionalBundlePickerOrderCard |
string |
|
productAlt OptionalBundlePickerOrderCard |
string |
|
sealGuaranteeImage OptionalBundlePickerOrderCard |
string |
|
sealImage OptionalBundlePickerOrderCard |
string |
|
sealAlt OptionalBundlePickerOrderCard |
string |
|
defaultSelected OptionalBundlePickerOrderCard |
number |
|
currency OptionalBundlePickerOrderCard |
string |
|
locale OptionalBundlePickerOrderCard |
string |
|
buttonLabel OptionalBundlePickerOrderCard |
(ctx: OrderCardContext) => string |
|
loadingLabel OptionalBundlePickerOrderCard |
string |
|
bestValueLabel OptionalBundlePickerOrderCard |
string |
|
perUnitLabel OptionalBundlePickerOrderCard |
string |
|
standardLabel OptionalBundlePickerOrderCard |
string |
|
totalWord OptionalBundlePickerOrderCard |
string |
|
saveWord OptionalBundlePickerOrderCard |
string |
|
fieldLabels OptionalBundlePickerOrderCard |
{ pkg: string; total: string; save: string } |
|
guarantee OptionalBundlePickerOrderCard |
string |
|
guaranteeNote OptionalBundlePickerOrderCard |
string |
|
secureLabel OptionalBundlePickerOrderCard |
string |
|
showPaymentMarks OptionalBundlePickerOrderCard |
boolean |
|
errorMessage OptionalBundlePickerOrderCard |
string |
|
successTitle OptionalBundlePickerOrderCard |
(ctx: OrderCardContext) => string |
|
successBody OptionalBundlePickerOrderCard |
string |
|
changeLabel OptionalBundlePickerOrderCard |
string |
|
state OptionalBundlePickerOrderCard |
OrderCardState |
|
onSelect OptionalBundlePickerOrderCard |
(pkg: OrderCardPackage, index: number) => void |
|
onSubmit OptionalBundlePickerOrderCard |
(pkg: OrderCardPackage, index: number) => void | Promise<void> |
|
copy OptionalBundlePickerOrderCard |
Partial<BundlePicker6Copy> |
|
paymentLabels OptionalBundlePickerOrderCard |
Partial<Record<'Visa' | 'Mastercard' | 'American Express' | 'Discover', string>> |
|
className OptionalBundlePickerOrderCard |
string |
|
style OptionalBundlePickerOrderCard |
React.CSSProperties |
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-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--field-border--field-focus--field-radius- 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).
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
1009c39bfdddf6a3.webp
image/webp · 21.1 KB
-
8a68b729ae7ed6b3.webp
image/webp · 265 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB