Product Selector 4
Local-service package chooser: a full-bleed photo of the work with the selector card breaking its lower edge. Choosing a package swaps the photo to that package’s finish and puts its name and price on the book button.
Use it in a prompt
Use offer/product-selector-4 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-4.tsx. - Import it and pass your copy and images (Props tab):
import { ProductSelector4 } from "@/components/funneldna/offer/product-selector-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-selector-4/component.tsx 499 lines
// layout: photo-overlap-card
// Local-service package chooser: a full-bleed photo of the work with the selector card breaking its lower edge. Choosing a package swaps the photo to that package’s finish and puts its name and price on the book button.
import * as React from 'react'
import { AlertCircle, Check, ShoppingCart } from 'lucide-react'
export type ProductSelector4Package = {
id: string
name: string
/** Short line under the name in the selector, e.g. Inside & out. */
summary?: string
/** Supplied price, shown exactly as written (e.g. $189). */
price: string
/** The value said in words beside the big price. Empty hides it. */
priceWords?: string
/** Benefit headline above the included list. */
promise?: string
/** What the package includes, as short tick lines. */
includes: string[]
/** Supplied flag such as Most booked. Shown only when given; the tagged package is preselected. */
tag?: string
/** Result photo for this package; fills the band (object-fit: cover). */
image: string
imageAlt?: string
/** CSS object-position for this photo, e.g. center 40%. */
imagePosition?: string
}
export type ProductSelector4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ProductSelector4Props = {
/** 2 to 4 packages, shown good-better-best in this order. */
packages: ProductSelector4Package[]
/** Preselected package id. Defaults to the tagged package, else the first; pass null for none. */
defaultSelectedId?: string | null
headline?: string
/** One phrase inside the headline set in the accent colour. */
headlineEmphasis?: string
subhead?: string
/** Screen-reader label for the package group. */
legend?: string
/** Word before the big price, e.g. Just. Empty hides it. */
pricePrefix?: string
/** Button label; {name} and {price} are replaced with the chosen package. */
buttonLabel?: string
/** Button label while no package is chosen. */
emptyButtonLabel?: string
/** Shown in place of the included list while no package is chosen. */
emptyPrompt?: string
errorMessage?: string
/** Lead-in for the line under the button. */
psLabel?: string
/** Line under the button restating the main benefit or the supplied guarantee. Empty hides it. */
ps?: React.ReactNode
disabledNote?: string
disabled?: boolean
inputName?: string
/** Studio/demo state driver. */
state?: ProductSelector4State
onSelect?: (pkg: ProductSelector4Package) => void
/** Receives the chosen package on submit. Never sends data by itself. */
onSubmit?: (pkg: ProductSelector4Package) => void
className?: string
}
export function ProductSelector4({
packages,
defaultSelectedId,
headline = 'Choose the package that fits',
headlineEmphasis,
subhead = 'Tap a package to see the finish and everything that’s included.',
legend = 'Choose a package',
pricePrefix = 'Just',
buttonLabel = 'Add {name} To Cart · {price}',
emptyButtonLabel = 'Add To Cart',
emptyPrompt = 'Choose a package above to see what’s included and the price.',
errorMessage = 'Choose a package above, then tap the button.',
psLabel = 'P.S.',
ps = '',
disabledNote = 'Booking is unavailable right now.',
disabled = false,
inputName,
state = 'default',
onSelect,
onSubmit,
className = '',
}: ProductSelector4Props) {
const list = (packages ?? []).slice(0, 4)
const uid = React.useId().replace(/[^a-zA-Z0-9]/g, '')
const group = inputName ?? `ps4-${uid}`
const titleId = `ps4-title-${uid}`
const errId = `ps4-err-${uid}`
const noteId = `ps4-note-${uid}`
const featuredIndex = list.findIndex((p) => Boolean(p.tag))
const firstId =
defaultSelectedId === undefined ? (list[featuredIndex] ?? list[0])?.id ?? null : 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 selectedIndex = list.findIndex((p) => p.id === selectedId)
const selected = selectedIndex >= 0 ? list[selectedIndex] : null
const photoIndex = selectedIndex >= 0 ? selectedIndex : Math.max(featuredIndex, 0)
const force = state === 'hover' || state === 'active' ? state : undefined
const demoHoverId = state === 'hover' ? list.find((p) => p.id !== selectedId)?.id : undefined
const cols = list.length === 4 ? 2 : list.length
const describedBy = [error ? errId : '', isDisabled ? noteId : ''].filter(Boolean).join(' ') || undefined
const choose = (pkg: ProductSelector4Package) => {
if (isDisabled) return
setSelectedId(pkg.id)
if (error) setError(false)
onSelect?.(pkg)
}
const submit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled) return
if (!selected) {
setError(true)
return
}
onSubmit?.(selected)
}
return (
<section
className={`cf-product-selector-4 ${className}`.trim()}
aria-labelledby={titleId}
data-force={force}
data-error={error ? 'true' : 'false'}
data-disabled={isDisabled ? 'true' : 'false'}
>
<style>{CSS}</style>
<div className='ps4-photo'>
{list.map((pkg, i) => {
const on = i === photoIndex
return (
<img
key={pkg.id}
className='ps4-shot'
src={pkg.image}
alt={on ? pkg.imageAlt ?? '' : ''}
aria-hidden={on ? undefined : true}
data-on={on ? 'true' : 'false'}
width={1600}
height={900}
decoding='async'
draggable={false}
style={{ '--ps4-pos': pkg.imagePosition ?? 'center 42%' } as React.CSSProperties}
/>
)
})}
</div>
<div className='ps4-wrap'>
<form className='ps4-card' onSubmit={submit} noValidate aria-labelledby={titleId}>
<div className='ps4-choose'>
<h2 id={titleId} className='ps4-title'>
<Headline text={headline} emphasis={headlineEmphasis} />
</h2>
{subhead ? <p className='ps4-sub'>{subhead}</p> : null}
<fieldset className='ps4-fieldset' disabled={isDisabled} aria-describedby={error ? errId : undefined}>
<legend className='ps4-sr'>{legend}</legend>
<div
className='ps4-segs'
data-tagged={featuredIndex >= 0 ? 'true' : 'false'}
style={{ '--ps4-cols': cols } as React.CSSProperties}
>
{list.map((pkg) => {
const on = pkg.id === selectedId
return (
<label
key={pkg.id}
className='ps4-seg'
data-selected={on ? 'true' : 'false'}
data-hover={pkg.id === demoHoverId ? 'true' : undefined}
>
<input
className='ps4-input ps4-sr'
type='radio'
name={group}
value={pkg.id}
checked={on}
onChange={() => choose(pkg)}
/>
<span className='ps4-thumb' aria-hidden='true'>
<img
src={pkg.image}
alt=''
width={320}
height={200}
loading='lazy'
decoding='async'
draggable={false}
style={{ objectPosition: pkg.imagePosition ?? 'center 42%' }}
/>
</span>
<span className='ps4-seg-text'>
{pkg.tag ? <span className='ps4-tag'>{pkg.tag}</span> : null}
<span className='ps4-seg-name'>{pkg.name}</span>
{pkg.summary ? <span className='ps4-seg-sum'>{pkg.summary}</span> : null}
</span>
<span className='ps4-seg-price'>{pkg.price}</span>
<span className='ps4-dot' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
</label>
)
})}
</div>
</fieldset>
{error ? (
<p id={errId} className='ps4-error' role='alert'>
<AlertCircle size={18} strokeWidth={2.5} aria-hidden='true' />
{errorMessage}
</p>
) : null}
</div>
<div className='ps4-decide'>
{selected ? (
<div key={selected.id} className='ps4-detail'>
{selected.promise ? <h3 className='ps4-promise'>{selected.promise}</h3> : null}
{selected.includes.length > 0 ? (
<ul className='ps4-list'>
{selected.includes.map((line, i) => (
<li key={`${selected.id}-${i}`} style={{ '--i': i } as React.CSSProperties}>
<span className='ps4-tick' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span>{line}</span>
</li>
))}
</ul>
) : null}
</div>
) : (
<p className='ps4-empty'>{emptyPrompt}</p>
)}
<div className='ps4-price' aria-live='polite' aria-atomic='true'>
{selected ? (
<>
<p className='ps4-just'>
{pricePrefix ? <span className='ps4-just-word'>{pricePrefix}</span> : null}
<span className='ps4-just-num'>{selected.price}</span>
</p>
{selected.priceWords ? <p className='ps4-words'>{selected.priceWords}</p> : null}
</>
) : null}
</div>
<button type='submit' className='ps4-btn' disabled={isDisabled} aria-describedby={describedBy}>
<span className='ps4-btn-label'>
<ShoppingCart className='ps4-btn-icon' size={20} strokeWidth={2.5} aria-hidden='true' />
{selected ? <ButtonLabel template={buttonLabel} pkg={selected} /> : emptyButtonLabel}
</span>
</button>
{isDisabled ? (
<p id={noteId} className='ps4-note'>
{disabledNote}
</p>
) : null}
{ps ? (
<p className='ps4-ps'>
{psLabel ? <strong>{psLabel}</strong> : null} {ps}
</p>
) : null}
</div>
</form>
</div>
</section>
)
}
export default ProductSelector4
const fill = (template: string, pkg: ProductSelector4Package) => template.split('{name}').join(pkg.name)
function ButtonLabel({ template, pkg }: { template: string; pkg: ProductSelector4Package }) {
const parts = template.split('{price}')
return (
<>
{parts.map((part, i) => (
<React.Fragment key={i}>
{fill(part, pkg)}
{i < parts.length - 1 ? <span className='ps4-btn-price'>{pkg.price}</span> : null}
</React.Fragment>
))}
</>
)
}
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='ps4-em'>{emphasis}</span>
{text.slice(at + emphasis.length)}
</>
)
}
const CSS = `
.cf-product-selector-4{
--ps4-gutter:clamp(16px,5vw,48px);
--ps4-photo-h:clamp(360px,44vw,620px);
--ps4-overlap:clamp(120px,15vw,232px);
--ps4-ease:cubic-bezier(.2,.7,.2,1);
--ps4-shadow:var(--shadow,oklch(0.22 0.03 260));
--ps4-ring:oklch(from var(--field-focus,var(--accent)) l c h / .5);
position:relative;isolation:isolate;overflow-x:clip;
padding-bottom:clamp(64px,8.5vw,120px);
background:var(--surface);color:var(--ink);
font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;
}
.cf-product-selector-4 *,.cf-product-selector-4 *::before,.cf-product-selector-4 *::after{box-sizing:border-box}
.cf-product-selector-4 :where(h2,h3,p,ul,li,fieldset,legend){margin:0;padding:0}
.cf-product-selector-4 .ps4-fieldset{border:0;min-width:0}
.cf-product-selector-4 .ps4-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
/* the photo of the work: every package photo stacked, the chosen one shown */
.cf-product-selector-4 .ps4-photo{position:relative;z-index:0;height:var(--ps4-photo-h);overflow:hidden;background:var(--band)}
.cf-product-selector-4 .ps4-shot{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:var(--ps4-pos,center 42%);opacity:0}
.cf-product-selector-4 .ps4-shot[data-on=true]{opacity:1}
.cf-product-selector-4 .ps4-photo::after{content:'';position:absolute;inset:0;pointer-events:none;
background:linear-gradient(180deg,oklch(from var(--band) l c h / 0) 52%,oklch(from var(--band) l c h / .4) 100%)}
/* the card breaking the photo's lower edge */
.cf-product-selector-4 .ps4-wrap{position:relative;z-index:1;max-width:calc(1120px + 2 * var(--ps4-gutter));margin:calc(-1 * var(--ps4-overlap)) auto 0;padding-inline:var(--ps4-gutter)}
.cf-product-selector-4 .ps4-card{
display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:clamp(32px,4.5vw,56px);align-items:start;
padding:clamp(20px,3.2vw,44px);
background:var(--card);color:var(--ink);
border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));
border-radius:var(--card-radius,var(--radius,14px));
box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--ps4-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--ps4-shadow) l c h / .32)));
}
.cf-product-selector-4 .ps4-choose,.cf-product-selector-4 .ps4-decide{min-width:0}
.cf-product-selector-4 .ps4-title{
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;text-wrap:balance;color:var(--ink);
}
.cf-product-selector-4 .ps4-em{color:var(--accent)}
.cf-product-selector-4 .ps4-sub{margin-top:16px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
/* segmented good-better-best choice */
.cf-product-selector-4 .ps4-segs{
display:grid;grid-template-columns:repeat(var(--ps4-cols,3),minmax(0,1fr));gap:8px;
margin-top:28px;padding:8px;border-radius:calc(var(--radius,12px) + 4px);
background:color-mix(in oklch,var(--ink) 5%,var(--card));
}
.cf-product-selector-4 .ps4-segs[data-tagged=true]{padding-top:18px;row-gap:20px}
.cf-product-selector-4 .ps4-seg{
position:relative;display:grid;
grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto 1fr auto;
grid-template-areas:'thumb thumb' 'text text' 'price dot';
row-gap:14px;column-gap:10px;padding:10px 10px 16px;
border:1.5px solid transparent;border-radius:var(--radius,12px);
color:var(--ink);cursor:pointer;-webkit-tap-highlight-color:transparent;
}
.cf-product-selector-4 .ps4-seg:hover,.cf-product-selector-4 .ps4-seg[data-hover=true]{background:color-mix(in oklch,var(--ink) 9%,var(--card))}
.cf-product-selector-4 .ps4-seg[data-selected=true]{
background:color-mix(in oklch,var(--accent) 10%,var(--card));
border-color:oklch(from var(--accent) l c h / .7);
box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--ps4-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--ps4-shadow) l c h / .2));
transform:translateY(-2px);
}
.cf-product-selector-4 .ps4-seg:has(.ps4-input:focus-visible){outline:3px solid var(--ps4-ring);outline-offset:2px}
.cf-product-selector-4 .ps4-thumb{grid-area:thumb;display:block;aspect-ratio:16/10;overflow:hidden;border-radius:8px;background:var(--band)}
.cf-product-selector-4 .ps4-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.cf-product-selector-4 .ps4-seg-text{grid-area:text;display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
.cf-product-selector-4 .ps4-seg-text,.cf-product-selector-4 .ps4-seg-price,.cf-product-selector-4 .ps4-dot{margin-inline:6px}
.cf-product-selector-4 .ps4-seg-name{max-width:100%;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.15;letter-spacing:-.01em;overflow-wrap:break-word;text-wrap:balance}
.cf-product-selector-4 .ps4-seg-sum{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-product-selector-4 .ps4-seg-price{grid-area:price;align-self:end;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-product-selector-4 .ps4-dot{
grid-area:dot;align-self:end;justify-self:end;display:inline-grid;place-items:center;
width:24px;height:24px;border-radius:999px;
border:2px solid oklch(from var(--ink) l c h / .45);color:transparent;
}
.cf-product-selector-4 .ps4-seg[data-selected=true] .ps4-dot{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-product-selector-4 .ps4-tag{
position:absolute;top:-14px;left:14px;z-index:1;
display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;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;white-space:nowrap;
box-shadow:var(--shadow-sm,0 1px 1px oklch(from var(--ps4-shadow) l c h / .18),0 1px 3px oklch(from var(--ps4-shadow) l c h / .14));
}
.cf-product-selector-4 .ps4-fieldset:disabled .ps4-seg{cursor:not-allowed;opacity:.6}
.cf-product-selector-4 .ps4-fieldset:disabled .ps4-seg:not([data-selected=true]):hover{background:transparent}
.cf-product-selector-4[data-error=true] .ps4-segs{box-shadow:inset 0 0 0 2px var(--danger)}
.cf-product-selector-4 .ps4-error{margin-top:12px;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-product-selector-4 .ps4-error svg{display:inline-block;vertical-align:-.18em;margin-inline-end:.4em}
/* the decision: what you get, the price, the action */
.cf-product-selector-4 .ps4-decide{display:flex;flex-direction:column;container-type:inline-size}
.cf-product-selector-4 .ps4-promise{margin-bottom:16px;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:-.01em;text-wrap:balance}
.cf-product-selector-4 .ps4-list{list-style:none;display:grid;gap:12px}
.cf-product-selector-4 .ps4-list li{display:grid;grid-template-columns:24px minmax(0,1fr);column-gap:12px;align-items:start;line-height:1.45;text-wrap:pretty}
.cf-product-selector-4 .ps4-tick{display:inline-grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:999px;background:var(--success);color:var(--card)}
.cf-product-selector-4 .ps4-empty{padding:20px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));color:var(--ink);font-weight:500;line-height:1.45;text-wrap:pretty}
.cf-product-selector-4 .ps4-price{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin-top:28px}
.cf-product-selector-4 .ps4-price:empty{margin-top:0}
.cf-product-selector-4 .ps4-just{display:inline-flex;align-items:baseline;gap:.3em;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);line-height:1;white-space:nowrap;color:var(--ink)}
.cf-product-selector-4 .ps4-just-word{font-size:clamp(1.3125rem,1.8vw,1.625rem);letter-spacing:-.01em}
.cf-product-selector-4 .ps4-just-num{font-size:clamp(2.5rem,4.2vw,3.75rem);letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.cf-product-selector-4 .ps4-words{flex:1 1 11ch;min-width:0;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-product-selector-4 .ps4-btn{
--ps4-b:var(--button-bg,var(--cta));
--ps4-b2:var(--button-bg-2,var(--cta-2,var(--cta)));
display:flex;align-items:center;justify-content:center;gap:10px;width:100%;
min-height:64px;margin-top:20px;padding:10px 28px;border:0;
border-radius:var(--button-radius,var(--radius,12px));cursor:pointer;
font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);
text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;letter-spacing:-.005em;
color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);
background:linear-gradient(180deg,oklch(from var(--ps4-b) calc(l + .04) c h),oklch(from var(--ps4-b2) calc(l - .02) c h));
box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ps4-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ps4-b) calc(l - .16) c h),0 1px 2px oklch(from var(--ps4-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--ps4-shadow) l c h / .45));
-webkit-tap-highlight-color:transparent;
}
.cf-product-selector-4 .ps4-btn-label{min-width:0;text-align:center;text-wrap:balance}
.cf-product-selector-4 .ps4-btn-icon{display:inline-block;vertical-align:-.16em;margin-inline-end:.45em}
.cf-product-selector-4 .ps4-btn-price{white-space:nowrap;font-variant-numeric:tabular-nums}
.cf-product-selector-4 .ps4-btn:hover:not(:disabled),.cf-product-selector-4[data-force=hover] .ps4-btn:not(:disabled){
background:linear-gradient(180deg,oklch(from var(--ps4-b) calc(l - .01) c h),oklch(from var(--ps4-b2) calc(l - .07) c h));
box-shadow:inset 0 1px 0 oklch(from var(--ps4-b) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--ps4-b) calc(l - .2) c h),0 1px 2px oklch(from var(--ps4-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--ps4-shadow) l c h / .5);
}
.cf-product-selector-4 .ps4-btn:active:not(:disabled),.cf-product-selector-4[data-force=active] .ps4-btn:not(:disabled){
transform:translateY(1px);
background:linear-gradient(180deg,oklch(from var(--ps4-b) calc(l - .06) c h),oklch(from var(--ps4-b2) calc(l - .1) c h));
box-shadow:inset 0 2px 4px oklch(from var(--ps4-b) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--ps4-b) calc(l - .16) c h),0 1px 1px oklch(from var(--ps4-shadow) l c h / .3);
}
.cf-product-selector-4 .ps4-btn:focus-visible{outline:3px solid var(--ps4-ring);outline-offset:3px}
.cf-product-selector-4 .ps4-btn:disabled{cursor:not-allowed;transform:none;text-shadow:none;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:none}
.cf-product-selector-4 .ps4-note{margin-top:12px;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted)}
.cf-product-selector-4 .ps4-ps{margin-top:16px;color:var(--muted);line-height:1.5;text-wrap:pretty}
.cf-product-selector-4 .ps4-ps strong{color:var(--ink);font-weight:800}
@container (max-width:360px){
.cf-product-selector-4 .ps4-btn{padding-inline:16px;font-size:1.0625rem;letter-spacing:0}
.cf-product-selector-4 .ps4-btn-icon{display:none}
}
@media (max-width:959px){
.cf-product-selector-4 .ps4-card{grid-template-columns:minmax(0,1fr);gap:32px}
}
@media (max-width:640px){
.cf-product-selector-4{--ps4-photo-h:clamp(220px,60vw,320px);--ps4-overlap:32px}
.cf-product-selector-4 .ps4-btn{padding-inline:20px}
}
@media (max-width:560px){
.cf-product-selector-4 .ps4-segs{grid-template-columns:minmax(0,1fr)}
.cf-product-selector-4 .ps4-segs[data-tagged=true]{padding-top:6px;row-gap:6px}
.cf-product-selector-4 .ps4-seg{grid-template-columns:24px minmax(0,1fr) auto;grid-template-rows:auto;grid-template-areas:'dot text price';align-items:center;column-gap:14px;min-height:72px;padding:14px 16px}
.cf-product-selector-4 .ps4-thumb{display:none}
.cf-product-selector-4 .ps4-seg-text,.cf-product-selector-4 .ps4-seg-price,.cf-product-selector-4 .ps4-dot{margin-inline:0}
.cf-product-selector-4 .ps4-seg[data-selected=true]{transform:none}
.cf-product-selector-4 .ps4-dot,.cf-product-selector-4 .ps4-seg-price{align-self:center}
.cf-product-selector-4 .ps4-dot{justify-self:start}
.cf-product-selector-4 .ps4-tag{position:static;margin-bottom:6px;box-shadow:none}
}
@keyframes ps4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
.cf-product-selector-4 .ps4-card{animation:ps4-rise .45s var(--ps4-ease) both}
.cf-product-selector-4 .ps4-shot{transform:scale(1.04);transition:opacity .55s ease,transform 1.1s var(--ps4-ease)}
.cf-product-selector-4 .ps4-shot[data-on=true]{transform:scale(1)}
.cf-product-selector-4 .ps4-promise{animation:ps4-rise .45s var(--ps4-ease) both}
.cf-product-selector-4 .ps4-list li{animation:ps4-rise .45s var(--ps4-ease) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-product-selector-4 .ps4-seg{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.cf-product-selector-4 .ps4-thumb img{transition:transform .4s var(--ps4-ease)}
.cf-product-selector-4 .ps4-seg:hover .ps4-thumb img,.cf-product-selector-4 .ps4-seg[data-hover=true] .ps4-thumb img{transform:scale(1.04)}
.cf-product-selector-4 .ps4-fieldset:disabled .ps4-seg:hover .ps4-thumb img{transform:none}
.cf-product-selector-4 .ps4-dot{transition:background-color .16s ease,border-color .16s ease,color .16s ease}
.cf-product-selector-4 .ps4-btn{transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
}
@media (prefers-reduced-motion:reduce){
.cf-product-selector-4 *,.cf-product-selector-4 *::before,.cf-product-selector-4 *::after{animation:none;transition:none}
}
`
pieces/offer/product-selector-4/specimen.tsx 88 lines
import __studioImage6150f687 from "../assets/7acbff599a38e9e1.webp";
import __studioImage0abd8f1e from "../assets/e1cd6d43e958ba47.webp";
import __studioImage7908a074 from "../assets/e768a7d3dfa9c39a.webp";
// Specimen: Gleam Mobile Detailing (fictional) choosing Basic, Full Detail or Ceramic over a photo of the work.
import { ProductSelector4, type ProductSelector4State } from '../product-selector-4'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ProductSelector4Specimen({ state = 'default' }: { state?: ProductSelector4State }) {
return (
<ProductSelector4
state={state}
headline='Pick your shine. We bring it to your driveway.'
headlineEmphasis='to your driveway'
subhead='Gleam Mobile Detailing comes to you. Tap a package to see the finish and what’s included.'
legend='Choose your Gleam package'
buttonLabel='Book {name} · {price}'
emptyButtonLabel='Book My Detail'
ps='We bring our own water and power to your home or office. Pick your package now and choose your time at checkout.'
packages={[
{
id: 'basic',
name: 'Basic',
summary: 'Wash & vac',
price: '$89',
priceWords: 'A clean car without leaving home',
promise: 'A clean car by lunchtime',
includes: [
'Hand wash and dry',
'Wheels and tyres cleaned',
'Interior vacuum and wipe-down',
'Windows inside and out',
],
image: slot(
'item-1',
__studioImage6150f687
),
imageAlt: 'A detailer hand-washing a blue sedan covered in foam in a driveway',
imagePosition: 'center 38%',
},
{
id: 'full',
name: 'Full Detail',
summary: 'Inside & out',
price: '$189',
tag: 'Most booked',
priceWords: 'One visit, inside and out, at your door',
promise: 'Showroom clean, inside and out',
includes: [
'Everything in Basic',
'Clay bar and hand wax',
'Seats and carpets shampooed',
'Leather cleaned and conditioned',
'Door jambs and vents detailed',
],
image: slot(
'item-2',
__studioImage0abd8f1e
),
imageAlt: 'A detailer buffing a glossy blue sedan with its clean interior showing through the open door',
imagePosition: 'center 40%',
},
{
id: 'ceramic',
name: 'Ceramic',
summary: 'Paint coating',
price: '$449',
priceWords: 'One coat instead of waxing every month',
promise: 'Gloss that sheds water and road dirt',
includes: [
'Everything in Full Detail',
'One-step paint polish',
'Ceramic coating on paint and glass',
'Wheel faces coated',
'Cured on site before we leave',
],
image: slot(
'item-3',
__studioImage7908a074
),
imageAlt: 'Water beading on the mirror-gloss hood of a blue car after a ceramic coating',
imagePosition: 'center 45%',
},
]}
/>
)
}
| Name | Type | Details |
|---|---|---|
packages RequiredProductSelector4 |
ProductSelector4Package[] |
|
defaultSelectedId OptionalProductSelector4 |
string | null |
|
headline OptionalProductSelector4 |
string |
Default 'Choose the package that fits'
|
headlineEmphasis OptionalProductSelector4 |
string |
|
subhead OptionalProductSelector4 |
string |
Default 'Tap a package to see the finish and everything that’s included.'
|
legend OptionalProductSelector4 |
string |
Default 'Choose a package'
|
pricePrefix OptionalProductSelector4 |
string |
Default 'Just'
|
buttonLabel OptionalProductSelector4 |
string |
Default 'Add {name} To Cart · {price}'
|
emptyButtonLabel OptionalProductSelector4 |
string |
Default 'Add To Cart'
|
emptyPrompt OptionalProductSelector4 |
string |
Default 'Choose a package above to see what’s included and the price.'
|
errorMessage OptionalProductSelector4 |
string |
Default 'Choose a package above, then tap the button.'
|
psLabel OptionalProductSelector4 |
string |
Default 'P.S.'
|
ps OptionalProductSelector4 |
React.ReactNode |
Default ''
|
disabledNote OptionalProductSelector4 |
string |
Default 'Booking is unavailable right now.'
|
disabled OptionalProductSelector4 |
boolean |
Default false
|
inputName OptionalProductSelector4 |
string |
|
state OptionalProductSelector4 |
ProductSelector4State |
Default 'default'
|
onSelect OptionalProductSelector4 |
(pkg: ProductSelector4Package) => void |
|
onSubmit OptionalProductSelector4 |
(pkg: ProductSelector4Package) => void |
|
className OptionalProductSelector4 |
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- 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.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
7acbff599a38e9e1.webp
image/webp · 103 KB
-
e1cd6d43e958ba47.webp
image/webp · 110 KB
-
e768a7d3dfa9c39a.webp
image/webp · 112 KB