Variant Picker 6
Variant picker that sells the add-to-order step: the chosen cover lights up on a dark stage while a three-stop path
Use it in a prompt
Use offer/variant-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/variant-picker-6.tsx. - Import it and pass your copy and images (Props tab):
import { VariantPicker6 } from "@/components/funneldna/offer/variant-picker-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/variant-picker-6/component.tsx 521 lines
// layout: path-to-action
// Variant picker that sells the add-to-order step: the chosen cover lights up on a dark stage while a three-stop path
// walks the buyer from choice to clipped price to the button, so picking a finish flows straight into buying it.
import * as React from 'react'
import { Check, CircleAlert, Scissors } from 'lucide-react'
export type PickerVariant = {
id: string
label: string
/** One short line shown under the stage, e.g. the finish. */
detail?: string
/** CSS colour of the physical finish. This is product data (like a photo), not a theme colour. */
swatch?: string
/** This variant's product shot (slot: product). A transparent background sits best on the stage. */
image?: string
imageAlt?: string
/** Overrides the shared price for this variant. */
price?: string
regularPrice?: string
disabled?: boolean
}
export type VariantPicker6Copy = {
pickTitle: string
/** Placeholder: {saving}. */
priceTitle: string
/** Step two title when there is no saving to show. */
priceTitlePlain: string
actionTitle: string
/** Screen-reader label read before the price. */
todayLabel: string
/** Screen-reader label read before the struck regular price. */
regularLabel: string
/** Placeholders: {saving}, {regular}. */
saveLine: string
commitLabel: string
/** Main button text. */
label: string
/** Button sub-line once a variant is chosen. Placeholders: {price}, {variant}. */
sublabel: string
/** Button sub-line while nothing is chosen. */
sublabelEmpty: string
chooseError: string
commitError: string
/** Shown under a disabled variant chip. */
unavailable: string
/** Default stage image alt. Placeholders: {name}, {variant}. */
imageAlt: string
/** Accessible form name. Placeholder: {name}. */
formLabel: string
}
export type VariantPicker6State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type VariantPicker6Props = {
/** Product name, shown as the headline. */
name?: string
/** Short line under the headline. */
lead?: string
variants?: PickerVariant[]
/** Pre-selected variant id; null starts with nothing chosen. */
defaultVariant?: string | null
/** Shared price for every variant that doesn't set its own. */
price?: string
/** Shared struck regular price; the saving is computed from it. */
regularPrice?: string
/** Small line under the price. */
note?: string
/** Show the guarantee acknowledgement above the button and require it before submit. */
requireCommit?: boolean
/** Whether the acknowledgement starts ticked. */
defaultCommitted?: boolean
copy?: Partial<VariantPicker6Copy>
disabled?: boolean
state?: VariantPicker6State
/** Receives the chosen variant on a valid submit. */
onSubmit?: (variant: PickerVariant) => void
className?: string
}
export function VariantPicker6(props: VariantPicker6Props) {
const {
name = 'The Funnel Starter Kit',
lead = 'Your guide, workbook and launch checklist, printed and bound. Pick the cover you’ll keep on your desk.',
variants = DEFAULT_VARIANTS,
defaultVariant,
price = '$47',
regularPrice = '$97',
note = 'One payment · Lifetime access',
requireCommit = true,
defaultCommitted = true,
copy,
disabled: disabledProp = false,
state = 'default',
onSubmit,
className,
} = props
const t = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const groupName = 'vp6-' + uid
const chooseErrId = groupName + '-choose'
const commitErrId = groupName + '-commit'
const firstAvailable = variants.find((v) => !v.disabled)?.id ?? null
const initial = defaultVariant === null ? null : defaultVariant ?? firstAvailable
const [selected, setSelected] = React.useState<string | null>(state === 'error' ? null : initial)
const [committed, setCommitted] = React.useState(defaultCommitted)
const [error, setError] = React.useState<'choose' | 'commit' | null>(state === 'error' ? 'choose' : null)
const chipsRef = React.useRef<HTMLDivElement>(null)
const commitRef = React.useRef<HTMLInputElement>(null)
React.useEffect(() => {
if (state === 'error') {
setSelected(null)
setError('choose')
} else {
setSelected(initial)
setError(null)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
const disabled = disabledProp || state === 'disabled'
const current = variants.find((v) => v.id === selected) ?? null
const shown = current ?? variants.find((v) => !v.disabled) ?? variants[0]
const activePrice = shown?.price ?? price
const activeRegular = shown?.regularPrice ?? regularPrice
const saving = savingOf(activePrice, activeRegular)
const hasStage = variants.some((v) => v.image) && !!shown
const picked = !!current
const ready = picked && (!requireCommit || committed)
function choose(id: string) {
if (disabled) return
setSelected(id)
if (error === 'choose') setError(null)
}
function commit(value: boolean) {
setCommitted(value)
if (value && error === 'commit') setError(null)
}
function submit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled) return
if (!current) {
setError('choose')
chipsRef.current?.querySelector<HTMLInputElement>('input:not(:disabled)')?.focus()
return
}
if (requireCommit && !committed) {
setError('commit')
commitRef.current?.focus()
return
}
setError(null)
onSubmit?.(current)
}
const btnClass = ['vp6-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active']
.filter(Boolean)
.join(' ')
return (
<form
className={['cf-variant-picker-6', className].filter(Boolean).join(' ')}
onSubmit={submit}
noValidate
aria-label={fill(t.formLabel, { name })}
data-disabled={disabled || undefined}
data-stage={hasStage ? '' : undefined}
>
<style>{CSS}</style>
<div className='vp6-grid'>
<header className='vp6-top'>
<h2 className='vp6-title'>{name}</h2>
{lead ? <p className='vp6-lead'>{lead}</p> : null}
</header>
{hasStage && shown ? (
<figure className='vp6-stage'>
<div className='vp6-set'>
<span className='vp6-pool' aria-hidden='true' />
{variants.map((v) => {
if (!v.image) return null
const on = v.id === shown.id
return (
<img
key={v.id}
className='vp6-shot'
src={v.image}
alt={on ? v.imageAlt ?? fill(t.imageAlt, { name, variant: v.label }) : ''}
aria-hidden={on ? undefined : true}
data-on={on || undefined}
width={900}
height={900}
decoding='async'
/>
)
})}
</div>
<figcaption className='vp6-cap' aria-live='polite'>
<strong>{shown.label}</strong>
{shown.detail ? <span>{shown.detail}</span> : null}
</figcaption>
</figure>
) : null}
<ol className='vp6-path'>
<li className='vp6-stop' data-done={picked || undefined} style={{ '--i': 0 } as React.CSSProperties}>
<StopHead n={1} done={picked} lit={picked} />
<div className='vp6-body'>
<fieldset
className='vp6-field'
disabled={disabled}
aria-describedby={error === 'choose' ? chooseErrId : undefined}
>
<legend className='vp6-sub'>{t.pickTitle}</legend>
<div className='vp6-chips' ref={chipsRef} data-invalid={error === 'choose' || undefined}>
{variants.map((v) => {
const on = v.id === selected
return (
<label key={v.id} className='vp6-chip' data-on={on || undefined} data-off={v.disabled || undefined}>
<input
className='vp6-sr'
type='radio'
name={groupName}
value={v.id}
checked={on}
disabled={v.disabled}
aria-invalid={error === 'choose' || undefined}
onChange={() => choose(v.id)}
/>
<span className='vp6-dot' style={{ '--sw': v.swatch } as React.CSSProperties} aria-hidden='true'>
{!v.swatch && v.image ? <img src={v.image} alt='' width={84} height={84} decoding='async' /> : null}
<span className='vp6-tick'>
<Check size={13} strokeWidth={3.5} />
</span>
</span>
<span className='vp6-chip-l'>{v.label}</span>
{v.disabled ? <span className='vp6-chip-off'>{t.unavailable}</span> : null}
</label>
)
})}
</div>
{error === 'choose' ? (
<p id={chooseErrId} className='vp6-err' role='alert'>
<CircleAlert size={18} aria-hidden='true' />
{t.chooseError}
</p>
) : null}
</fieldset>
</div>
</li>
<li className='vp6-stop' data-done={ready || undefined} style={{ '--i': 1 } as React.CSSProperties}>
<StopHead n={2} done={picked} lit={picked} />
<div className='vp6-body'>
<h3 className='vp6-sub'>{saving ? fill(t.priceTitle, { saving }) : t.priceTitlePlain}</h3>
<div className='vp6-pricebox' aria-live='polite'>
<p className='vp6-pricerow'>
<span className='vp6-sr'>{t.todayLabel} </span>
<span className='vp6-price' key={(shown?.id ?? '') + activePrice}>
{activePrice}
</span>
{saving && activeRegular ? (
<s className='vp6-was'>
<span className='vp6-sr'>{t.regularLabel} </span>
{activeRegular}
</s>
) : null}
</p>
{saving ? (
<p className='vp6-save'>
<Scissors className='vp6-save-i' size={18} strokeWidth={2.25} aria-hidden='true' />
{fill(t.saveLine, { saving, regular: activeRegular })}
</p>
) : null}
{note ? <p className='vp6-note'>{note}</p> : null}
</div>
</div>
</li>
<li className='vp6-stop' style={{ '--i': 2 } as React.CSSProperties}>
<StopHead n={3} done={false} lit={ready} />
<div className='vp6-body'>
<h3 className='vp6-sub'>{t.actionTitle}</h3>
{requireCommit ? (
<label className='vp6-commit' data-invalid={error === 'commit' || undefined}>
<input
ref={commitRef}
className='vp6-sr vp6-cb'
type='checkbox'
checked={committed}
disabled={disabled}
aria-invalid={error === 'commit' || undefined}
aria-describedby={error === 'commit' ? commitErrId : undefined}
onChange={(e) => commit(e.currentTarget.checked)}
/>
<span className='vp6-check' aria-hidden='true'>
<Check size={18} strokeWidth={3.5} />
</span>
<span className='vp6-commit-t'>{t.commitLabel}</span>
</label>
) : null}
{error === 'commit' ? (
<p id={commitErrId} className='vp6-err' role='alert'>
<CircleAlert size={18} aria-hidden='true' />
{t.commitError}
</p>
) : null}
<button type='submit' className={btnClass} disabled={disabled}>
<span className='vp6-btn-main'>{t.label}</span>
<span className='vp6-btn-sub'>
{current ? fill(t.sublabel, { price: activePrice, variant: current.label }) : t.sublabelEmpty}
</span>
</button>
</div>
</li>
</ol>
</div>
</form>
)
}
export default VariantPicker6
/** Numbered node and connecting line for one stop on the path (decorative; the step content carries the meaning). */
function StopHead({ n, done, lit }: { n: number; done: boolean; lit: boolean }) {
return (
<div className='vp6-head' aria-hidden='true'>
<span className='vp6-node' data-lit={lit || undefined}>
{done ? <Check size={20} strokeWidth={3} /> : n}
</span>
<span className='vp6-line' />
</div>
)
}
/** Replaces named {placeholders} in a copy template with text. */
function fill(template: string, vars: Record<string, string | undefined>) {
return template.replace(/[{]([a-zA-Z]+)[}]/g, (_m, key: string) => vars[key] ?? '')
}
function toNumber(value: string) {
return parseFloat(value.replace(/[^0-9.]/g, ''))
}
/** The regular price minus the price, with the price's currency prefix; null when there is no real saving. */
function savingOf(price?: string, regular?: string): string | null {
if (!price || !regular) return null
const p = toNumber(price)
const r = toNumber(regular)
if (!Number.isFinite(p) || !Number.isFinite(r) || r <= p) return null
const prefix = price.match(/^[^0-9]*/)?.[0] ?? ''
const diff = r - p
return prefix + (Number.isInteger(diff) ? String(diff) : diff.toFixed(2))
}
// Swatch values are physical product colours (content data, like a photo), not theme colours.
// Each sits behind a component-scoped variable (--vp6-swatch-*) so a builder can restate the finish; the
// designed finish is only the var() fallback.
const DEFAULT_VARIANTS: PickerVariant[] = [
{ id: 'navy', label: 'Navy', detail: 'Deep navy linen, gold foil edge', swatch: 'var(--vp6-swatch-navy, oklch(0.31 0.075 262))' },
{ id: 'white', label: 'White', detail: 'Clean white matte', swatch: 'var(--vp6-swatch-white, oklch(0.97 0.004 255))' },
{ id: 'graphite', label: 'Graphite', detail: 'Graphite soft-touch', swatch: 'var(--vp6-swatch-graphite, oklch(0.34 0.008 260))' },
]
const DEFAULT_COPY: VariantPicker6Copy = {
pickTitle: 'Pick the cover for your desk',
priceTitle: 'Clip {saving} off today',
priceTitlePlain: 'Your price today',
actionTitle: 'Lock in your kit',
todayLabel: 'Your price today:',
regularLabel: 'Regular price:',
saveLine: 'That’s {saving} off the {regular} regular price',
commitLabel: 'I understand I’m covered by the 30-day money-back guarantee.',
label: 'Add To My Order',
sublabel: '{price} · {variant} cover',
sublabelEmpty: 'Pick a cover to continue',
chooseError: 'Choose a cover colour to continue.',
commitError: 'Tick the box to confirm and continue.',
unavailable: 'Unavailable',
imageAlt: '{name} with the {variant} cover',
formLabel: 'Choose your {name}',
}
const R = '.cf-variant-picker-6'
// Theme notes:
// --stage-light is a component-scoped override for the stage highlight (selected chip, lit steps, save line).
// By default it is the theme accent pulled toward the band text (oklab blend), so it stays in the accent's hue
// and keeps contrast on whatever band colour the theme sets (dark or strong light band).
// The error outline/strike colour follows the same rule with --danger.
// The hidden native radio/checkbox read --field-focus for accent-color; the visible tick box reads --field
// (falling back to --card) and its checked glyph is --vp6-check-ink (white by default, on --success).
const CSS = `
${R}{
--vp6-bg: var(--band, oklch(0.272 0.067 256.5));
--vp6-ink: var(--band-ink, oklch(1 0 0));
--vp6-soft: color-mix(in oklch, var(--vp6-ink) 80%, var(--vp6-bg));
--vp6-well: color-mix(in oklch, var(--vp6-ink) 7%, var(--vp6-bg));
--vp6-rule: oklch(from var(--vp6-ink) l c h / 0.22);
--vp6-hair: oklch(from var(--vp6-ink) l c h / 0.12);
--vp6-light: var(--stage-light, color-mix(in oklab, var(--accent, oklch(0.6 0.12 85)) 50%, var(--vp6-ink)));
--vp6-glow: var(--stage-light, color-mix(in oklab, var(--accent-fill, var(--accent, oklch(0.6 0.12 85))) 50%, var(--vp6-ink)));
--vp6-on: color-mix(in oklab, var(--vp6-light) 16%, var(--vp6-bg));
--vp6-err: color-mix(in oklab, var(--danger, oklch(0.5 0.17 27)) 60%, var(--vp6-ink));
--vp6-shade: var(--shadow, oklch(0.22 0.03 256.5));
--vp6-gapy: 26px;
container-type: inline-size;
position: relative;
isolation: isolate;
box-sizing: border-box;
width: 100%;
max-width: 1080px;
margin-inline: auto;
padding: clamp(22px, 4.4vw, 48px) clamp(18px, 4.4vw, 48px);
border-radius: calc(var(--card-radius, var(--radius, 12px)) + 10px);
background: var(--vp6-bg);
color: var(--vp6-ink);
font-family: var(--font-body, system-ui, sans-serif);
font-size: 17px;
line-height: 1.5;
overflow: clip;
box-shadow: inset 0 0 0 1px oklch(from var(--vp6-ink) l c h / 0.08), var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 256.5 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 256.5 / 0.32)));
}
${R} *, ${R} *::before, ${R} *::after{ box-sizing: border-box; }
${R} .vp6-sr{ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; accent-color: var(--field-focus, var(--accent, oklch(0.6 0.12 85))); }
${R} .vp6-grid{ display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'top' 'stage' 'path'; row-gap: clamp(22px, 4cqi, 30px); }
${R}:not([data-stage]) .vp6-grid{ grid-template-areas: 'top' 'path'; max-width: 640px; margin-inline: auto; }
${R} .vp6-top{ grid-area: top; min-width: 0; }
${R} .vp6-title{ margin: 0; font-family: var(--font-display, inherit); font-weight: var(--display-weight, 900); text-transform: var(--display-case, none); letter-spacing: var(--display-tracking, -0.03em); font-size: clamp(2rem, 4.8cqi, 3.25rem); line-height: 1.04; color: var(--vp6-ink); text-wrap: balance; }
${R} .vp6-lead{ max-width: 52ch; margin: clamp(12px, 1.5cqi, 16px) 0 0; font-size: clamp(17px, 1.8cqi, 19px); font-weight: 500; line-height: 1.5; color: var(--vp6-soft); text-wrap: pretty; }
${R} .vp6-stage{ grid-area: stage; position: relative; min-width: 0; margin: 0; padding: clamp(16px, 2.6cqi, 26px); border-radius: calc(var(--card-radius, var(--radius, 12px)) + 4px); background: radial-gradient(70% 58% at 50% 36%, oklch(from var(--vp6-glow) l c h / 0.13), oklch(from var(--vp6-glow) l c h / 0) 72%), var(--vp6-well); box-shadow: inset 0 0 0 1px var(--vp6-hair), inset 0 1px 0 oklch(from var(--vp6-ink) l c h / 0.08); }
${R} .vp6-set{ position: relative; width: 100%; aspect-ratio: 5 / 4; }
${R} .vp6-pool{ position: absolute; left: 16%; right: 16%; bottom: 1%; height: 11%; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, oklch(from var(--vp6-shade) calc(l - 0.1) c h / 0.65), oklch(from var(--vp6-shade) l c h / 0)); }
${R} .vp6-shot{ position: absolute; left: 0; top: 0; width: 100%; height: 96%; object-fit: contain; object-position: 50% 100%; opacity: 0; transform: translateY(12px) scale(0.97); transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); filter: drop-shadow(0 2px 2px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.55)) drop-shadow(0 12px 12px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.45)); }
${R} .vp6-shot[data-on]{ opacity: 1; transform: none; }
${R} .vp6-cap{ display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 0; text-align: center; font-size: 16px; line-height: 1.35; color: var(--vp6-soft); text-wrap: pretty; }
${R} .vp6-cap strong{ font-family: var(--font-display, inherit); font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--vp6-light); }
@container (min-width: 760px){
${R}[data-stage] .vp6-grid{ grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: 'stage top' 'stage path'; column-gap: clamp(28px, 5cqi, 60px); row-gap: 30px; }
${R} .vp6-stage{ position: sticky; top: 24px; align-self: start; }
${R} .vp6-set{ aspect-ratio: 1 / 1; }
}
${R} .vp6-path{ grid-area: path; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: var(--vp6-gapy); min-width: 0; margin: 0; padding: 0; }
${R} .vp6-stop{ position: relative; min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; animation: vp6-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes vp6-rise{ from{ opacity: 0.82; transform: translateY(8px); } to{ opacity: 1; transform: none; } }
${R} .vp6-head{ display: flex; flex-direction: column; align-items: center; }
${R} .vp6-node{ flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; font-family: var(--font-display, inherit); font-size: 18px; font-weight: 800; line-height: 1; color: var(--vp6-ink); background: var(--vp6-well); box-shadow: inset 0 0 0 1.5px var(--vp6-rule); transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; }
${R} .vp6-node[data-lit]{ color: var(--vp6-bg); background: linear-gradient(oklch(from var(--vp6-glow) calc(l + 0.06) c h), oklch(from var(--vp6-glow) calc(l - 0.08) c h)); box-shadow: inset 0 1px 0 oklch(from var(--vp6-glow) calc(l + 0.14) c h / 0.8), inset 0 -2px 0 oklch(from var(--vp6-glow) calc(l - 0.2) c h / 0.7), 0 1px 2px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.6); }
${R} .vp6-line{ position: relative; flex: 1 1 auto; width: 2px; min-height: 16px; margin: 8px 0 calc(8px - var(--vp6-gapy)); border-radius: 2px; background: var(--vp6-rule); overflow: hidden; }
${R} .vp6-line::after{ content: ''; position: absolute; inset: 0; background: var(--vp6-glow); transform: scaleY(0); transform-origin: 50% 0; transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
${R} .vp6-stop[data-done] .vp6-line::after{ transform: none; }
${R} .vp6-stop:last-child .vp6-line{ display: none; }
${R} .vp6-body{ min-width: 0; padding-top: 9px; }
${R} .vp6-field{ min-width: 0; margin: 0; padding: 0; border: 0; }
${R} .vp6-sub{ display: block; width: 100%; margin: 0 0 14px; padding: 0; font-family: var(--font-display, inherit); font-weight: var(--display-weight, 800); text-transform: var(--display-case, none); font-size: clamp(1.25rem, 2.1cqi, 1.5rem); line-height: 1.15; letter-spacing: -0.01em; color: var(--vp6-ink); text-wrap: balance; }
${R} legend.vp6-sub{ float: left; }
${R} .vp6-chips{ clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(82px, 1fr)); gap: 10px; }
${R} .vp6-chip{ position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; min-height: 100px; padding: 14px 8px 12px; border-radius: calc(var(--radius, 12px) + 2px); background: var(--vp6-well); box-shadow: inset 0 0 0 1.5px var(--vp6-rule); color: var(--vp6-ink); text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease; }
${R} .vp6-chip:hover{ transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px oklch(from var(--vp6-ink) l c h / 0.45), 0 2px 3px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.5), 0 8px 14px -6px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.6); }
${R} .vp6-chip:active{ transform: translateY(0) scale(0.97); }
${R} .vp6-chip[data-on]{ background: var(--vp6-on); box-shadow: inset 0 0 0 2px var(--vp6-light), 0 2px 3px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.5), 0 8px 14px -6px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.6); }
${R} .vp6-chip:has(input:focus-visible){ outline: 3px solid var(--vp6-light); outline-offset: 3px; }
${R} .vp6-chips[data-invalid] .vp6-chip:not([data-off]){ box-shadow: inset 0 0 0 2px var(--vp6-err); }
${R} .vp6-chip[data-off], ${R} .vp6-field:disabled .vp6-chip{ cursor: not-allowed; opacity: 0.55; transform: none; }
${R} .vp6-dot{ position: relative; display: block; flex: none; width: 42px; height: 42px; border-radius: 999px; background: var(--sw, var(--vp6-well)); box-shadow: inset 0 0 0 1px oklch(from var(--vp6-ink) l c h / 0.4), inset 0 -7px 10px oklch(from var(--vp6-shade) l c h / 0.28), inset 0 5px 8px oklch(from var(--vp6-ink) l c h / 0.16), 0 2px 3px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.5); }
${R} .vp6-dot img{ display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
${R} .vp6-tick{ position: absolute; top: -5px; right: -8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: var(--vp6-glow); color: var(--vp6-bg); box-shadow: 0 0 0 2px var(--vp6-on); transform: scale(0); transition: transform 0.22s cubic-bezier(0.3, 1.6, 0.5, 1); }
${R} .vp6-chip[data-on] .vp6-tick{ transform: scale(1); }
${R} .vp6-chip-l{ font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; text-wrap: balance; }
${R} .vp6-chip-off{ font-size: 14px; font-weight: 600; line-height: 1.2; color: var(--vp6-soft); }
${R} .vp6-err{ display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius, 10px); background: var(--danger-soft, oklch(0.93 0.024 27)); color: var(--danger, oklch(0.5 0.17 27)); font-size: 15px; font-weight: 700; line-height: 1.35; text-wrap: pretty; }
${R} .vp6-err svg{ flex: none; margin-top: 1px; }
${R} .vp6-pricebox{ position: relative; padding: 16px 18px; border-radius: var(--radius, 12px); background: var(--vp6-well); box-shadow: inset 0 0 0 1px var(--vp6-hair); }
${R} .vp6-pricerow{ display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; }
${R} .vp6-price{ font-family: var(--font-display, inherit); font-size: clamp(2.75rem, 5cqi, 3.75rem); font-weight: var(--display-weight, 900); line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--vp6-ink); animation: vp6-pop 0.35s ease both; }
@keyframes vp6-pop{ from{ opacity: 0.7; transform: translateY(5px); } to{ opacity: 1; transform: none; } }
${R} .vp6-was{ font-family: var(--font-display, inherit); font-size: clamp(1.25rem, 2.2cqi, 1.5rem); font-weight: 700; line-height: 1; color: var(--vp6-soft); text-decoration: line-through; text-decoration-color: var(--vp6-err); text-decoration-thickness: 2px; }
${R} .vp6-save{ margin: 14px 0 0; font-size: 17px; font-weight: 800; line-height: 1.35; color: var(--vp6-light); text-wrap: pretty; }
${R} .vp6-save-i{ display: inline-block; vertical-align: -0.2em; margin-inline-end: 0.45em; }
${R} .vp6-note{ margin: 4px 0 0; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--vp6-soft); text-wrap: pretty; }
${R} .vp6-commit{ position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: var(--radius, 12px); background: var(--vp6-well); box-shadow: inset 0 0 0 1px var(--vp6-hair); color: var(--vp6-ink); font-size: 16px; font-weight: 600; line-height: 1.4; cursor: pointer; transition: box-shadow 0.18s ease; }
${R} .vp6-commit:hover{ box-shadow: inset 0 0 0 1.5px oklch(from var(--vp6-ink) l c h / 0.4); }
${R} .vp6-commit[data-invalid]{ box-shadow: inset 0 0 0 2px var(--vp6-err); }
${R} .vp6-commit:has(.vp6-cb:disabled){ cursor: not-allowed; opacity: 0.6; }
${R} .vp6-check{ flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-top: -1px; border-radius: 7px; background: var(--field, var(--card, oklch(1 0 0))); color: transparent; box-shadow: inset 0 0 0 2px var(--field-border, oklch(from var(--field-ink, oklch(0.21 0.034 263)) l c h / 0.45)); transition: background-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease; }
${R} .vp6-cb:checked + .vp6-check{ background: var(--success, oklch(0.5 0.138 150)); color: var(--vp6-check-ink, oklch(1 0 0)); box-shadow: inset 0 0 0 2px var(--success, oklch(0.5 0.138 150)); }
${R} .vp6-cb:focus-visible + .vp6-check{ outline: 3px solid var(--vp6-light); outline-offset: 3px; }
${R} .vp6-commit-t{ text-wrap: pretty; }
${R} .vp6-btn{ appearance: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 72px; margin: 16px 0 0; padding: 12px 20px; border: 0; border-radius: var(--button-radius, var(--radius, 12px)); background: linear-gradient(oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l + 0.04) c h), var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5)))); color: var(--button-ink, var(--cta-ink, oklch(1 0 0))); text-shadow: var(--button-text-shadow, none); font-family: var(--button-font, var(--font-display, inherit)); text-transform: var(--button-case, none); text-align: center; cursor: pointer; box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l - 0.16) c h), 0 2px 3px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.6), 0 10px 18px -8px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.75)); transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
${R} .vp6-btn:hover:not(:disabled), ${R} .vp6-btn.is-hover:not(:disabled){ transform: translateY(-2px); background: linear-gradient(oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l - 0.02) c h), oklch(from var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5))) calc(l - 0.05) c h)); }
${R} .vp6-btn:active:not(:disabled), ${R} .vp6-btn.is-active:not(:disabled){ transform: translateY(1px); background: linear-gradient(oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l - 0.08) c h), oklch(from var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5))) calc(l - 0.1) c h)); box-shadow: inset 0 2px 3px oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l - 0.22) c h / 0.6), inset 0 -1px 0 oklch(from var(--button-bg, var(--cta, oklch(0.576 0.209 29.5))) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--vp6-shade) calc(l - 0.08) c h / 0.6); }
${R} .vp6-btn:focus-visible{ outline: 3px solid var(--vp6-light); outline-offset: 3px; }
${R} .vp6-btn:disabled{ cursor: not-allowed; transform: none; background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))); color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263))); text-shadow: none; box-shadow: none; }
${R} .vp6-btn-main{ font-size: clamp(1.3rem, 2.5cqi, 1.6rem); font-weight: var(--button-weight, 800); line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
${R} .vp6-btn-sub{ font-family: var(--font-body, inherit); font-size: 15px; font-weight: 600; line-height: 1.25; text-transform: none; text-wrap: pretty; }
@media (prefers-reduced-motion: reduce){
${R} .vp6-stop, ${R} .vp6-price{ animation: none; }
${R} .vp6-shot, ${R} .vp6-chip, ${R} .vp6-tick, ${R} .vp6-node, ${R} .vp6-line::after, ${R} .vp6-btn, ${R} .vp6-check, ${R} .vp6-commit{ transition: none; }
${R} .vp6-shot{ transform: none; }
${R} .vp6-chip:hover, ${R} .vp6-chip:active{ transform: none; }
${R} .vp6-btn:hover:not(:disabled), ${R} .vp6-btn.is-hover:not(:disabled), ${R} .vp6-btn:active:not(:disabled), ${R} .vp6-btn.is-active:not(:disabled){ transform: none; }
}
`
pieces/offer/variant-picker-6/specimen.tsx 58 lines
// Specimen: the Funnel Starter Kit as a printed set in three cover finishes, stage on the left, path to the button on the right.
import * as React from 'react'
import { VariantPicker6, type PickerVariant, type VariantPicker6State } from '../variant-picker-6'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import navyKitImage from '../assets/ec777edb03c8bb2f.webp'
import whiteKitImage from '../assets/72c2f12fb88ff60b.webp'
import graphiteKitImage from '../assets/840ecbe4ff019256.webp'
const sample = defaults.sample
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function VariantPicker6Specimen({ state = 'default' }: { state?: VariantPicker6State }) {
// Swatch values are the physical cover colours (product data), not theme colours. Each reads the component's
// --vp6-swatch-* variable, with the designed finish only as the var() fallback.
// Every variant shot fills the product slot: a brand product image replaces the stage art; Original keeps the designed covers.
const variants: PickerVariant[] = [
{
id: 'navy',
label: 'Navy',
detail: 'Deep navy linen, gold foil edge',
swatch: 'var(--vp6-swatch-navy, oklch(0.31 0.075 262))',
image: slot('product', navyKitImage),
imageAlt: sample.name + ' in navy: planning guide, workbook and checklist clipboard',
},
{
id: 'white',
label: 'White',
detail: 'Clean white matte, gold foil edge',
swatch: 'var(--vp6-swatch-white, oklch(0.97 0.004 255))',
image: slot('product', whiteKitImage),
imageAlt: sample.name + ' in white: planning guide, workbook and checklist clipboard',
},
{
id: 'graphite',
label: 'Graphite',
detail: 'Graphite soft-touch, gold foil edge',
swatch: 'var(--vp6-swatch-graphite, oklch(0.34 0.008 260))',
image: slot('product', graphiteKitImage),
imageAlt: sample.name + ' in graphite: planning guide, workbook and checklist clipboard',
},
]
return (
<VariantPicker6
name={sample.name}
lead='Your guide, workbook and launch checklist, printed and bound. Pick the cover you’ll keep on your desk.'
variants={variants}
price={sample.price}
regularPrice={sample.regularPrice}
note={sample.note}
copy={{ commitLabel: 'I understand I’m covered by the ' + sample.guarantee + '.' }}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
name OptionalVariantPicker6 |
string |
|
lead OptionalVariantPicker6 |
string |
|
variants OptionalVariantPicker6 |
PickerVariant[] |
|
defaultVariant OptionalVariantPicker6 |
string | null |
|
price OptionalVariantPicker6 |
string |
|
regularPrice OptionalVariantPicker6 |
string |
|
note OptionalVariantPicker6 |
string |
|
requireCommit OptionalVariantPicker6 |
boolean |
|
defaultCommitted OptionalVariantPicker6 |
boolean |
|
copy OptionalVariantPicker6 |
Partial<VariantPicker6Copy> |
|
disabled OptionalVariantPicker6 |
boolean |
|
state OptionalVariantPicker6 |
VariantPicker6State |
|
onSubmit OptionalVariantPicker6 |
(variant: PickerVariant) => void |
|
className OptionalVariantPicker6 |
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-ink- Secondary button.
--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-ink- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
72c2f12fb88ff60b.webp
image/webp · 100 KB
-
840ecbe4ff019256.webp
image/webp · 114 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
ec777edb03c8bb2f.webp
image/webp · 216 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB