Product Selector 5
The buyer's guide: an editorial spread that matches each pick to the room it fits. Tapping the room you are treating lights up the right pick, scrolls it into view and puts its name on the button.
Use it in a prompt
Use offer/product-selector-5 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/offer/product-selector-5.tsx. - Import it and pass your copy and images (Props tab):
import { ProductSelector5 } from "@/components/funneldna/offer/product-selector-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-selector-5/component.tsx 530 lines
// layout: magazine-spread
// The buyer's guide: an editorial spread that matches each pick to the room it fits. Tapping the room you are treating lights up the right pick, scrolls it into view and puts its name on the button.
import * as React from 'react'
import { Check, ShieldCheck } from 'lucide-react'
export type ProductSelector5Spec = { label: string; value: string }
export type ProductSelector5Line = { label: string; amount: string }
export type ProductSelector5Pick = {
id: string
/** The fit: who or where it is best for, e.g. Best for a home office. Never an award. */
fit: string
name: string
/** Bold lead-in that says who it is for, e.g. You take calls from a spare room. */
forWho?: string
/** One or two lines that follow the lead-in. */
verdict?: string
/** Up to four supplied key specs. */
specs?: ProductSelector5Spec[]
/** Receipt item lines, shown exactly as supplied. */
receipt?: ProductSelector5Line[]
/** Supplied subtotal before the discount. Empty hides the row. */
subtotal?: string
/** Supplied discount line. Empty hides it. */
discount?: ProductSelector5Line
/** Supplied total price, set in bold at the foot of the receipt. */
price: string
/** Product photo; fills its frame (object-fit: cover). */
image: string
imageAlt?: string
/** CSS object-position for the photo, e.g. center 40%. */
imagePosition?: string
/** Overrides the shared button label for this pick; {name}, {price} and {fit} are replaced. */
buttonLabel?: string
/** Checkout destination for this pick; renders the button as a link. */
href?: string
}
export type ProductSelector5Room = {
id: string
/** Chip label, e.g. Home office. */
label: string
/** The pick that fits this room. Several rooms may share one pick. */
pickId: string
/** The room in running text for the match flag, e.g. home office. Defaults to the label. */
phrase?: string
}
export type ProductSelector5Intro = {
/** Bold lead-in phrase that opens the paragraph. */
lead: string
text: string
}
export type ProductSelector5State = 'default' | 'hover' | 'active' | 'disabled'
export type ProductSelector5Props = {
/** 2 to 4 picks, shown as numbered editorial entries in this order. */
picks: ProductSelector5Pick[]
/** Rooms for the chip row. Defaults to one chip per pick, labelled with its fit. */
rooms?: ProductSelector5Room[]
/** Room selected first. Defaults to the first room; pass null for no selection. */
defaultRoomId?: string | null
headline?: string
/** One phrase inside the headline that gets the marker stroke. */
headlineEmphasis?: string
/** Short intro paragraphs, each opening with a bold lead-in. */
intro?: ProductSelector5Intro[]
/** Large pull line built from a supplied fact. Empty hides it. */
pullLine?: string
/** The question above the room chips. */
roomsPrompt?: string
/** Flag on the matching entry; {room} is replaced with the room phrase. Empty hides it. */
matchLabel?: string
/** Button label; {name}, {price} and {fit} are replaced with the pick. */
buttonLabel?: string
subtotalLabel?: string
totalLabel?: string
/** Accessible name of each receipt; {name} is replaced. */
receiptLabel?: string
/** One short supplied reassurance line under each button. Empty hides it. */
note?: string
/** Screen-reader announcement after a choice; {fit} and {name} are replaced. */
announceLabel?: string
disabledNote?: string
disabled?: boolean
/** Studio/demo state driver. */
state?: ProductSelector5State
/** Called when a room chip or an entry is chosen. */
onSelect?: (pick: ProductSelector5Pick, room: ProductSelector5Room | null) => void
/** Called with the pick whose button was pressed. Never sends data by itself. */
onAction?: (pick: ProductSelector5Pick) => void
className?: string
}
export function ProductSelector5({
picks,
rooms,
defaultRoomId,
headline = 'Find the right fit for your room',
headlineEmphasis,
intro = [],
pullLine = '',
roomsPrompt = 'Which room are you treating?',
matchLabel = 'Fits your {room}',
buttonLabel = 'Yes! I want {name}',
subtotalLabel = 'Subtotal',
totalLabel = 'Total today',
receiptLabel = 'Price for {name}',
note = '',
announceLabel = 'Showing {fit}: {name}',
disabledNote = 'Ordering is unavailable right now.',
disabled = false,
state = 'default',
onSelect,
onAction,
className = '',
}: ProductSelector5Props) {
const list = (picks ?? []).slice(0, 4)
const baseRooms: ProductSelector5Room[] =
rooms && rooms.length > 0 ? rooms : list.map((p) => ({ id: p.id, label: p.fit, pickId: p.id }))
const roomList = baseRooms.filter((r) => list.some((p) => p.id === r.pickId))
const uid = React.useId().replace(/[^a-zA-Z0-9]/g, '')
const entryRefs = React.useRef<Record<string, HTMLElement | null>>({})
const initialRoom =
defaultRoomId === null
? null
: roomList.find((r) => r.id === defaultRoomId) ?? (defaultRoomId === undefined ? roomList[0] ?? null : null)
const initialPick = initialRoom ? initialRoom.pickId : defaultRoomId === null ? null : list[0]?.id ?? null
const [roomId, setRoomId] = React.useState<string | null>(initialRoom?.id ?? null)
const [pickId, setPickId] = React.useState<string | null>(initialPick)
const [said, setSaid] = React.useState('')
React.useEffect(() => {
setRoomId(initialRoom?.id ?? null)
setPickId(initialPick)
setSaid('')
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
if (list.length === 0) return null
const isDisabled = disabled || state === 'disabled'
const force = state === 'hover' || state === 'active' ? state : undefined
const room = roomList.find((r) => r.id === roomId) ?? null
const demoChipId = state === 'hover' ? roomList.find((r) => r.id !== roomId)?.id : undefined
const demoEntryId = state === 'hover' ? list.find((p) => p.id !== pickId)?.id : undefined
const titleId = `ps5-title-${uid}`
const askId = `ps5-ask-${uid}`
const entryId = (id: string) => `ps5-entry-${uid}-${id}`
const reveal = (id: string) => {
const el = entryRefs.current[id]
if (!el || typeof window === 'undefined') return
const reduce = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
el.scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'start' })
}
const announce = (pick: ProductSelector5Pick) => setSaid(fill(announceLabel, pick))
const chooseRoom = (next: ProductSelector5Room) => {
const pick = list.find((p) => p.id === next.pickId)
if (!pick) return
setRoomId(next.id)
setPickId(pick.id)
announce(pick)
onSelect?.(pick, next)
reveal(pick.id)
}
const chooseEntry = (pick: ProductSelector5Pick) => {
if (pick.id === pickId) return
const keep = room && room.pickId === pick.id ? room : roomList.find((r) => r.pickId === pick.id) ?? null
setPickId(pick.id)
setRoomId(keep?.id ?? null)
announce(pick)
onSelect?.(pick, keep)
}
const act = (pick: ProductSelector5Pick) => {
if (isDisabled) return
chooseEntry(pick)
onAction?.(pick)
}
return (
<section
className={`cf-product-selector-5 ${className}`.trim()}
aria-labelledby={titleId}
data-force={force}
data-disabled={isDisabled ? 'true' : 'false'}
>
<style>{CSS}</style>
<div className='ps5-wrap'>
<header className='ps5-mast'>
<h2 id={titleId} className='ps5-title'>
<Headline text={headline} emphasis={headlineEmphasis} />
</h2>
</header>
<div className='ps5-spread'>
<div className='ps5-aside'>
{intro.length > 0 || pullLine ? (
<div className='ps5-intro'>
{intro.map((p, i) => (
<p key={i}>
<strong>{p.lead}</strong> {p.text}
</p>
))}
{pullLine ? <p className='ps5-pull'>{pullLine}</p> : null}
</div>
) : null}
{roomList.length > 1 ? (
<div className='ps5-rooms'>
<p id={askId} className='ps5-ask'>
{roomsPrompt}
</p>
<div className='ps5-chips' role='group' aria-labelledby={askId}>
{roomList.map((r) => {
const on = r.id === roomId
const pickName = list.find((p) => p.id === r.pickId)?.name
return (
<button
key={r.id}
type='button'
className='ps5-chip'
aria-pressed={on}
aria-controls={entryId(r.pickId)}
data-demo={r.id === demoChipId ? 'hover' : undefined}
onClick={() => chooseRoom(r)}
>
<span className='ps5-dot' aria-hidden='true'>
{on ? <Check size={14} strokeWidth={3} /> : null}
</span>
<span className='ps5-chip-label'>{r.label}</span>
{pickName ? <span className='ps5-chip-pick'>{pickName}</span> : null}
</button>
)
})}
</div>
</div>
) : null}
</div>
<ol className='ps5-picks'>
{list.map((pick, i) => {
const on = pick.id === pickId
const n = `${uid}-${i}`
const fitId = `ps5-fit-${n}`
const noteId = `ps5-note-${n}`
const match = on && room && matchLabel ? matchLabel.split('{room}').join(room.phrase ?? room.label) : ''
const label = fill(pick.buttonLabel ?? buttonLabel, pick)
const cls = `ps5-btn ${on ? 'ps5-btn--primary' : 'ps5-btn--secondary'}`
const showNote = isDisabled ? Boolean(disabledNote) : Boolean(note)
const specs = (pick.specs ?? []).slice(0, 4)
const lines = pick.receipt ?? []
return (
<li key={pick.id} className='ps5-item'>
<article
id={entryId(pick.id)}
ref={(el) => {
entryRefs.current[pick.id] = el
}}
className='ps5-entry'
aria-labelledby={fitId}
aria-current={on ? 'true' : undefined}
data-selected={on ? 'true' : 'false'}
data-demo={pick.id === demoEntryId ? 'hover' : undefined}
style={{ '--ps5-i': i } as React.CSSProperties}
onClick={(event) => {
if ((event.target as HTMLElement).closest('a,button')) return
chooseEntry(pick)
}}
>
<div className='ps5-entry-in'>
<div className='ps5-media'>
<img
src={pick.image}
alt={pick.imageAlt ?? ''}
width={800}
height={800}
loading={i === 0 ? 'eager' : 'lazy'}
decoding='async'
draggable={false}
style={{ objectPosition: pick.imagePosition ?? 'center' }}
/>
</div>
<div className='ps5-body'>
{match ? <p className='ps5-match'>{match}</p> : null}
<div className='ps5-head'>
<span className='ps5-num' aria-hidden='true'>
{String(i + 1).padStart(2, '0')}
</span>
<h3 id={fitId} className='ps5-fit'>
{pick.fit}
</h3>
</div>
<p className='ps5-name'>{pick.name}</p>
{pick.forWho || pick.verdict ? (
<p className='ps5-copy'>
{pick.forWho ? <strong>{pick.forWho}</strong> : null}
{pick.forWho && pick.verdict ? ' ' : null}
{pick.verdict}
</p>
) : null}
{specs.length > 0 ? (
<dl className='ps5-specs'>
{specs.map((s, k) => (
<div key={k}>
<dt>{s.label}</dt>
<dd>{s.value}</dd>
</div>
))}
</dl>
) : null}
<dl className='ps5-receipt' aria-label={receiptLabel.split('{name}').join(pick.name)}>
{lines.map((line, k) => (
<div key={k} className='ps5-row'>
<dt>{line.label}</dt>
<dd>{line.amount}</dd>
</div>
))}
{pick.subtotal ? (
<div className='ps5-row ps5-row--sub'>
<dt>{subtotalLabel}</dt>
<dd>{pick.subtotal}</dd>
</div>
) : null}
{pick.discount ? (
<div className='ps5-row ps5-row--off'>
<dt>{pick.discount.label}</dt>
<dd>{pick.discount.amount}</dd>
</div>
) : null}
<div className='ps5-total'>
<dt>{totalLabel}</dt>
<dd>{pick.price}</dd>
</div>
</dl>
</div>
<div className='ps5-buy'>
{pick.href && !isDisabled ? (
<a
className={cls}
href={pick.href}
aria-describedby={showNote ? noteId : undefined}
onClick={() => act(pick)}
>
{label}
</a>
) : (
<button
type='button'
className={cls}
disabled={isDisabled}
aria-describedby={showNote ? noteId : undefined}
onClick={() => act(pick)}
>
{label}
</button>
)}
{showNote ? (
<p id={noteId} className='ps5-note'>
{isDisabled ? null : (
<ShieldCheck className='ps5-note-ic' size={16} strokeWidth={2.5} aria-hidden />
)}
{isDisabled ? disabledNote : note}
</p>
) : null}
</div>
</div>
</article>
</li>
)
})}
</ol>
</div>
<p className='ps5-sr' aria-live='polite'>
{said}
</p>
</div>
</section>
)
}
export default ProductSelector5
function fill(template: string, pick: ProductSelector5Pick) {
return template.split('{name}').join(pick.name).split('{price}').join(pick.price).split('{fit}').join(pick.fit)
}
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)}
<span className='ps5-mark'>{emphasis}</span>
{text.slice(at + emphasis.length)}
</>
)
}
const CSS = `
.cf-product-selector-5{
--ps5-g:clamp(16px,5vw,48px);
--ps5-ink:var(--ink,#172033);
--ps5-muted:var(--muted,#4b5565);
--ps5-line:oklch(from var(--ink,#172033) l c h / .12);
--ps5-sh:var(--shadow,oklch(.22 .03 260));
--ps5-b:var(--button-bg,var(--cta,#d93a26));
--ps5-b2:var(--button-bg-2,var(--cta-2,#b82e1d));
--ps5-ease:cubic-bezier(.2,.7,.2,1);
position:relative;box-sizing:border-box;
background:var(--surface,#ffffff);color:var(--ps5-ink);
font-family:var(--font-body,system-ui,sans-serif);
padding:clamp(56px,8vw,112px) 0 clamp(64px,8.5vw,120px);
overflow-x:clip;
}
.cf-product-selector-5 *,.cf-product-selector-5 *::before,.cf-product-selector-5 *::after{box-sizing:border-box}
.cf-product-selector-5 .ps5-wrap{max-width:calc(1120px + 2 * var(--ps5-g));margin-inline:auto;padding-inline:var(--ps5-g)}
.cf-product-selector-5 .ps5-mast{max-width:52rem;margin:0 0 clamp(32px,4vw,48px)}
.cf-product-selector-5 .ps5-title{margin:0;font-family:var(--font-display,system-ui,sans-serif);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-mark{background:linear-gradient(transparent 54%,oklch(from var(--marker,#fae37c) l c h / .62) 54%,oklch(from var(--marker,#fae37c) l c h / .62) 93%,transparent 93%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-inline:.05em;border-radius:.1em .2em .14em .08em}
.cf-product-selector-5 .ps5-spread{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
.cf-product-selector-5 .ps5-aside{display:contents}
.cf-product-selector-5 .ps5-intro p{margin:0 0 16px;max-width:64ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ps5-ink);text-wrap:pretty}
.cf-product-selector-5 .ps5-intro p:last-child{margin-bottom:0}
.cf-product-selector-5 .ps5-intro strong{font-weight:800}
.cf-product-selector-5 .ps5-intro .ps5-pull{margin:24px 0 0;max-width:none;font-family:var(--font-display,system-ui,sans-serif);font-size:clamp(1.5rem,2.4vw,2.125rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.015em;color:var(--accent,#1d4ed8);text-wrap:balance}
.cf-product-selector-5 .ps5-rooms{position:sticky;top:0;z-index:3;align-self:start;margin-inline:calc(-1 * var(--ps5-g));padding:12px var(--ps5-g);background:var(--surface,#ffffff);box-shadow:0 1px 0 var(--ps5-line)}
.cf-product-selector-5 .ps5-ask{margin:0 0 12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;font-weight:800;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-chips{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;margin-inline:calc(-1 * var(--ps5-g));padding:4px 48px 4px var(--ps5-g);scroll-padding-inline:var(--ps5-g);scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;-webkit-mask-image:linear-gradient(to right,black calc(100% - 44px),transparent);mask-image:linear-gradient(to right,black calc(100% - 44px),transparent)}
.cf-product-selector-5 .ps5-chips::-webkit-scrollbar{display:none}
.cf-product-selector-5 .ps5-chip{flex:0 0 auto;scroll-snap-align:start;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px 0 12px;border-radius:999px;border:1px solid var(--ps5-line);background:color-mix(in oklch,var(--ink,#172033) 5%,var(--card,#ffffff));color:var(--ps5-ink);font-family:var(--font-body,system-ui,sans-serif);font-size:.9375rem;line-height:1.2;font-weight:700;white-space:nowrap;cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .16s ease}
.cf-product-selector-5 .ps5-chip:hover,.cf-product-selector-5[data-force='hover'] .ps5-chip[data-demo='hover']{background:color-mix(in oklch,var(--ink,#172033) 10%,var(--card,#ffffff));border-color:oklch(from var(--ink,#172033) l c h / .22)}
.cf-product-selector-5 .ps5-chip[aria-pressed='true']{background:color-mix(in oklch,var(--accent,#1d4ed8) 12%,var(--card,#ffffff));border-color:oklch(from var(--accent,#1d4ed8) l c h / .6);color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-chip:active,.cf-product-selector-5[data-force='active'] .ps5-chip[aria-pressed='true']{transform:scale(.97)}
.cf-product-selector-5 .ps5-chip:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent,#1d4ed8)) l c h / .6);outline-offset:2px}
.cf-product-selector-5 .ps5-chip-label{min-width:0}
.cf-product-selector-5 .ps5-chip-pick{display:none;flex:0 0 auto;margin-inline-start:auto;font-size:.875rem;line-height:1.2;font-weight:600;color:var(--ps5-muted);white-space:nowrap}
.cf-product-selector-5 .ps5-chip[aria-pressed='true'] .ps5-chip-pick{color:var(--ps5-ink);font-weight:800}
.cf-product-selector-5 .ps5-dot{display:inline-grid;place-items:center;flex:0 0 auto;width:20px;height:20px;border-radius:999px;border:2px solid oklch(from var(--ink,#172033) l c h / .32);transition:background .16s ease,border-color .16s ease}
.cf-product-selector-5 .ps5-chip[aria-pressed='true'] .ps5-dot{background:var(--accent-fill,var(--accent,#1d4ed8));border-color:var(--accent-fill,var(--accent,#1d4ed8));color:var(--accent-fill-ink,var(--card,#ffffff))}
.cf-product-selector-5 .ps5-picks{list-style:none;margin:0;padding:0;display:grid;gap:clamp(20px,3vw,32px);min-width:0}
.cf-product-selector-5 .ps5-item{min-width:0}
.cf-product-selector-5 .ps5-entry{position:relative;container-type:inline-size;scroll-margin-top:136px;padding:16px;background:var(--card,#ffffff);border:1px solid var(--card-border,oklch(from var(--ink,#172033) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(.22 .03 260 / .22),0 4px 10px -2px oklch(.22 .03 260 / .2)));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;animation:ps5-rise .45s var(--ps5-ease) backwards;animation-delay:min(calc(var(--ps5-i,0) * .07s),.28s)}
.cf-product-selector-5 .ps5-entry:not([data-selected='true']):hover,.cf-product-selector-5[data-force='hover'] .ps5-entry[data-demo='hover']{transform:translateY(-2px);border-color:oklch(from var(--ink,#172033) l c h / .22);box-shadow:var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32))}
.cf-product-selector-5 .ps5-entry[data-selected='true']{cursor:default;border-color:oklch(from var(--accent,#1d4ed8) l c h / .7);box-shadow:inset 0 0 0 1px oklch(from var(--accent,#1d4ed8) l c h / .7),var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32))}
.cf-product-selector-5 .ps5-entry:not([data-selected='true']):has(:focus-visible){border-color:oklch(from var(--accent,#1d4ed8) l c h / .5)}
.cf-product-selector-5 .ps5-entry-in{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
.cf-product-selector-5 .ps5-media{overflow:hidden;border-radius:12px;min-width:0}
.cf-product-selector-5 .ps5-media img{display:block;width:100%;aspect-ratio:16/10;object-fit:cover;border-radius:12px;transition:transform .45s var(--ps5-ease)}
.cf-product-selector-5 .ps5-entry:hover .ps5-media img{transform:scale(1.03)}
.cf-product-selector-5 .ps5-body{min-width:0}
.cf-product-selector-5 .ps5-match{display:inline-flex;align-items:center;min-height:28px;margin:0 0 12px;padding:4px 12px;border-radius:999px;background:var(--accent-fill,var(--accent,#1d4ed8));color:var(--accent-fill-ink,var(--card,#ffffff));font-size:.875rem;line-height:1.2;font-weight:800;animation:ps5-pop .3s var(--ps5-ease) backwards}
.cf-product-selector-5 .ps5-head{display:flex;align-items:baseline;gap:12px;margin:0 0 8px}
.cf-product-selector-5 .ps5-num{flex:0 0 auto;font-family:var(--font-display,system-ui,sans-serif);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;font-variant-numeric:tabular-nums;color:var(--accent,#1d4ed8)}
.cf-product-selector-5 .ps5-fit{margin:0;min-width:0;font-family:var(--font-display,system-ui,sans-serif);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-name{margin:0 0 12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:700;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-copy{margin:0 0 20px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ps5-ink);text-wrap:pretty}
.cf-product-selector-5 .ps5-copy strong{font-weight:800}
.cf-product-selector-5 .ps5-specs{display:flex;flex-wrap:wrap;gap:12px 24px;margin:0 0 20px}
.cf-product-selector-5 .ps5-specs > div{min-width:0}
.cf-product-selector-5 .ps5-specs dt{margin:0 0 4px;font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--ps5-muted)}
.cf-product-selector-5 .ps5-specs dd{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ps5-ink);text-wrap:pretty}
.cf-product-selector-5 .ps5-receipt{margin:0;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink,#172033) 4%,var(--card,#ffffff));font-variant-numeric:tabular-nums}
.cf-product-selector-5 .ps5-row{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding-block:3px;font-size:.9375rem;line-height:1.4}
.cf-product-selector-5 .ps5-row dt{min-width:0;color:var(--ps5-ink);text-wrap:pretty}
.cf-product-selector-5 .ps5-row dd{margin:0;flex:0 0 auto;font-weight:700;white-space:nowrap;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-row--sub dt,.cf-product-selector-5 .ps5-row--sub dd{color:var(--ps5-muted)}
.cf-product-selector-5 .ps5-row--off dt,.cf-product-selector-5 .ps5-row--off dd{color:var(--success,#15803d);font-weight:700}
.cf-product-selector-5 .ps5-total{display:flex;justify-content:space-between;align-items:baseline;gap:16px;margin-top:16px}
.cf-product-selector-5 .ps5-total dt{font-size:.9375rem;line-height:1.2;font-weight:800;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-total dd{margin:0;font-family:var(--font-display,system-ui,sans-serif);font-size:clamp(2rem,3.2vw,2.75rem);line-height:1;font-weight:800;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ps5-ink)}
.cf-product-selector-5 .ps5-buy{min-width:0}
.cf-product-selector-5 .ps5-btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;padding:12px 16px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display,system-ui,sans-serif));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-wrap:balance;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
.cf-product-selector-5 .ps5-btn--primary{background:linear-gradient(oklch(from var(--ps5-b) calc(l + .04) c h),oklch(from var(--ps5-b2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#ffffff));text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ps5-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ps5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--ps5-sh) l c h / .3),0 8px 16px -6px oklch(from var(--ps5-sh) l c h / .38))}
.cf-product-selector-5 .ps5-btn--primary:hover,.cf-product-selector-5[data-force='hover'] .ps5-entry[data-selected='true'] .ps5-btn--primary{background:linear-gradient(oklch(from var(--ps5-b) calc(l - .01) c h),oklch(from var(--ps5-b2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--ps5-b) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--ps5-b) calc(l - .2) c h),0 1px 2px oklch(from var(--ps5-sh) l c h / .34),0 10px 18px -6px oklch(from var(--ps5-sh) l c h / .46)}
.cf-product-selector-5 .ps5-btn--primary:active,.cf-product-selector-5[data-force='active'] .ps5-entry[data-selected='true'] .ps5-btn--primary{transform:translateY(1px);background:linear-gradient(oklch(from var(--ps5-b) calc(l - .06) c h),oklch(from var(--ps5-b2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--ps5-b) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--ps5-b) calc(l - .16) c h),0 1px 2px oklch(from var(--ps5-sh) l c h / .3)}
.cf-product-selector-5 .ps5-btn--secondary{background:var(--button-2-bg,var(--secondary,#e8ebf0));color:var(--button-2-ink,var(--secondary-ink,#172033));border:1px solid var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 1px oklch(.22 .03 260 / .18),0 1px 3px oklch(.22 .03 260 / .14)))}
.cf-product-selector-5 .ps5-btn--secondary:hover{background:oklch(from var(--button-2-bg,var(--secondary,#e8ebf0)) calc(l - .04) c h)}
.cf-product-selector-5 .ps5-btn--secondary:active{transform:translateY(1px);background:oklch(from var(--button-2-bg,var(--secondary,#e8ebf0)) calc(l - .07) c h);box-shadow:none}
.cf-product-selector-5 .ps5-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent,#1d4ed8)) l c h / .6);outline-offset:3px}
.cf-product-selector-5 .ps5-btn:disabled{background:var(--secondary,#e8ebf0);color:var(--secondary-ink,#172033);border-color:transparent;box-shadow:none;text-shadow:none;transform:none;cursor:not-allowed}
.cf-product-selector-5 .ps5-note{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--ps5-muted);text-wrap:pretty}
.cf-product-selector-5 .ps5-note-ic{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;color:var(--success,#15803d)}
.cf-product-selector-5 .ps5-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@container (max-width: 400px){
.cf-product-selector-5 .ps5-btn{font-size:1.0625rem;padding-inline:10px;letter-spacing:-0.005em}
}
@container (min-width: 600px){
.cf-product-selector-5 .ps5-entry-in{grid-template-columns:minmax(0,.8fr) minmax(0,1fr);column-gap:28px;row-gap:24px;align-items:start}
.cf-product-selector-5 .ps5-media{align-self:stretch}
.cf-product-selector-5 .ps5-media img{height:100%;min-height:300px;aspect-ratio:auto}
.cf-product-selector-5 .ps5-buy{grid-column:1 / -1}
.cf-product-selector-5 .ps5-btn{padding:0 28px}
}
@media (min-width: 640px){
.cf-product-selector-5 .ps5-entry{padding:clamp(20px,3vw,32px)}
}
@media (min-width: 960px){
.cf-product-selector-5 .ps5-spread{grid-template-columns:minmax(0,20rem) minmax(0,1fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-product-selector-5 .ps5-aside{display:grid;gap:32px;position:sticky;top:24px;align-self:start}
.cf-product-selector-5 .ps5-rooms{position:static;margin:0;padding:0;background:none;box-shadow:none}
.cf-product-selector-5 .ps5-chips{flex-direction:column;flex-wrap:nowrap;overflow:visible;margin:0;padding:0;-webkit-mask-image:none;mask-image:none}
.cf-product-selector-5 .ps5-chip{width:100%;min-height:52px;padding:0 16px 0 14px;gap:12px;border-radius:var(--field-radius,var(--radius,12px));white-space:normal;text-align:left}
.cf-product-selector-5 .ps5-chip-pick{display:inline}
.cf-product-selector-5 .ps5-entry{scroll-margin-top:32px}
}
@keyframes ps5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ps5-pop{from{transform:scale(.9)}to{transform:none}}
@media (prefers-reduced-motion: reduce){
.cf-product-selector-5 .ps5-entry,.cf-product-selector-5 .ps5-match{animation:none}
.cf-product-selector-5 .ps5-entry,.cf-product-selector-5 .ps5-chip,.cf-product-selector-5 .ps5-btn,.cf-product-selector-5 .ps5-media img,.cf-product-selector-5 .ps5-dot{transition:none}
.cf-product-selector-5 .ps5-entry:hover,.cf-product-selector-5[data-force='hover'] .ps5-entry[data-demo='hover'],.cf-product-selector-5 .ps5-entry:hover .ps5-media img,.cf-product-selector-5 .ps5-chip:active,.cf-product-selector-5 .ps5-btn:active{transform:none}
}
`
pieces/offer/product-selector-5/specimen.tsx 108 lines
import __studioImage13e7f8be from "../assets/2378512545fc73b6.webp";
import __studioImage06dee773 from "../assets/1049e894fb4a2c3a.webp";
import __studioImage4f6ff2d9 from "../assets/5c2c6300653b085d.webp";
import * as React from 'react'
import { ProductSelector5, type ProductSelector5State } from '../product-selector-5'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled']
const soloShot = __studioImage13e7f8be
const teamShot = __studioImage06dee773
const canopyShot = __studioImage4f6ff2d9
export default function ProductSelector5Specimen({ state = 'default' }: { state?: ProductSelector5State }) {
const picks = [
{
id: 'solo',
fit: 'Best for a home office',
name: 'Quietdesk Solo',
forWho: 'You take client calls from a spare room.',
verdict: 'Six panels behind and beside your desk cut the hollow echo your clients hear on every call.',
specs: [
{ label: 'Panels', value: '6' },
{ label: 'Size', value: '24 × 24 in.' },
{ label: 'Covers', value: 'Up to 120 sq ft' },
],
receipt: [
{ label: '6 Solo panels, 24 × 24 in.', amount: '$389' },
{ label: 'Wall mounting kit', amount: 'Included' },
],
price: '$389',
image: slot('item-1', soloShot),
imageAlt: 'Six charcoal felt Quietdesk Solo panels on the wall behind a home office desk',
},
{
id: 'team',
fit: 'Best value for a busy meeting room',
name: 'Quietdesk Team',
forWho: 'You run one meeting room that everyone books.',
verdict: 'Twelve panels for the price of ten, enough to calm a room for eight, with the mounting kit in the box.',
specs: [
{ label: 'Panels', value: '12' },
{ label: 'Size', value: '24 × 48 in.' },
{ label: 'Covers', value: 'Up to 300 sq ft' },
],
receipt: [
{ label: '12 Team panels, 24 × 48 in.', amount: '$1,140' },
{ label: 'Wall mounting kit', amount: 'Included' },
],
subtotal: '$1,140',
discount: { label: 'Two panels free', amount: '−$190' },
price: '$950',
image: slot('item-2', teamShot),
imageAlt: 'A row of slate-blue Quietdesk Team panels along a meeting room wall',
},
{
id: 'canopy',
fit: 'Best for an open-plan floor',
name: 'Quietdesk Canopy',
forWho: 'Your open floor sounds like a busy café by 10 a.m.',
verdict: 'Ceiling-hung baffles soak up chatter above the desks, so nothing goes on your walls and no one has to move.',
specs: [
{ label: 'Baffles', value: '10' },
{ label: 'Size', value: '12 × 48 in.' },
{ label: 'Covers', value: 'Up to 600 sq ft' },
],
receipt: [
{ label: '10 Canopy baffles, 12 × 48 in.', amount: '$1,290' },
{ label: 'Ceiling hanging kit', amount: 'Included' },
],
price: '$1,290',
image: slot('item-3', canopyShot),
imageAlt: 'Grey Quietdesk Canopy baffles hanging above desks in an open-plan office',
},
]
const rooms = [
{ id: 'home', label: 'Home office', pickId: 'solo', phrase: 'home office' },
{ id: 'meeting', label: 'Meeting room', pickId: 'team', phrase: 'meeting room' },
{ id: 'team-room', label: 'Small team room', pickId: 'team', phrase: 'small team room' },
{ id: 'open', label: 'Open-plan floor', pickId: 'canopy', phrase: 'open-plan floor' },
{ id: 'breakout', label: 'Breakout area', pickId: 'canopy', phrase: 'breakout area' },
]
return (
<ProductSelector5
picks={picks}
rooms={rooms}
headline='Find the panels built for your room'
headlineEmphasis='built for your room'
intro={[
{
lead: 'Echo is the problem, not the noise.',
text: 'Hard walls bounce every voice back at you. Felt on the right surfaces soaks it up before it reaches the mic.',
},
{
lead: 'Your room picks the set.',
text: 'Tap the room you’re treating and we’ll show you the set made for it.',
},
]}
pullLine='All three sets are 2-inch felt and go up in one afternoon.'
note={`Ships in 3 business days · ${defaults.sample.guarantee}`}
state={state}
onAction={() => {}}
/>
)
}
| Name | Type | Details |
|---|---|---|
picks RequiredProductSelector5 |
ProductSelector5Pick[] |
|
rooms OptionalProductSelector5 |
ProductSelector5Room[] |
|
defaultRoomId OptionalProductSelector5 |
string | null |
|
headline OptionalProductSelector5 |
string |
Default 'Find the right fit for your room'
|
headlineEmphasis OptionalProductSelector5 |
string |
|
intro OptionalProductSelector5 |
ProductSelector5Intro[] |
Default []
|
pullLine OptionalProductSelector5 |
string |
Default ''
|
roomsPrompt OptionalProductSelector5 |
string |
Default 'Which room are you treating?'
|
matchLabel OptionalProductSelector5 |
string |
Default 'Fits your {room}'
|
buttonLabel OptionalProductSelector5 |
string |
Default 'Yes! I want {name}'
|
subtotalLabel OptionalProductSelector5 |
string |
Default 'Subtotal'
|
totalLabel OptionalProductSelector5 |
string |
Default 'Total today'
|
receiptLabel OptionalProductSelector5 |
string |
Default 'Price for {name}'
|
note OptionalProductSelector5 |
string |
Default ''
|
announceLabel OptionalProductSelector5 |
string |
Default 'Showing {fit}: {name}'
|
disabledNote OptionalProductSelector5 |
string |
Default 'Ordering is unavailable right now.'
|
disabled OptionalProductSelector5 |
boolean |
Default false
|
state OptionalProductSelector5 |
ProductSelector5State |
Default 'default'
|
onSelect OptionalProductSelector5 |
(pick: ProductSelector5Pick, room: ProductSelector5Room | null) => void |
|
onAction OptionalProductSelector5 |
(pick: ProductSelector5Pick) => void |
|
className OptionalProductSelector5 |
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-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
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.
-
1049e894fb4a2c3a.webp
image/webp · 30.5 KB
-
2378512545fc73b6.webp
image/webp · 75.6 KB
-
5c2c6300653b085d.webp
image/webp · 126 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB