Product Selector 3
The maker's pick: the founder stands behind the counter and recommends one of two kits. Picking a card swaps their line, and the button names the kit and its price.
Use it in a prompt
Use offer/product-selector-3 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/product-selector-3.tsx. - Import it and pass your copy and images (Props tab):
import { ProductSelector3 } from "@/components/funneldna/offer/product-selector-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-selector-3/component.tsx 690 lines
// layout: presenter-cutout
// The maker's pick: the founder stands behind the counter and recommends one of two kits. Picking a card swaps their line, and the button names the kit and its price.
import * as React from 'react'
import { AlertCircle, Check, Quote, Star } from 'lucide-react'
export type ProductSelector3Option = {
id: string
name: string
/** One-line benefit under the name. */
benefit?: string
/** Supplied price, shown exactly as written (e.g. $47). */
price: string
/** Up to three short lines of what is in the box. */
includes?: string[]
/** The presenter's one line about this option, shown in the speech block when it is chosen. */
quote?: string
/** Product image, best on a transparent background (object-fit: contain). */
image: string
imageAlt?: string
}
export type ProductSelector3State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ProductSelector3Props = {
/** The two choices, in display order. Extra options are ignored. */
options: ProductSelector3Option[]
/** Option the presenter recommends; it carries the pick flag. Defaults to the first option. */
recommendedId?: string
/** Preselected option id. Defaults to the recommended option; pass null for none. */
defaultSelectedId?: string | null
headline?: string
/** A phrase inside the headline set in the accent colour. */
headlineEmphasis?: string
/** Cut-out photo of the founder (transparent background). Empty shows the no-presenter variant. */
presenterImage?: string
presenterAlt?: string
presenterName?: string
presenterRole?: string
/** Flag on the recommended card. Empty hides it. */
pickLabel?: string
/** Line under the headline when there is no presenter; {name} is the recommended option. */
recommendationLine?: string
/** Speech line while nothing is chosen. */
emptyQuote?: string
/** Screen-reader label for the option group. */
legend?: string
selectLabel?: string
selectedLabel?: string
/** Button first line; {name} and {price} are replaced with the chosen option. */
buttonLabel?: string
/** Button second line; {name} and {price} are replaced. Empty hides it. */
buttonSubLabel?: string
emptyButtonLabel?: string
emptyButtonSubLabel?: string
/** Lead-in of the P.S. line, set in bold. */
psLabel?: string
/** P.S. under the button: the guarantee or main benefit, supplied facts only. Empty hides it. */
ps?: string
errorMessage?: string
disabledNote?: string
disabled?: boolean
inputName?: string
/** Studio/demo state driver. */
state?: ProductSelector3State
onSelect?: (option: ProductSelector3Option) => void
/** Receives the chosen option on submit. Never sends data by itself. */
onSubmit?: (option: ProductSelector3Option) => void
className?: string
}
export function ProductSelector3({
options,
recommendedId,
defaultSelectedId,
headline = 'Which one should you start with?',
headlineEmphasis,
presenterImage = '',
presenterAlt = '',
presenterName = '',
presenterRole = '',
pickLabel = 'My pick for beginners',
recommendationLine = 'New to this? Start with the {name}.',
emptyQuote = 'Tap one below and I’ll tell you who it’s for.',
legend = 'Choose one',
selectLabel = 'Choose this one',
selectedLabel = 'Your choice',
buttonLabel = 'Start with the {name}',
buttonSubLabel = '{price} · One-time payment',
emptyButtonLabel = 'Choose one to start',
emptyButtonSubLabel = 'Tap a card above',
psLabel = 'P.S.',
ps = '',
errorMessage = 'Choose one of the two options above, then tap the button.',
disabledNote = 'Ordering is unavailable right now.',
disabled = false,
inputName,
state = 'default',
onSelect,
onSubmit,
className = '',
}: ProductSelector3Props) {
const list = (options ?? []).slice(0, 2)
const uid = React.useId().replace(/[^a-zA-Z0-9]/g, '')
const group = inputName ?? `ps3-${uid}`
const titleId = `ps3-title-${uid}`
const errId = `ps3-err-${uid}`
const psId = `ps3-ps-${uid}`
const noteId = `ps3-note-${uid}`
const pickId =
recommendedId && list.some((o) => o.id === recommendedId) ? recommendedId : list[0]?.id ?? null
const firstId = defaultSelectedId === undefined ? pickId : defaultSelectedId
const [selectedId, setSelectedId] = React.useState<string | null>(state === 'error' ? null : firstId)
const [error, setError] = React.useState(state === 'error')
React.useEffect(() => {
setSelectedId(state === 'error' ? null : firstId)
setError(state === 'error')
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
if (list.length === 0) return null
const isDisabled = disabled || state === 'disabled'
const selected = list.find((o) => o.id === selectedId) ?? null
const pick = list.find((o) => o.id === pickId) ?? null
const hasPresenter = Boolean(presenterImage)
const force = state === 'hover' || state === 'active' ? state : undefined
const demoHoverId = state === 'hover' ? list.find((o) => o.id !== selectedId)?.id : undefined
const label = selected ? fill(buttonLabel, selected) : emptyButtonLabel
const sub = selected ? (buttonSubLabel ? fill(buttonSubLabel, selected) : '') : emptyButtonSubLabel
const activeKey = selected?.quote ? selected.id : EMPTY
const describedBy =
[error ? errId : '', isDisabled ? noteId : '', ps ? psId : ''].filter(Boolean).join(' ') || undefined
const choose = (option: ProductSelector3Option) => {
if (isDisabled) return
setSelectedId(option.id)
if (error) setError(false)
onSelect?.(option)
}
const submit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled) return
if (!selected) {
setError(true)
return
}
onSubmit?.(selected)
}
return (
<section
className={`cf-product-selector-3 ${className}`.trim()}
aria-labelledby={titleId}
data-force={force}
data-error={error ? 'true' : 'false'}
data-disabled={isDisabled ? 'true' : 'false'}
data-presenter={hasPresenter ? 'true' : 'false'}
data-has-pick={pickLabel ? 'true' : 'false'}
data-count={list.length}
>
<style>{CSS}</style>
<form className='ps3-form' onSubmit={submit} noValidate>
<div className='ps3-upper'>
<div className='ps3-wrap ps3-stage'>
<h2 id={titleId} className='ps3-title'>
<Headline text={headline} emphasis={headlineEmphasis} />
</h2>
{hasPresenter ? (
<>
<figure className='ps3-presenter'>
<img src={presenterImage} alt={presenterAlt} width={512} height={512} decoding='async' draggable={false} />
</figure>
<div className='ps3-bubble'>
<Quote className='ps3-mark' size={24} strokeWidth={2.5} aria-hidden />
<div className='ps3-quotes' aria-live='polite'>
{list.map((o) =>
o.quote ? (
<p key={o.id} className='ps3-quote' data-on={activeKey === o.id ? 'true' : 'false'}>
{o.quote}
</p>
) : null,
)}
<p className='ps3-quote' data-on={activeKey === EMPTY ? 'true' : 'false'}>
{emptyQuote}
</p>
</div>
{presenterName ? (
<p className='ps3-by'>
<strong>{presenterName}</strong>
{presenterRole ? <span>{presenterRole}</span> : null}
</p>
) : null}
</div>
</>
) : pick && recommendationLine ? (
<p className='ps3-line'>{fill(recommendationLine, pick)}</p>
) : null}
</div>
</div>
<div className='ps3-floor'>
<div className='ps3-wrap'>
<fieldset className='ps3-fieldset' disabled={isDisabled} aria-describedby={error ? errId : undefined}>
<legend className='ps3-sr'>{legend}</legend>
<div className='ps3-cards'>
{list.map((o, i) => {
const on = o.id === selectedId
const isPick = o.id === pickId && Boolean(pickLabel)
const n = `${uid}-${i}`
const flagId = `ps3-flag-${n}`
const nameId = `ps3-name-${n}`
const priceId = `ps3-price-${n}`
const benId = `ps3-ben-${n}`
return (
<label
key={o.id}
className='ps3-card'
data-selected={on ? 'true' : 'false'}
data-pick={isPick ? 'true' : 'false'}
data-demo-hover={o.id === demoHoverId ? 'true' : undefined}
style={{ '--ps3-i': i } as React.CSSProperties}
>
<input
className='ps3-sr ps3-input'
type='radio'
name={group}
value={o.id}
checked={on}
onChange={() => choose(o)}
aria-labelledby={[isPick ? flagId : '', nameId, priceId].filter(Boolean).join(' ')}
aria-describedby={o.benefit ? benId : undefined}
/>
{isPick ? (
<span id={flagId} className='ps3-flag'>
{hasPresenter ? (
<img className='ps3-flag__face' src={presenterImage} alt='' width={24} height={24} draggable={false} />
) : (
<Star className='ps3-flag__star' size={16} strokeWidth={2.5} aria-hidden />
)}
<span className='ps3-flag__text'>{pickLabel}</span>
</span>
) : null}
<span className='ps3-media'>
<img src={o.image} alt={o.imageAlt ?? ''} width={360} height={360} loading='lazy' decoding='async' draggable={false} />
</span>
<span className='ps3-body'>
<span className='ps3-row'>
<span id={nameId} className='ps3-name'>{o.name}</span>
<span id={priceId} className='ps3-price'>{o.price}</span>
</span>
{o.benefit ? (
<span id={benId} className='ps3-benefit'>{o.benefit}</span>
) : null}
{o.includes && o.includes.length > 0 ? (
<span className='ps3-incl'>
{o.includes.slice(0, 3).map((line) => (
<span key={line} className='ps3-incl__item'>
<Check size={16} strokeWidth={2.5} aria-hidden />
{line}
</span>
))}
</span>
) : null}
<span className='ps3-choose' aria-hidden>
<span className='ps3-radio'>
<Check size={16} strokeWidth={3} />
</span>
{on ? selectedLabel : selectLabel}
</span>
</span>
</label>
)
})}
</div>
</fieldset>
{error ? (
<p id={errId} className='ps3-error' role='alert'>
<AlertCircle size={18} strokeWidth={2.5} aria-hidden />
{errorMessage}
</p>
) : null}
<div className='ps3-action'>
<button type='submit' className='ps3-btn' disabled={isDisabled} aria-describedby={describedBy}>
<span className='ps3-btn__label'>{label}</span>
{sub ? <span className='ps3-btn__sub'>{sub}</span> : null}
</button>
{isDisabled ? (
<p id={noteId} className='ps3-note'>{disabledNote}</p>
) : null}
{ps ? (
<p id={psId} className='ps3-ps'>
<strong>{psLabel}</strong> {ps}
</p>
) : null}
</div>
</div>
</div>
</form>
</section>
)
}
export default ProductSelector3
const EMPTY = '__ps3-empty'
const fill = (template: string, o: ProductSelector3Option) =>
template.split('{name}').join(o.name).split('{price}').join(o.price)
function Headline({ text, emphasis }: { text: string; emphasis?: string }) {
if (!emphasis || !text.includes(emphasis)) return <>{text}</>
const at = text.indexOf(emphasis)
return (
<>
{text.slice(0, at)}
<em className='ps3-em'>{emphasis}</em>
{text.slice(at + emphasis.length)}
</>
)
}
const CSS = `
.cf-product-selector-3 {
--ps3-sh: var(--shadow, oklch(0.22 0.03 260));
--ps3-btn: var(--button-bg, var(--cta));
--ps3-btn-2: var(--button-bg-2, var(--cta-2));
--ps3-border: var(--card-border, oklch(from var(--ink) l c h / .12));
--ps3-shadow-sm: var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / .18), 0 1px 3px oklch(0.22 0.03 260 / .14));
--ps3-shadow-md: var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / .22), 0 4px 10px -2px oklch(0.22 0.03 260 / .2));
--ps3-shadow-lg: var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / .22), 0 12px 24px -8px oklch(0.22 0.03 260 / .32));
--ps3-ease: cubic-bezier(.2, .7, .2, 1);
--ps3-gut: clamp(16px, 5vw, 48px);
--ps3-pad: clamp(20px, 3vw, 32px);
position: relative;
background: var(--surface);
color: var(--ink);
font-family: var(--font-body);
overflow-x: clip;
}
.cf-product-selector-3 *, .cf-product-selector-3 *::before, .cf-product-selector-3 *::after { box-sizing: border-box; }
.cf-product-selector-3 :where(h2, p, figure, fieldset) { margin: 0; }
.cf-product-selector-3 .ps3-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cf-product-selector-3 .ps3-wrap { width: min(1120px, 100% - 2 * var(--ps3-gut)); margin-inline: auto; }
/* ---- the stage: founder behind the counter, speech beside them ---- */
.cf-product-selector-3 .ps3-upper { padding-top: clamp(56px, 8vw, 112px); }
.cf-product-selector-3 .ps3-stage {
display: grid;
grid-template-columns: minmax(240px, 5fr) 7fr;
grid-template-rows: auto 1fr;
grid-template-areas: 'pres head' 'pres talk';
column-gap: clamp(32px, 5vw, 72px);
}
.cf-product-selector-3 .ps3-title {
grid-area: head;
align-self: start;
padding-top: clamp(0px, 1.2vw, 16px);
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;
color: var(--ink);
text-wrap: balance;
}
.cf-product-selector-3 .ps3-em { font-style: normal; color: var(--accent); }
.cf-product-selector-3 .ps3-presenter { grid-area: pres; align-self: end; display: flex; justify-content: center; align-items: flex-end; min-width: 0; }
.cf-product-selector-3 .ps3-presenter img {
display: block;
width: auto;
max-width: 100%;
height: clamp(380px, 38vw, 480px);
object-fit: contain;
object-position: center bottom;
user-select: none;
filter: drop-shadow(0 2px 3px oklch(from var(--ps3-sh) l c h / .2)) drop-shadow(0 14px 18px oklch(from var(--ps3-sh) l c h / .14));
}
.cf-product-selector-3 .ps3-bubble {
grid-area: talk;
align-self: start;
position: relative;
max-width: 40rem;
margin: clamp(20px, 2.4vw, 32px) 0 72px;
padding: var(--ps3-pad);
background: var(--card);
color: var(--ink);
border: 1px solid var(--ps3-border);
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--ps3-shadow-md));
animation: ps3-rise .45s var(--ps3-ease) backwards;
}
.cf-product-selector-3 .ps3-bubble::before {
content: '';
position: absolute;
left: -12px;
top: 36px;
width: 22px;
height: 22px;
background: var(--card);
border-left: 1px solid var(--ps3-border);
border-bottom: 1px solid var(--ps3-border);
border-bottom-left-radius: 3px;
transform: rotate(45deg);
}
.cf-product-selector-3 .ps3-mark { display: block; color: var(--accent); margin-bottom: 12px; }
.cf-product-selector-3 .ps3-quotes { display: grid; }
.cf-product-selector-3 .ps3-quote {
grid-area: 1 / 1;
font-family: var(--font-display);
font-weight: 700;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.3;
letter-spacing: -0.01em;
color: var(--ink);
text-wrap: pretty;
visibility: hidden;
opacity: 0;
transform: translateY(8px);
transition: opacity .2s var(--ps3-ease), transform .2s var(--ps3-ease), visibility 0s linear .2s;
}
.cf-product-selector-3 .ps3-quote[data-on='true'] {
visibility: visible;
opacity: 1;
transform: none;
transition: opacity .45s var(--ps3-ease) .07s, transform .45s var(--ps3-ease) .07s, visibility 0s;
}
.cf-product-selector-3 .ps3-by { margin-top: 16px; font-size: .9375rem; line-height: 1.4; color: var(--muted); }
.cf-product-selector-3 .ps3-by strong { color: var(--ink); font-weight: 800; margin-inline-end: .5em; }
/* ---- no presenter: headline and the recommendation line only ---- */
.cf-product-selector-3[data-presenter='false'] .ps3-stage {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto;
grid-template-areas: 'head' 'talk';
justify-items: center;
text-align: center;
max-width: 46rem;
padding-bottom: 72px;
}
.cf-product-selector-3[data-presenter='false'] .ps3-title { padding-top: 0; }
.cf-product-selector-3 .ps3-line { grid-area: talk; margin-top: 16px; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--ink); text-wrap: pretty; }
/* ---- the counter: kits laid out in front of the founder ---- */
.cf-product-selector-3 .ps3-floor {
position: relative;
background: color-mix(in oklch, var(--ink) 5%, var(--surface));
padding-bottom: clamp(64px, 8.5vw, 120px);
}
.cf-product-selector-3 .ps3-fieldset { border: 0; padding: 0; min-width: 0; }
.cf-product-selector-3 .ps3-cards { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: -32px; align-items: stretch; }
.cf-product-selector-3[data-count='1'] .ps3-cards { grid-template-columns: minmax(0, 620px); justify-content: center; }
.cf-product-selector-3 .ps3-card {
position: relative;
display: grid;
grid-template-columns: clamp(112px, 30%, 180px) minmax(0, 1fr);
column-gap: clamp(16px, 2.4vw, 28px);
align-items: start;
padding: var(--ps3-pad);
background: var(--card);
color: var(--ink);
border: 1px solid var(--ps3-border);
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--ps3-shadow-md));
cursor: pointer;
transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
animation: ps3-rise .45s var(--ps3-ease) backwards;
animation-delay: min(calc(var(--ps3-i, 0) * .07s + .07s), .28s);
}
/* every card shares the flag's extra top room, so names and prices line up across the pair */
.cf-product-selector-3[data-has-pick='true'] .ps3-card { padding-top: calc(var(--ps3-pad) + 8px); }
.cf-product-selector-3:not([data-disabled='true']) .ps3-card:not([data-selected='true']):hover,
.cf-product-selector-3[data-force='hover'] .ps3-card[data-demo-hover='true'] {
transform: translateY(-2px);
border-color: oklch(from var(--ink) l c h / .26);
box-shadow: var(--ps3-shadow-lg);
}
.cf-product-selector-3 .ps3-card[data-selected='true'] {
transform: translateY(-2px);
background: color-mix(in oklch, var(--accent) 6%, var(--card));
border-color: var(--accent);
box-shadow: inset 0 0 0 1px var(--accent), var(--ps3-shadow-lg);
}
.cf-product-selector-3:not([data-disabled='true']) .ps3-card:active { transform: translateY(0); }
.cf-product-selector-3 .ps3-card:has(.ps3-input:focus-visible) { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55); outline-offset: 3px; }
.cf-product-selector-3[data-error='true'] .ps3-card { border-color: oklch(from var(--danger) l c h / .55); }
.cf-product-selector-3[data-disabled='true'] .ps3-card {
cursor: not-allowed;
transform: none;
background: color-mix(in oklch, var(--ink) 4%, var(--card));
border-color: oklch(from var(--ink) l c h / .1);
box-shadow: var(--ps3-shadow-sm);
}
.cf-product-selector-3[data-disabled='true'] .ps3-card :is(.ps3-name, .ps3-price, .ps3-benefit, .ps3-incl, .ps3-choose) { color: var(--muted); }
.cf-product-selector-3[data-disabled='true'] .ps3-card .ps3-incl__item svg { color: var(--muted); }
.cf-product-selector-3[data-disabled='true'] .ps3-media img { opacity: .55; transform: none; }
.cf-product-selector-3 .ps3-flag {
position: absolute;
top: -16px;
left: var(--ps3-pad);
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 32px;
max-width: calc(100% - 2 * var(--ps3-pad));
padding: 4px 14px 4px 4px;
border-radius: 999px;
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
font-size: .875rem;
font-weight: 800;
line-height: 1.2;
box-shadow: var(--ps3-shadow-sm);
animation: ps3-pop .3s var(--ps3-ease) .3s backwards;
}
.cf-product-selector-3 .ps3-flag__face { flex: none; width: 24px; height: 24px; border-radius: 999px; object-fit: cover; object-position: center top; background: var(--card); }
.cf-product-selector-3 .ps3-flag__star { flex: none; margin-inline-start: 6px; }
.cf-product-selector-3 .ps3-flag__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-product-selector-3 .ps3-media { display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 1; }
.cf-product-selector-3 .ps3-media img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
user-select: none;
filter: drop-shadow(0 2px 3px oklch(from var(--ps3-sh) l c h / .22)) drop-shadow(0 10px 12px oklch(from var(--ps3-sh) l c h / .16));
transition: transform .16s ease;
}
.cf-product-selector-3 .ps3-card[data-selected='true'] .ps3-media img { transform: scale(1.03); }
.cf-product-selector-3 .ps3-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cf-product-selector-3 .ps3-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.cf-product-selector-3 .ps3-name, .cf-product-selector-3 .ps3-price {
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;
color: var(--ink);
}
.cf-product-selector-3 .ps3-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-product-selector-3 .ps3-benefit { font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.cf-product-selector-3 .ps3-incl { display: flex; flex-direction: column; gap: 4px; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--ink); }
.cf-product-selector-3 .ps3-incl__item { text-wrap: pretty; }
.cf-product-selector-3 .ps3-incl__item svg { display: inline-block; vertical-align: -0.2em; margin-inline-end: .4em; color: var(--success); }
.cf-product-selector-3 .ps3-choose { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .9375rem; font-weight: 800; color: var(--ink); }
.cf-product-selector-3 .ps3-radio {
flex: none;
display: grid;
place-items: center;
width: 24px;
height: 24px;
border-radius: 999px;
border: 2px solid oklch(from var(--ink) l c h / .34);
background: var(--card);
color: transparent;
transition: background-color .16s ease, border-color .16s ease;
}
.cf-product-selector-3 .ps3-card[data-selected='true'] .ps3-radio { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: var(--accent-fill-ink, var(--card)); }
.cf-product-selector-3 .ps3-error {
display: block;
width: fit-content;
max-width: 100%;
margin: 24px auto 0;
padding: 10px 16px;
border-radius: 10px;
background: var(--danger-soft);
color: var(--danger);
font-size: .9375rem;
font-weight: 700;
line-height: 1.4;
text-align: center;
text-wrap: pretty;
}
.cf-product-selector-3 .ps3-error svg { display: inline-block; vertical-align: -0.2em; margin-inline-end: .4em; }
/* ---- the action: names the kit, price on the second line ---- */
.cf-product-selector-3 .ps3-action { display: flex; flex-direction: column; align-items: center; margin-top: 40px; text-align: center; }
.cf-product-selector-3 .ps3-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
width: min(100%, 560px);
min-height: 72px;
padding: 12px 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(180deg, oklch(from var(--ps3-btn) calc(l + .04) c h), oklch(from var(--ps3-btn-2) calc(l - .02) c h));
color: var(--button-ink, var(--cta-ink));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
-webkit-tap-highlight-color: transparent;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--ps3-btn) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--ps3-btn) calc(l - .16) c h), 0 1px 2px oklch(from var(--ps3-sh) l c h / .3), 0 8px 16px -6px oklch(from var(--ps3-sh) l c h / .45));
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-product-selector-3 .ps3-btn:not(:disabled):hover,
.cf-product-selector-3[data-force='hover'] .ps3-btn:not(:disabled) {
transform: translateY(-1px);
background: linear-gradient(180deg, oklch(from var(--ps3-btn) calc(l - .01) c h), oklch(from var(--ps3-btn-2) calc(l - .07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--ps3-btn) calc(l + .1) c h / .7), inset 0 -3px 0 oklch(from var(--ps3-btn) calc(l - .2) c h), 0 1px 2px oklch(from var(--ps3-sh) l c h / .32), 0 12px 20px -8px oklch(from var(--ps3-sh) l c h / .5));
}
.cf-product-selector-3 .ps3-btn:not(:disabled):active,
.cf-product-selector-3[data-force='active'] .ps3-btn:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(180deg, oklch(from var(--ps3-btn) calc(l - .06) c h), oklch(from var(--ps3-btn-2) calc(l - .08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--ps3-btn) calc(l - .22) c h / .5), inset 0 -2px 0 oklch(from var(--ps3-btn) calc(l - .16) c h), 0 1px 2px oklch(from var(--ps3-sh) l c h / .3);
}
.cf-product-selector-3 .ps3-btn:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / .6); outline-offset: 3px; }
.cf-product-selector-3 .ps3-btn:disabled {
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--ps3-shadow-sm));
cursor: not-allowed;
transform: none;
}
.cf-product-selector-3 .ps3-btn__label { font-size: clamp(1.125rem, 1.55vw, 1.375rem); line-height: 1.15; text-wrap: balance; }
.cf-product-selector-3 .ps3-btn__sub { font-family: var(--font-body); font-size: .9375rem; font-weight: 600; line-height: 1.3; text-wrap: pretty; }
.cf-product-selector-3 .ps3-note { margin-top: 12px; font-size: .9375rem; font-weight: 600; color: var(--ink); }
.cf-product-selector-3 .ps3-ps { margin-top: 24px; max-width: 40rem; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.cf-product-selector-3 .ps3-ps strong { font-family: var(--font-display); font-weight: 800; margin-inline-end: .2em; }
@keyframes ps3-rise { from { opacity: .82; transform: translateY(8px); } }
@keyframes ps3-pop { from { transform: scale(.9); } }
@media (max-width: 900px) {
.cf-product-selector-3 .ps3-cards { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 620px; margin-inline: auto; }
}
/* ---- phone: founder cropped small above the speech, cards stacked ---- */
@media (max-width: 760px) {
.cf-product-selector-3 .ps3-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: 'head' 'pres' 'talk'; }
.cf-product-selector-3 .ps3-title { text-align: center; padding-top: 0; }
.cf-product-selector-3 .ps3-presenter { align-self: auto; height: 176px; margin-top: 20px; overflow: hidden; align-items: flex-start; }
.cf-product-selector-3 .ps3-presenter img { height: 260px; object-position: center top; }
.cf-product-selector-3 .ps3-bubble { width: 100%; margin: 14px auto 64px; text-align: center; }
.cf-product-selector-3 .ps3-bubble::before {
left: 50%;
top: -12px;
margin-left: -11px;
border-bottom: 0;
border-top: 1px solid var(--ps3-border);
border-bottom-left-radius: 0;
border-top-left-radius: 3px;
}
.cf-product-selector-3 .ps3-mark { margin-inline: auto; }
/* phone card: thumbnail beside name, price and benefit; the contents list runs full width below */
.cf-product-selector-3 .ps3-card {
grid-template-columns: 88px minmax(0, 1fr);
grid-template-areas: 'media row' 'media benefit' 'incl incl' 'choose choose';
column-gap: 16px;
row-gap: 8px;
padding: 20px;
}
.cf-product-selector-3[data-has-pick='true'] .ps3-card[data-pick='true'] { padding-top: 32px; }
.cf-product-selector-3 .ps3-body { display: contents; }
.cf-product-selector-3 .ps3-media { grid-area: media; align-self: start; }
.cf-product-selector-3 .ps3-row { grid-area: row; }
.cf-product-selector-3 .ps3-benefit { grid-area: benefit; }
.cf-product-selector-3 .ps3-incl {
grid-area: incl;
gap: 8px;
margin-top: 8px;
padding-top: 16px;
border-top: 1px solid oklch(from var(--ink) l c h / .1);
font-size: 1rem;
}
.cf-product-selector-3 .ps3-choose { grid-area: choose; margin-top: 8px; }
.cf-product-selector-3 .ps3-flag { left: 20px; max-width: calc(100% - 40px); }
.cf-product-selector-3 .ps3-btn { padding: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-product-selector-3 *, .cf-product-selector-3 *::before, .cf-product-selector-3 *::after { animation: none !important; transition: none !important; }
.cf-product-selector-3 .ps3-card, .cf-product-selector-3 .ps3-btn, .cf-product-selector-3 .ps3-media img, .cf-product-selector-3 .ps3-quote { transform: none !important; }
}
`
pieces/offer/product-selector-3/specimen.tsx 51 lines
import __studioImage8573fbec from "../assets/aa44e2d4420faf55.webp";
import __studioImage0bdcd51e from "../assets/a564ccd14f0a5c76.webp";
import __studioImage8bfc15f2 from "../assets/ff992e83c89ced14.webp";
import * as React from 'react'
import { ProductSelector3, type ProductSelector3State } from '../product-selector-3'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ProductSelector3Specimen({ state = 'default' }: { state?: ProductSelector3State }) {
const sample = defaults.sample
return (
<ProductSelector3
state={state}
headline='Not sure which kit to start with? Here’s my pick.'
headlineEmphasis='Here’s my pick.'
presenterImage={slot('presenter-cutout', __studioImage8573fbec)}
presenterAlt='Maya Ortiz, founder of Ferment Lab'
presenterName='Maya Ortiz'
presenterRole='Founder, Ferment Lab'
pickLabel='My pick for beginners'
recommendedId='starter'
options={[
{
id: 'starter',
name: 'Starter Kit',
benefit: 'Everything you need for your first gallon.',
price: sample.price,
includes: ['1-gallon glass brewing jar', 'Live SCOBY and starter tea', 'Step-by-step brew card'],
quote: 'If this is your first brew, start here. It’s one jar, one SCOBY and a card that walks you through every step.',
image: slot('item-1', __studioImage0bdcd51e),
imageAlt: 'Ferment Lab Starter Kit: a glass brewing jar, SCOBY, tea and brew card',
},
{
id: 'pro',
name: 'Pro Kit',
benefit: 'Brew, bottle and flavour on a loop.',
price: '$89',
includes: ['Two 1-gallon brewing jars', '6 swing-top bottles for fizz', 'Flavour guide and pH strips'],
quote: 'Already brewed a batch? Go Pro. The second jar and the bottles let you flavour and fizz while your next batch ferments.',
image: slot('item-2', __studioImage8bfc15f2),
imageAlt: 'Ferment Lab Pro Kit: two brewing jars, six swing-top bottles and brewing tools',
},
]}
buttonLabel='Start brewing with the {name}'
buttonSubLabel='{price} · One-time payment'
ps={`Both kits come with my ${sample.guarantee}. Brew your first batch, and if it’s not for you, I’ll refund every cent.`}
/>
)
}
| Name | Type | Details |
|---|---|---|
options RequiredProductSelector3 |
ProductSelector3Option[] |
|
recommendedId OptionalProductSelector3 |
string |
|
defaultSelectedId OptionalProductSelector3 |
string | null |
|
headline OptionalProductSelector3 |
string |
Default 'Which one should you start with?'
|
headlineEmphasis OptionalProductSelector3 |
string |
|
presenterImage OptionalProductSelector3 |
string |
Default ''
|
presenterAlt OptionalProductSelector3 |
string |
Default ''
|
presenterName OptionalProductSelector3 |
string |
Default ''
|
presenterRole OptionalProductSelector3 |
string |
Default ''
|
pickLabel OptionalProductSelector3 |
string |
Default 'My pick for beginners'
|
recommendationLine OptionalProductSelector3 |
string |
Default 'New to this? Start with the {name}.'
|
emptyQuote OptionalProductSelector3 |
string |
Default 'Tap one below and I’ll tell you who it’s for.'
|
legend OptionalProductSelector3 |
string |
Default 'Choose one'
|
selectLabel OptionalProductSelector3 |
string |
Default 'Choose this one'
|
selectedLabel OptionalProductSelector3 |
string |
Default 'Your choice'
|
buttonLabel OptionalProductSelector3 |
string |
Default 'Start with the {name}'
|
buttonSubLabel OptionalProductSelector3 |
string |
Default '{price} · One-time payment'
|
emptyButtonLabel OptionalProductSelector3 |
string |
Default 'Choose one to start'
|
emptyButtonSubLabel OptionalProductSelector3 |
string |
Default 'Tap a card above'
|
psLabel OptionalProductSelector3 |
string |
Default 'P.S.'
|
ps OptionalProductSelector3 |
string |
Default ''
|
errorMessage OptionalProductSelector3 |
string |
Default 'Choose one of the two options above, then tap the button.'
|
disabledNote OptionalProductSelector3 |
string |
Default 'Ordering is unavailable right now.'
|
disabled OptionalProductSelector3 |
boolean |
Default false
|
inputName OptionalProductSelector3 |
string |
|
state OptionalProductSelector3 |
ProductSelector3State |
Default 'default'
|
onSelect OptionalProductSelector3 |
(option: ProductSelector3Option) => void |
|
onSubmit OptionalProductSelector3 |
(option: ProductSelector3Option) => void |
|
className OptionalProductSelector3 |
string |
Default ''
|
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--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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
presenter-cutout- The presenter on a transparent background.
-
a564ccd14f0a5c76.webp
image/webp · 102 KB
-
aa44e2d4420faf55.webp
image/webp · 114 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
ff992e83c89ced14.webp
image/webp · 104 KB