Product Selector 9
Turns a 2–4 product choice into a lit scoreboard on a dark stage: tap a price tile, the pick is cut out as a coupon, and the Add To Cart button names it with its price.
Use it in a prompt
Use offer/product-selector-9 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-9.tsx. - Import it and pass your copy and images (Props tab):
import { ProductSelector9 } from "@/components/funneldna/offer/product-selector-9"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-selector-9/component.tsx 462 lines
// layout: fact-scoreboard
// Turns a 2–4 product choice into a lit scoreboard on a dark stage: tap a price tile, the pick is cut out as a coupon, and the Add To Cart button names it with its price.
import * as React from 'react'
import { motion, useReducedMotion } from 'motion/react'
import { AlertCircle, Check, Download, Lock, Scissors, ShieldCheck, ShoppingCart } from 'lucide-react'
export type ProductSelector9Option = {
id: string
name: string
/** One-line benefit under the name. */
benefit?: string
/** Supplied price, shown exactly as written (e.g. $49). */
price: string
/** Product image, best on a transparent background (shown with object-fit: contain inside a fixed frame). */
image: string
imageAlt?: string
/** Supplied saving for this pick, printed on the coupon. Empty hides it. */
saving?: string
}
export type ProductSelector9State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ProductSelector9Props = {
/** 2 to 4 products or packages. */
options: ProductSelector9Option[]
/** Preselected option id. Defaults to the first option; pass null for none. */
defaultSelectedId?: string | null
headline?: string
/** A phrase inside the headline lit in the stage light colour. */
headlineEmphasis?: string
subhead?: string
/** Screen-reader label for the product group. */
legend?: string
/** Status text on an unselected tile. */
selectLabel?: string
/** Status text on the selected tile. */
selectedLabel?: string
/** Label inside each tile's price readout. */
priceLabel?: string
/** Label at the top of the coupon. */
couponLabel?: string
/** Short line beside the coupon price, e.g. One payment. Empty hides it. */
priceNote?: string
/** Coupon title when nothing is chosen. */
emptyTitle?: string
emptyPrompt?: string
/** Button label; {name} is replaced with the chosen product name. */
buttonLabel?: string
emptyButtonLabel?: string
/** Short supplied reassurance lines under the button. */
reassurance?: string[]
errorMessage?: string
disabledNote?: string
disabled?: boolean
inputName?: string
/** Studio/demo state driver. */
state?: ProductSelector9State
onSelect?: (option: ProductSelector9Option) => void
/** Receives the chosen option on submit. Never sends data by itself. */
onSubmit?: (option: ProductSelector9Option) => void
className?: string
}
const ease = [0.22, 1, 0.36, 1] as const
export function ProductSelector9({
options,
defaultSelectedId,
headline = 'Choose the one you want',
headlineEmphasis,
subhead = 'Select one to add to your order.',
legend = 'Choose one product',
selectLabel = 'Select',
selectedLabel = 'Selected',
priceLabel = 'Price',
couponLabel = 'Your pick',
priceNote = '',
emptyTitle = 'Nothing picked yet',
emptyPrompt = 'Tap a product above to put it here.',
buttonLabel = 'Add {name} To Cart',
emptyButtonLabel = 'Add To Cart',
reassurance = [],
errorMessage = 'Pick one product above, then add it to your cart.',
disabledNote = 'Adding to your cart is unavailable right now.',
disabled = false,
inputName,
state = 'default',
onSelect,
onSubmit,
className = '',
}: ProductSelector9Props) {
const list = (options ?? []).slice(0, 4)
const reduce = useReducedMotion()
const uid = React.useId().replace(/[^a-zA-Z0-9]/g, '')
const group = inputName ?? `ps9-${uid}`
const titleId = `ps9-title-${uid}`
const errId = `ps9-err-${uid}`
const assureId = `ps9-assure-${uid}`
const noteId = `ps9-note-${uid}`
const firstId = defaultSelectedId === undefined ? list[0]?.id ?? null : defaultSelectedId
const [selectedId, setSelectedId] = React.useState<string | null>(state === 'error' ? null : firstId)
const [error, setError] = React.useState(state === 'error')
const [changed, setChanged] = React.useState(false)
React.useEffect(() => {
if (state === 'error') {
setSelectedId(null)
setError(true)
} else {
setSelectedId(firstId)
setError(false)
}
setChanged(false)
// 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 force = state === 'hover' || state === 'active' ? state : undefined
const demoHoverId = state === 'hover' ? list.find((o) => o.id !== selectedId)?.id : undefined
const count = list.length
const label = selected ? fill(buttonLabel, selected.name) : emptyButtonLabel
const showAssure = !isDisabled && reassurance.length > 0
const describedBy = [error ? errId : '', showAssure ? assureId : '', isDisabled ? noteId : ''].filter(Boolean).join(' ') || undefined
const rise = (i: number) =>
reduce
? {}
: {
initial: { opacity: 0.82, y: 8 },
animate: { opacity: 1, y: 0 },
transition: { duration: 0.45, delay: Math.min(i * 0.07, 0.28), ease },
}
const choose = (option: ProductSelector9Option) => {
if (isDisabled) return
setSelectedId(option.id)
setChanged(true)
if (error) setError(false)
onSelect?.(option)
}
const submit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled) return
if (!selected) {
setError(true)
return
}
onSubmit?.(selected)
}
const rootStyle = {
'--ps9-n': count,
'--ps9-n-md': count === 4 ? 2 : count,
} as React.CSSProperties
return (
<div
className={`cf-ps9 ${className}`.trim()}
style={rootStyle}
data-force={force}
data-error={error ? 'true' : 'false'}
data-disabled={isDisabled ? 'true' : 'false'}
>
<style>{CSS}</style>
<form className='ps9-form' onSubmit={submit} noValidate aria-labelledby={titleId}>
<div className='ps9-head'>
<h2 id={titleId} className='ps9-title'>
<Headline text={headline} emphasis={headlineEmphasis} />
</h2>
{subhead ? <p className='ps9-sub'>{subhead}</p> : null}
</div>
<fieldset className='ps9-fieldset' disabled={isDisabled}>
<legend className='ps9-sr'>{legend}</legend>
<div className='ps9-grid'>
{list.map((o, i) => {
const on = o.id === selectedId
return (
<motion.label
key={o.id}
className='ps9-tile'
data-selected={on ? 'true' : 'false'}
data-demo-hover={o.id === demoHoverId ? 'true' : undefined}
{...rise(i)}
>
<input
className='ps9-sr ps9-input'
type='radio'
name={group}
value={o.id}
checked={on}
onChange={() => choose(o)}
aria-invalid={error ? true : undefined}
aria-describedby={error ? errId : undefined}
/>
<span className='ps9-status' aria-hidden='true'>
<span className='ps9-radio' />
<span className='ps9-chip'>{on ? selectedLabel : selectLabel}</span>
</span>
<span className='ps9-media'>
<img src={o.image} alt={o.imageAlt ?? ''} width={480} height={480} loading={i === 0 ? 'eager' : 'lazy'} decoding='async' draggable={false} />
</span>
<span className='ps9-copy'>
<span className='ps9-name'>{o.name}</span>
{o.benefit ? <span className='ps9-benefit'>{o.benefit}</span> : null}
</span>
<span className='ps9-well'>
<span className='ps9-well-label'>{priceLabel}</span>
<span className='ps9-digits'>{o.price}</span>
</span>
</motion.label>
)
})}
</div>
</fieldset>
<motion.div className='ps9-action' {...rise(count)}>
<div className='ps9-coupon' aria-live='polite'>
<span className='ps9-scissors' aria-hidden='true'>
<Scissors size={20} strokeWidth={2.25} />
</span>
<p className='ps9-coupon-label'>{couponLabel}</p>
{selected ? (
<motion.div
key={selected.id}
initial={changed && !reduce ? { opacity: 0.35, y: -8 } : false}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.28, ease }}
>
<p className='ps9-coupon-name'>{selected.name}</p>
{selected.saving ? <p className='ps9-saving'>{selected.saving}</p> : null}
<p className='ps9-coupon-price'>
<span className='ps9-coupon-amount'>{selected.price}</span>
{priceNote ? <span className='ps9-coupon-note'>{priceNote}</span> : null}
</p>
</motion.div>
) : (
<div>
<p className='ps9-coupon-name'>{emptyTitle}</p>
<p className='ps9-coupon-prompt'>{emptyPrompt}</p>
</div>
)}
</div>
<div className='ps9-act'>
{error ? (
<p id={errId} className='ps9-error' role='alert'>
<AlertCircle size={19} strokeWidth={2.4} aria-hidden='true' />
<span>{errorMessage}</span>
</p>
) : null}
<button type='submit' className='ps9-btn' disabled={isDisabled} aria-describedby={describedBy}>
<span className='ps9-btn-main'>
<ShoppingCart className='ps9-btn-icon' size={24} strokeWidth={2.5} aria-hidden='true' />
<span className='ps9-btn-label'>{label}</span>
</span>
{selected ? <span className='ps9-btn-price'>{selected.price}</span> : null}
</button>
{isDisabled ? (
<p id={noteId} className='ps9-note'>{disabledNote}</p>
) : showAssure ? (
<ul id={assureId} className='ps9-assure'>
{reassurance.map((line) => (
<li key={line}>
<AssureIcon text={line} />
<span>{line}</span>
</li>
))}
</ul>
) : null}
</div>
</motion.div>
</form>
</div>
)
}
export default ProductSelector9
const fill = (template: string, name: string) => template.split('{name}').join(name)
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>{emphasis}</em>
{text.slice(at + emphasis.length)}
</>
)
}
function AssureIcon({ text }: { text: string }) {
if (/guarantee|money|refund/i.test(text)) return <ShieldCheck size={18} strokeWidth={2.25} aria-hidden='true' />
if (/secure|checkout|safe/i.test(text)) return <Lock size={17} strokeWidth={2.25} aria-hidden='true' />
if (/access|download|instant/i.test(text)) return <Download size={17} strokeWidth={2.25} aria-hidden='true' />
return <Check size={17} strokeWidth={2.5} aria-hidden='true' />
}
const CSS = `
.cf-ps9{
--ps9-b:var(--button-bg,var(--cta,oklch(0.58 0.21 29)));
--ps9-band:var(--band,oklch(0.27 0.067 256));
--ps9-bink:var(--band-ink,oklch(1 0 0));
--ps9-light:var(--stage-light,oklch(from var(--warning,oklch(0.5 0.1 85)) 0.84 c h));
--ps9-muted:color-mix(in oklab,var(--ps9-bink) 78%,var(--ps9-band));
--ps9-tile:oklch(from var(--ps9-band) calc(l + 0.045) c h);
--ps9-line:oklch(from var(--ps9-band) calc(l + 0.14) c h);
--ps9-well:oklch(from var(--ps9-band) calc(l - 0.05) c h);
--ps9-sh:var(--shadow,oklch(0.22 0.03 256));
--ps9-r:var(--card-radius,var(--radius,12px));
position:relative;isolation:isolate;box-sizing:border-box;width:100%;max-width:1180px;margin-inline:auto;overflow:hidden;
padding:clamp(1.75rem,4vw,3.25rem) clamp(1rem,3vw,2.5rem) clamp(1.25rem,3vw,2.5rem);
border-radius:min(28px,calc(var(--ps9-r) * 1.75));
background:var(--ps9-band);color:var(--ps9-bink);
font-family:var(--font-body,system-ui,sans-serif);
box-shadow:inset 0 1px 0 oklch(from var(--ps9-light) l c h / 0.28);
-webkit-font-smoothing:antialiased;
}
.cf-ps9::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;
background:radial-gradient(70% 60% at 50% -10%,oklch(from var(--ps9-light) l c h / 0.15),oklch(from var(--ps9-light) l c h / 0) 72%);}
.cf-ps9 *,.cf-ps9 *::before,.cf-ps9 *::after{box-sizing:border-box}
.cf-ps9 p{margin:0}
.cf-ps9 .ps9-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;accent-color:var(--field-focus, var(--accent))}
.cf-ps9 .ps9-form{margin:0}
.cf-ps9 .ps9-head{max-width:58rem;margin:0 auto clamp(1.5rem,3vw,2.5rem);text-align:center}
.cf-ps9 .ps9-title{margin:0;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.025em);font-size:clamp(2.25rem,1.35rem + 3.7vw,4.25rem);line-height:1.02;text-wrap:balance;color:var(--ps9-bink)}
.cf-ps9 .ps9-title em{font-style:normal;color:var(--ps9-light)}
.cf-ps9 .ps9-sub{margin-top:clamp(.85rem,1.6vw,1.3rem);font-size:clamp(1.0625rem,.95rem + .45vw,1.3125rem);font-weight:500;line-height:1.45;color:var(--ps9-muted);text-wrap:pretty}
.cf-ps9 .ps9-fieldset{border:0;margin:0;padding:0;min-width:0}
.cf-ps9 .ps9-grid{display:grid;gap:clamp(.75rem,1.4vw,1.125rem);grid-template-columns:repeat(var(--ps9-n),minmax(0,1fr))}
.cf-ps9 .ps9-tile{position:relative;display:flex;flex-direction:column;gap:.875rem;min-width:0;padding:1rem 1rem 1.125rem;cursor:pointer;
border-radius:var(--ps9-r);background:var(--ps9-tile);border:1px solid var(--ps9-line);
box-shadow:inset 0 1px 0 oklch(from var(--ps9-band) calc(l + 0.2) c h / 0.5),0 1px 2px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.5),0 10px 22px -10px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.7);
-webkit-tap-highlight-color:transparent}
.cf-ps9 .ps9-tile[data-selected='true']{translate:0 -4px;border-color:var(--ps9-light);
background:color-mix(in oklab,var(--ps9-light) 9%,var(--ps9-tile));
box-shadow:inset 0 0 0 1px var(--ps9-light),inset 0 1px 0 oklch(from var(--ps9-band) calc(l + 0.22) c h / 0.5),0 2px 3px oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.6),0 18px 30px -12px oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.8)}
.cf-ps9 .ps9-tile:has(.ps9-input:focus-visible){outline:3px solid var(--ps9-bink);outline-offset:3px}
.cf-ps9 .ps9-status{position:relative;z-index:2;display:flex;align-items:center;gap:.625rem;min-height:2rem}
.cf-ps9 .ps9-radio{flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:2px solid var(--ps9-muted)}
.cf-ps9 .ps9-radio::after{content:'';width:12px;height:12px;border-radius:50%;background:var(--ps9-light);scale:0}
.cf-ps9 .ps9-tile[data-selected='true'] .ps9-radio{border-color:var(--ps9-light)}
.cf-ps9 .ps9-tile[data-selected='true'] .ps9-radio::after{scale:1}
.cf-ps9 .ps9-chip{display:inline-flex;align-items:center;min-height:1.875rem;padding:.125rem .75rem;border-radius:999px;font-size:.875rem;font-weight:700;letter-spacing:.03em;color:var(--ps9-muted)}
.cf-ps9 .ps9-tile[data-selected='true'] .ps9-chip{background:var(--ps9-light);color:oklch(from var(--ps9-light) 0.24 c h)}
/* The product frame has a fixed box and the image is pinned inside it, so any image size or aspect stays in its frame and never runs over the name or price. */
.cf-ps9 .ps9-media{position:relative;display:block;flex:none;width:100%;height:clamp(150px,15vw,200px);isolation:isolate}
.cf-ps9 .ps9-media::after{content:'';position:absolute;left:20%;right:20%;bottom:0;height:14px;border-radius:50%;z-index:0;
background:radial-gradient(closest-side,oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.65),oklch(from var(--ps9-sh) l c h / 0))}
.cf-ps9 .ps9-media img{position:absolute;inset:0 0 6px;z-index:1;display:block;width:100%;height:calc(100% - 6px);max-width:none;max-height:none;margin:0;object-fit:contain;object-position:center bottom;
filter:drop-shadow(0 2px 2px oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.5)) drop-shadow(0 10px 10px oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.4))}
.cf-ps9 .ps9-copy{position:relative;z-index:2;display:block;min-width:0}
.cf-ps9 .ps9-name{display:block;font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.25rem,1rem + .8vw,1.625rem);line-height:1.12;letter-spacing:-.01em;text-wrap:balance;color:var(--ps9-bink)}
.cf-ps9 .ps9-benefit{display:block;margin-top:.5rem;font-size:1rem;line-height:1.45;color:var(--ps9-muted);text-wrap:pretty}
.cf-ps9 .ps9-well{position:relative;z-index:2;margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.625rem .875rem;
border-radius:calc(var(--ps9-r) * .75);background:var(--ps9-well);
box-shadow:inset 0 2px 4px oklch(from var(--ps9-sh) calc(l - 0.12) c h / 0.55),inset 0 -1px 0 oklch(from var(--ps9-band) calc(l + 0.12) c h / 0.5)}
.cf-ps9 .ps9-well-label{font-size:.875rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ps9-muted)}
.cf-ps9 .ps9-digits{font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(2.25rem,1.6rem + 2vw,3.25rem);line-height:1.05;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--ps9-bink);white-space:nowrap}
.cf-ps9 .ps9-tile[data-selected='true'] .ps9-digits{color:var(--ps9-light)}
.cf-ps9 .ps9-action{margin-top:clamp(.875rem,1.6vw,1.25rem);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);align-items:stretch;gap:clamp(1rem,2.4vw,2rem);
padding:clamp(1rem,2.2vw,1.75rem);border-radius:var(--ps9-r);background:var(--ps9-tile);border:1px solid var(--ps9-line);
box-shadow:inset 0 1px 0 oklch(from var(--ps9-band) calc(l + 0.2) c h / 0.5),0 1px 2px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.5),0 10px 22px -10px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.7)}
.cf-ps9 .ps9-coupon{position:relative;min-width:0;padding:1.375rem 1.25rem 1.25rem;border:1.5px dashed oklch(from var(--ps9-bink) l c h / 0.4);border-radius:calc(var(--ps9-r) * .75)}
.cf-ps9[data-error='true'] .ps9-coupon{border-color:var(--danger-soft,oklch(0.93 0.024 27))}
.cf-ps9 .ps9-scissors{position:absolute;top:0;left:1rem;translate:0 -50%;display:inline-flex;padding:0 .375rem;background:var(--ps9-tile);color:var(--ps9-light)}
.cf-ps9 .ps9-coupon-label{margin-bottom:.75rem;font-size:.875rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ps9-muted)}
.cf-ps9 .ps9-coupon-name{font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.5rem,1.1rem + 1.3vw,2.125rem);line-height:1.08;letter-spacing:-.015em;text-wrap:balance;color:var(--ps9-bink)}
.cf-ps9 .ps9-coupon-prompt{margin-top:.625rem;font-size:1rem;line-height:1.45;color:var(--ps9-muted);text-wrap:pretty}
.cf-ps9 .ps9-saving{margin-top:.5rem;font-size:1rem;font-weight:700;color:var(--ps9-light)}
.cf-ps9 .ps9-coupon-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:.25rem .875rem;margin-top:.875rem}
.cf-ps9 .ps9-coupon-amount{font-family:var(--font-display,system-ui,sans-serif);font-weight:var(--display-weight,800);font-size:clamp(3rem,2rem + 3vw,4.5rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--ps9-light)}
.cf-ps9 .ps9-coupon-note{font-size:1rem;font-weight:500;color:var(--ps9-muted)}
.cf-ps9 .ps9-act{display:flex;flex-direction:column;justify-content:center;gap:.875rem;min-width:0}
.cf-ps9 .ps9-btn{--ps9-ink:var(--button-ink,var(--cta-ink,oklch(1 0 0)));
display:flex;align-items:center;justify-content:center;gap:.875rem;width:100%;min-height:74px;margin:0;padding:.875rem 1.375rem;cursor:pointer;
border:1px solid oklch(from var(--ps9-b) calc(l - 0.14) c h);border-radius:var(--button-radius,var(--radius,12px));
background:linear-gradient(oklch(from var(--ps9-b) calc(l + 0.04) c h),oklch(from var(--ps9-b) calc(l - 0.05) c h));
color:var(--ps9-ink);text-shadow:var(--button-text-shadow,none);
font-family:var(--button-font,var(--font-display,system-ui,sans-serif));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);
font-size:clamp(1.125rem,.95rem + .6vw,1.375rem);line-height:1.15;letter-spacing:-.005em;
box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ps9-b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--ps9-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.55),0 6px 14px -4px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.6));
-webkit-tap-highlight-color:transparent}
.cf-ps9 .ps9-btn-main{display:block;min-width:0;text-align:center;text-wrap:balance}
.cf-ps9 .ps9-btn-icon{display:inline-block;vertical-align:-0.25em;margin-inline-end:.625rem}
.cf-ps9 .ps9-btn-label{text-align:center;text-wrap:balance}
.cf-ps9 .ps9-btn-price{flex:none;padding-left:.875rem;border-left:1px solid oklch(from var(--ps9-ink) l c h / 0.4);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-ps9 .ps9-btn:focus-visible{outline:3px solid var(--ps9-bink);outline-offset:3px}
.cf-ps9 .ps9-btn:disabled{cursor:not-allowed;text-shadow: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)));
border-color:var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,inset 0 -2px 0 oklch(from var(--secondary,oklch(0.93 0.015 263)) calc(l - 0.1) c h))}
.cf-ps9 .ps9-btn:disabled .ps9-btn-price{border-left-color:oklch(from var(--button-2-ink,var(--secondary-ink,oklch(0.21 0.034 263))) l c h / 0.3)}
.cf-ps9 .ps9-assure{display:flex;flex-wrap:wrap;justify-content:center;gap:.375rem 1.25rem;margin:0;padding:0;list-style:none}
.cf-ps9 .ps9-assure li{display:block;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--ps9-muted)}
.cf-ps9 .ps9-assure svg{display:inline-block;vertical-align:-0.2em;margin-inline-end:.4rem;color:var(--ps9-light)}
.cf-ps9 .ps9-error{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem 1rem;border-radius:calc(var(--radius,12px) * .75);
background:var(--danger-soft,oklch(0.93 0.024 27));color:var(--danger,oklch(0.5 0.17 27));font-size:1rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-ps9 .ps9-error svg{flex:none;margin-top:.0625rem}
.cf-ps9 .ps9-note{text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--ps9-muted)}
.cf-ps9[data-disabled='true'] .ps9-tile{cursor:not-allowed;opacity:.55;translate:none}
@media (hover:hover) and (pointer:fine){
.cf-ps9[data-disabled='false'] .ps9-tile:not([data-selected='true']):hover{translate:0 -3px;border-color:oklch(from var(--ps9-band) calc(l + 0.26) c h)}
.cf-ps9[data-disabled='false'] .ps9-tile:hover .ps9-media img{translate:0 -4px}
.cf-ps9 .ps9-btn:not(:disabled):hover{translate:0 -1px;background:linear-gradient(oklch(from var(--ps9-b) calc(l - 0.01) c h),oklch(from var(--ps9-b) calc(l - 0.1) c h))}
}
.cf-ps9[data-force='hover'][data-disabled='false'] .ps9-tile[data-demo-hover='true']{translate:0 -3px;border-color:oklch(from var(--ps9-band) calc(l + 0.26) c h)}
.cf-ps9[data-force='hover'][data-disabled='false'] .ps9-tile[data-demo-hover='true'] .ps9-media img{translate:0 -4px}
.cf-ps9[data-force='hover'] .ps9-btn:not(:disabled){translate:0 -1px;background:linear-gradient(oklch(from var(--ps9-b) calc(l - 0.01) c h),oklch(from var(--ps9-b) calc(l - 0.1) c h))}
.cf-ps9[data-disabled='false'] .ps9-tile:active{scale:.99}
.cf-ps9 .ps9-btn:not(:disabled):active,.cf-ps9[data-force='active'] .ps9-btn:not(:disabled){translate:0 1px;
background:linear-gradient(oklch(from var(--ps9-b) calc(l - 0.06) c h),oklch(from var(--ps9-b) calc(l - 0.12) c h));
box-shadow:inset 0 2px 3px oklch(from var(--ps9-b) calc(l - 0.22) c h / 0.6),inset 0 -1px 0 oklch(from var(--ps9-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ps9-sh) calc(l - 0.1) c h / 0.5)}
@media (prefers-reduced-motion:no-preference){
.cf-ps9 .ps9-tile{transition:translate .3s cubic-bezier(.22,1,.36,1),border-color .2s ease,background-color .2s ease,box-shadow .3s ease,scale .12s ease,opacity .2s ease}
.cf-ps9 .ps9-media img{transition:translate .4s cubic-bezier(.22,1,.36,1)}
.cf-ps9 .ps9-radio::after{transition:scale .22s cubic-bezier(.34,1.56,.64,1)}
.cf-ps9 .ps9-chip,.cf-ps9 .ps9-digits{transition:background-color .2s ease,color .2s ease}
.cf-ps9 .ps9-btn{transition:translate .14s ease,background .2s ease,box-shadow .14s ease}
}
@media (max-width:879px){
.cf-ps9 .ps9-grid{grid-template-columns:repeat(var(--ps9-n-md),minmax(0,1fr))}
}
@media (max-width:759px){
.cf-ps9 .ps9-action{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:599px){
.cf-ps9{padding:1.75rem 1rem 1rem;border-radius:min(20px,calc(var(--ps9-r) * 1.5))}
.cf-ps9 .ps9-grid{grid-template-columns:minmax(0,1fr)}
.cf-ps9 .ps9-tile{display:grid;grid-template-columns:96px minmax(0,1fr);grid-template-areas:'media status' 'media copy' 'well well';column-gap:.875rem;row-gap:.5rem;padding:.875rem}
.cf-ps9 .ps9-tile[data-selected='true']{translate:none}
.cf-ps9 .ps9-status{grid-area:status}
.cf-ps9 .ps9-media{grid-area:media;align-self:start;width:96px;height:116px}
.cf-ps9 .ps9-copy{grid-area:copy}
.cf-ps9 .ps9-well{grid-area:well;margin-top:.25rem}
.cf-ps9 .ps9-digits{font-size:2.25rem}
.cf-ps9 .ps9-action{padding:1rem}
.cf-ps9 .ps9-btn{flex-direction:column;gap:.25rem;padding:.875rem 1rem;font-size:1.125rem}
.cf-ps9 .ps9-btn-price{padding-left:0;border-left:0;font-size:1rem;opacity:.95}
}
`
pieces/offer/product-selector-9/specimen.tsx 57 lines
import __studioImage5f9c7a13 from "../assets/cc85df67f929683a.webp";
import __studioImage1b61190c from "../assets/271f9cb18d832302.webp";
import __studioImageebfcad42 from "../assets/75c412ebc83a5786.webp";
import * as React from 'react'
import { ProductSelector9 } from '../product-selector-9'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export default function ProductSelector9Specimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
const [guide, workbook, checklist] = sample.items
const options = [
{
id: 'planning-guide',
name: guide.name,
benefit: guide.detail,
price: guide.value,
image: slot('item-1', __studioImage5f9c7a13),
imageAlt: 'Funnel Planning Guide softcover book',
},
{
id: 'copy-workbook',
name: workbook.name,
benefit: workbook.detail,
price: workbook.value,
image: slot('item-2', __studioImage1b61190c),
imageAlt: 'Page Copy Workbook open to its fill-in pages',
},
{
id: 'launch-checklist',
name: checklist.name,
benefit: checklist.detail,
price: checklist.value,
image: slot('item-3', __studioImageebfcad42),
imageAlt: 'Launch Checklist on a silver clipboard',
},
]
return (
<ProductSelector9
options={options}
headline='Pick the tool that gets your funnel built'
headlineEmphasis='your funnel built'
subhead='Choose one. It goes straight into your cart at the price shown.'
couponLabel='Your pick'
priceNote={sample.note}
buttonLabel='Add {name} To Cart'
reassurance={sample.reassurance}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
options RequiredProductSelector9 |
ProductSelector9Option[] |
|
defaultSelectedId OptionalProductSelector9 |
string | null |
|
headline OptionalProductSelector9 |
string |
Default 'Choose the one you want'
|
headlineEmphasis OptionalProductSelector9 |
string |
|
subhead OptionalProductSelector9 |
string |
Default 'Select one to add to your order.'
|
legend OptionalProductSelector9 |
string |
Default 'Choose one product'
|
selectLabel OptionalProductSelector9 |
string |
Default 'Select'
|
selectedLabel OptionalProductSelector9 |
string |
Default 'Selected'
|
priceLabel OptionalProductSelector9 |
string |
Default 'Price'
|
couponLabel OptionalProductSelector9 |
string |
Default 'Your pick'
|
priceNote OptionalProductSelector9 |
string |
Default ''
|
emptyTitle OptionalProductSelector9 |
string |
Default 'Nothing picked yet'
|
emptyPrompt OptionalProductSelector9 |
string |
Default 'Tap a product above to put it here.'
|
buttonLabel OptionalProductSelector9 |
string |
Default 'Add {name} To Cart'
|
emptyButtonLabel OptionalProductSelector9 |
string |
Default 'Add To Cart'
|
reassurance OptionalProductSelector9 |
string[] |
Default []
|
errorMessage OptionalProductSelector9 |
string |
Default 'Pick one product above, then add it to your cart.'
|
disabledNote OptionalProductSelector9 |
string |
Default 'Adding to your cart is unavailable right now.'
|
disabled OptionalProductSelector9 |
boolean |
Default false
|
inputName OptionalProductSelector9 |
string |
|
state OptionalProductSelector9 |
ProductSelector9State |
Default 'default'
|
onSelect OptionalProductSelector9 |
(option: ProductSelector9Option) => void |
|
onSubmit OptionalProductSelector9 |
(option: ProductSelector9Option) => void |
|
className OptionalProductSelector9 |
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-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-radius- 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.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
271f9cb18d832302.webp
image/webp · 125 KB
-
75c412ebc83a5786.webp
image/webp · 97.3 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
cc85df67f929683a.webp
image/webp · 78.9 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB