Product Buy Box 4
Dark-stage buy box for a technical product. The buyer checks that their own devices fit with a live run-time estimate, and the path ends at a risk-first buy button.
Use it in a prompt
Use offer/product-buy-box-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-buy-box-4.tsx. - Import it and pass your copy and images (Props tab):
import { ProductBuyBox4 } from "@/components/funneldna/offer/product-buy-box-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-buy-box-4/component.tsx 639 lines
// layout: path-to-action
// Dark-stage buy box for a technical product. The buyer checks that their own devices fit with a live run-time estimate, and the path ends at a risk-first buy button.
'use client'
import * as React from 'react'
import {
Check,
Coffee,
CookingPot,
Drill,
Fan,
Flame,
Laptop,
Lightbulb,
Lock,
Microwave,
Plug,
Refrigerator,
Router,
ShieldCheck,
Smartphone,
Tv,
Wind,
X,
} from 'lucide-react'
import { FX_HOST, Glow, Pattern } from '../fx/fx'
export type PowerDeviceIcon =
| 'fridge'
| 'cpap'
| 'laptop'
| 'phone'
| 'tv'
| 'light'
| 'fan'
| 'router'
| 'coffee'
| 'kettle'
| 'microwave'
| 'heater'
| 'tool'
| 'plug'
export type PowerDevice = {
id: string
name: string
/** Running watts used for the estimate (a supplied figure). */
watts: number
icon?: PowerDeviceIcon
}
export type ProductSpec = { label: string; value: string; unit?: string }
/** A short paragraph that opens with a bold lead-in phrase. */
export type LeadIn = { lead: string; text: string }
export type ProductBuyBox4State = 'default' | 'hover' | 'active' | 'disabled'
export type ProductBuyBox4Fit = { devices: string[]; totalWatts: number; runs: boolean }
export type ProductBuyBox4Copy = {
/** Accessible name of the device chip group. */
devicesLabel: string
empty: string
emptyDetail: string
/** One device fits. */
yesOne: string
/** {count} devices fit together. */
yesMany: string
no: string
/** {total}, {max} and {over} are wattages. */
noDetail: string
runtimeLabel: string
/** Screen-reader word read in place of the approximate sign. */
approx: string
/** {total} and {max} */
load: string
/** {total} */
loadNoMax: string
estimateLead: string
/** {capacity}, {usable} and {total} */
estimateFormula: string
/** {capacity} and {total}, used when usablePercent is not supplied. */
estimateFormulaRaw: string
estimateCaveat: string
minute: string
minutes: string
hour: string
hours: string
days: string
watt: string
wattHour: string
disabledNote: string
}
export type ProductBuyBox4Props = {
/** Product name, the block headline. */
name: string
/** One short benefit line under the name. */
benefit?: React.ReactNode
/** Product cut-out on a transparent background (product slot). */
productImage?: string
productImageAlt?: string
/** Supplied specs. An empty list hides the spec stop. */
specs?: ProductSpec[]
specsTitle?: string
specsIntro?: LeadIn
/** Devices the buyer can check. An empty list hides the checker stop. */
devices?: PowerDevice[]
/** Device ids selected on load. */
defaultSelected?: string[]
/** Battery capacity in watt-hours (supplied), used for the run-time estimate. */
capacityWh: number
/** Usable share of capacity after conversion losses (supplied). Omit to estimate from raw capacity. */
usablePercent?: number
/** Continuous output limit in watts (supplied). A total above it answers no. */
maxOutputW?: number
checkerTitle?: string
checkerIntro?: LeadIn
/** Heading of the last stop, above the price card. */
actionTitle?: string
/** Risk reversal that leads the price card. */
guarantee?: LeadIn
price: string
/** Line beside the price, e.g. "today. That’s it." */
priceSuffix?: string
priceNote?: string
/** Shown only when supplied. */
financing?: string
label?: string
/** Repeat the price on the phone sticky button. */
showPriceOnDock?: boolean
/** Short reassurance lines under the button. */
reassurance?: string[]
disabled?: boolean
state?: ProductBuyBox4State
copy?: Partial<ProductBuyBox4Copy>
/** Called with the checked devices when the buy button is pressed. */
onAction?: (fit: ProductBuyBox4Fit) => void
/** Where the button goes when there is no onAction. */
href?: string
className?: string
}
const DEFAULT_COPY: ProductBuyBox4Copy = {
devicesLabel: 'Devices to check',
empty: 'Tap what you’d plug in.',
emptyDetail: 'Your estimated run time shows here as you add devices.',
yesOne: 'Yes. It runs that.',
yesMany: 'Yes. It runs all {count} at once.',
no: 'Not all at once.',
noDetail: 'That’s {total} together. It powers up to {max} at once, so drop {over} and check again.',
runtimeLabel: 'Estimated run time',
approx: 'about',
load: 'Load {total} of {max}',
loadNoMax: 'Total load {total}',
estimateLead: 'Estimate:',
estimateFormula: '{capacity} × {usable} usable ÷ {total}.',
estimateFormulaRaw: '{capacity} ÷ {total}.',
estimateCaveat: 'Real run time changes with temperature, settings and how often devices cycle.',
minute: 'minute',
minutes: 'minutes',
hour: 'hour',
hours: 'hours',
days: 'days',
watt: 'W',
wattHour: 'Wh',
disabledNote: 'This product isn’t available to order right now.',
}
const ICONS: Record<PowerDeviceIcon, typeof Plug> = {
fridge: Refrigerator,
cpap: Wind,
laptop: Laptop,
phone: Smartphone,
tv: Tv,
light: Lightbulb,
fan: Fan,
router: Router,
coffee: Coffee,
kettle: CookingPot,
microwave: Microwave,
heater: Flame,
tool: Drill,
plug: Plug,
}
type StopKey = 'specs' | 'checker' | 'action'
type Verdict = 'empty' | 'yes' | 'no'
export function ProductBuyBox4({
name,
benefit,
productImage,
productImageAlt = '',
specs = [],
specsTitle = 'Every spec, in plain numbers',
specsIntro,
devices = [],
defaultSelected = [],
capacityWh,
usablePercent,
maxOutputW,
checkerTitle = 'Will it run what you need?',
checkerIntro,
actionTitle = 'Get yours today',
guarantee,
price,
priceSuffix,
priceNote,
financing,
label = 'Order Now',
showPriceOnDock = true,
reassurance = [],
disabled = false,
state = 'default',
copy,
onAction,
href,
className = '',
}: ProductBuyBox4Props) {
const t = { ...DEFAULT_COPY, ...copy }
const [selected, setSelected] = React.useState<string[]>(() =>
defaultSelected.filter((id) => devices.some((d) => d.id === id))
)
const isDisabled = disabled || state === 'disabled'
const force = state === 'hover' || state === 'active' ? state : undefined
const chosen = devices.filter((d) => selected.includes(d.id))
const total = chosen.reduce((sum, d) => sum + Math.max(0, d.watts), 0)
const usable = usablePercent != null ? clampNum(usablePercent, 1, 100) / 100 : 1
const hasMax = maxOutputW != null && maxOutputW > 0
const max = hasMax ? (maxOutputW as number) : 0
const verdict: Verdict = chosen.length === 0 || total <= 0 ? 'empty' : hasMax && total > max ? 'no' : 'yes'
const runtime = verdict === 'yes' ? runtimeParts((capacityWh * usable) / total, t) : null
const loadPct = hasMax ? Math.min(100, (total / max) * 100) : 0
const watts = (n: number) => `${fmt(n)} ${t.watt}`
const hasSpecs = specs.length > 0
const hasChecker = devices.length > 0
const stops: StopKey[] = [
...(hasSpecs ? (['specs'] as StopKey[]) : []),
...(hasChecker ? (['checker'] as StopKey[]) : []),
'action',
]
const reached = (k: StopKey) =>
k === 'specs' ? true : k === 'checker' ? !hasSpecs || chosen.length > 0 : !hasChecker || verdict === 'yes'
const titles: Record<StopKey, string> = { specs: specsTitle, checker: checkerTitle, action: actionTitle }
function toggle(id: string) {
setSelected((cur) => (cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id]))
}
function act() {
if (isDisabled) return
const fit = { devices: chosen.map((d) => d.id), totalWatts: total, runs: verdict === 'yes' }
if (onAction) onAction(fit)
else if (href) window.location.assign(href)
}
const verdictText =
verdict === 'empty'
? t.empty
: verdict === 'no'
? t.no
: chosen.length === 1
? t.yesOne
: fill(t.yesMany, { count: String(chosen.length) })
const formula =
usablePercent != null
? fill(t.estimateFormula, {
capacity: `${fmt(capacityWh)} ${t.wattHour}`,
usable: `${fmt(usable * 100)}%`,
total: watts(total),
})
: fill(t.estimateFormulaRaw, { capacity: `${fmt(capacityWh)} ${t.wattHour}`, total: watts(total) })
const button = (variant: 'card' | 'dock') => (
<button type='button' className={`pbb4-btn pbb4-btn--${variant}`} disabled={isDisabled} onClick={act}>
<span>{label}</span>
{variant === 'dock' && showPriceOnDock ? (
<>
<span className='pbb4-btn-sep' aria-hidden='true'>
·
</span>
<span className='pbb4-btn-price'>{price}</span>
</>
) : null}
</button>
)
const specsBody = (
<>
{specsIntro ? (
<p className='pbb4-intro'>
<strong>{specsIntro.lead}</strong> {specsIntro.text}
</p>
) : null}
<dl className='pbb4-specs'>
{specs.map((s, i) => (
<div className='pbb4-spec' key={`${s.label}-${i}`}>
<dt>{s.label}</dt>
<dd>
{s.value}
{s.unit ? <span className='pbb4-unit'>{s.unit}</span> : null}
</dd>
</div>
))}
</dl>
</>
)
const checkerBody = (
<>
{checkerIntro ? (
<p className='pbb4-intro'>
<strong>{checkerIntro.lead}</strong> {checkerIntro.text}
</p>
) : null}
<ul className='pbb4-chips' aria-label={t.devicesLabel}>
{devices.map((d) => {
const on = selected.includes(d.id)
const Icon = on ? Check : ICONS[d.icon ?? 'plug']
return (
<li key={d.id}>
<button type='button' className='pbb4-chip' aria-pressed={on} onClick={() => toggle(d.id)}>
<Icon size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{d.name}</span>
<span className='pbb4-chip-w'>{watts(d.watts)}</span>
</button>
</li>
)
})}
</ul>
<div className='pbb4-readout' data-verdict={verdict}>
<div role='status' aria-live='polite' aria-atomic='true'>
<div key={`${verdict}-${total}`} className='pbb4-live'>
<p className='pbb4-verdict'>
<span className='pbb4-badge' data-tone={verdict}>
{verdict === 'yes' ? (
<Check size={18} strokeWidth={3} aria-hidden='true' />
) : verdict === 'no' ? (
<X size={18} strokeWidth={3} aria-hidden='true' />
) : (
<Plug size={18} strokeWidth={2.5} aria-hidden='true' />
)}
</span>
<span>{verdictText}</span>
</p>
{runtime ? (
<p className='pbb4-figure'>
<span className='pbb4-figcap'>{t.runtimeLabel}</span>
<span className='pbb4-big'>
<span aria-hidden='true'>≈</span>
<span className='pbb4-sr'>{t.approx} </span>
{runtime.value}
</span>
<span className='pbb4-big-unit'>{runtime.unit}</span>
</p>
) : (
<p className='pbb4-detail'>
{verdict === 'no'
? fill(t.noDetail, { total: watts(total), max: watts(max), over: watts(total - max) })
: t.emptyDetail}
</p>
)}
</div>
</div>
<div className='pbb4-meter'>
{hasMax ? (
<div className='pbb4-gauge' aria-hidden='true'>
<span className='pbb4-gauge-fill' style={{ width: `${loadPct}%` }} />
</div>
) : null}
<p className='pbb4-load'>
{hasMax ? fill(t.load, { total: watts(total), max: watts(max) }) : fill(t.loadNoMax, { total: watts(total) })}
</p>
</div>
{runtime ? (
<p className='pbb4-note'>
<strong>{t.estimateLead}</strong> {formula} {t.estimateCaveat}
</p>
) : null}
</div>
</>
)
const actionBody = (
<div className='pbb4-card'>
{guarantee ? (
<p className='pbb4-risk'>
<strong>{guarantee.lead}</strong> {guarantee.text}
</p>
) : null}
<p className='pbb4-price'>
<span className='pbb4-price-num'>{price}</span>
{priceSuffix ? <span className='pbb4-price-suffix'>{priceSuffix}</span> : null}
</p>
{priceNote ? <p className='pbb4-price-note'>{priceNote}</p> : null}
{financing ? <p className='pbb4-financing'>{financing}</p> : null}
{isDisabled ? <p className='pbb4-off'>{t.disabledNote}</p> : null}
{button('card')}
{reassurance.length ? (
<p className='pbb4-assure'>
{reassurance.map((line, i) => {
const Icon = i === 0 ? ShieldCheck : Lock
return (
<span className='pbb4-assure-item' key={`${line}-${i}`}>
<Icon size={16} strokeWidth={2.5} aria-hidden='true' />
{line}
</span>
)
})}
</p>
) : null}
</div>
)
return (
<section className={`cf-product-buy-box-4 ${className}`.trim()} data-force={force}>
<style>{CSS}</style>
<div
aria-hidden='true'
style={{ ...FX_HOST, position: 'absolute', inset: 0, overflow: 'hidden', pointerEvents: 'none', zIndex: 0 }}
>
<Pattern name='grid' fade='edges' />
<div className='pbb4-glow'>
<Glow />
</div>
</div>
<div className='pbb4-inner'>
<header className='pbb4-head' data-image={productImage ? 'true' : undefined}>
<div className='pbb4-head-copy'>
<h2 className='pbb4-name'>{name}</h2>
{benefit ? <p className='pbb4-lead'>{benefit}</p> : null}
</div>
{productImage ? (
<div className='pbb4-product'>
<img src={productImage} alt={productImageAlt} width={840} height={640} decoding='async' />
</div>
) : null}
</header>
<ol className='pbb4-path' data-stops={String(stops.length)}>
{stops.map((k, i) => {
const next = stops[i + 1]
return (
<li key={k} className={`pbb4-stop pbb4-stop--${k}`} data-reached={reached(k) ? 'true' : undefined}>
<div className='pbb4-rail' aria-hidden='true'>
<span className='pbb4-node' />
{next ? (
<span className='pbb4-seg' data-lit={reached(next) ? 'true' : undefined}>
<span className='pbb4-seg-fill' />
</span>
) : null}
</div>
<h3 className='pbb4-stop-title'>
<span className='pbb4-num' aria-hidden='true'>
{i + 1}
</span>
<span>{titles[k]}</span>
</h3>
{k === 'specs' ? specsBody : k === 'checker' ? checkerBody : actionBody}
</li>
)
})}
</ol>
<div className='pbb4-dock'>{button('dock')}</div>
</div>
</section>
)
}
export default ProductBuyBox4
const NF = new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 })
function fmt(n: number) {
return NF.format(n)
}
function clampNum(n: number, lo: number, hi: number) {
return Math.min(Math.max(n, lo), hi)
}
function fill(template: string, values: Record<string, string>) {
let out = template
for (const key of Object.keys(values)) out = out.split('{' + key + '}').join(values[key])
return out
}
function runtimeParts(h: number, t: ProductBuyBox4Copy): { value: string; unit: string } {
if (h < 1) {
const m = Math.max(1, Math.round(h * 60))
return { value: String(m), unit: m === 1 ? t.minute : t.minutes }
}
if (h < 10) return { value: (Math.round(h * 10) / 10).toFixed(1), unit: t.hours }
if (h < 48) {
const v = Math.round(h)
return { value: String(v), unit: v === 1 ? t.hour : t.hours }
}
return { value: (Math.round((h / 24) * 10) / 10).toFixed(1), unit: t.days }
}
const R = '.cf-product-buy-box-4'
const CSS = `
${R}{--pbb4-gutter:clamp(16px,5vw,48px);--pbb4-gap:clamp(32px,3.4vw,44px);--pbb4-soft:color-mix(in oklch,var(--band-ink) 78%,var(--band));--pbb4-line:oklch(from var(--band-ink) l c h / .16);--pbb4-shadow:var(--shadow,oklch(.22 .03 260));position:relative;isolation:isolate;overflow:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--pbb4-gutter) 0}
@media (min-width:65rem){${R}{padding-bottom:clamp(64px,8.5vw,120px)}}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .pbb4-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .pbb4-glow{position:absolute;top:0;right:0;width:min(70%,760px);height:min(60%,620px)}
${R} .pbb4-inner{position:relative;z-index:1;max-width:1120px;margin:0 auto}
${R} .pbb4-head{display:grid;gap:24px;margin:0 0 clamp(40px,5vw,64px);animation:pbb4-rise .45s cubic-bezier(.2,.7,.2,1) both}
@media (min-width:65rem){${R} .pbb4-head[data-image]{grid-template-columns:minmax(0,1fr) minmax(0,26rem);gap:clamp(32px,5vw,72px);align-items:start}}
${R} .pbb4-head-copy{min-width:0}
@media (min-width:65rem){${R} .pbb4-head-copy{padding-top:24px}}
${R} .pbb4-name{margin:0 0 16px;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--band-ink)}
${R} .pbb4-lead{margin:0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--pbb4-soft);text-wrap:pretty}
${R} .pbb4-product{display:flex;justify-content:center;min-width:0}
${R} .pbb4-product img{display:block;width:100%;max-width:26rem;height:auto;max-height:230px;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--pbb4-shadow) calc(l - .1) c h / .55)) drop-shadow(0 18px 16px oklch(from var(--pbb4-shadow) calc(l - .1) c h / .5))}
@media (min-width:65rem){${R} .pbb4-product img{max-height:300px}}
${R} .pbb4-path{list-style:none;margin:0;padding:0;display:grid;gap:48px}
${R} .pbb4-stop{position:relative;min-width:0;padding-left:36px;animation:pbb4-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .pbb4-stop:nth-child(2){animation-delay:.07s}
${R} .pbb4-stop:nth-child(3){animation-delay:.14s}
${R} .pbb4-rail{position:absolute;left:0;top:4px;bottom:-52px;width:16px;pointer-events:none}
${R} .pbb4-stop:last-child .pbb4-rail{bottom:auto;height:16px}
${R} .pbb4-node{position:absolute;left:0;top:0;width:16px;height:16px;border-radius:50%;background:var(--band);box-shadow:inset 0 0 0 2px oklch(from var(--band-ink) l c h / .42);transition:background-color .3s ease,box-shadow .3s ease}
${R} .pbb4-stop[data-reached] .pbb4-node{background:var(--accent-fill,var(--accent));box-shadow:inset 0 0 0 2px var(--accent-fill,var(--accent))}
${R} .pbb4-seg{position:absolute;left:7px;top:24px;bottom:8px;width:2px;border-radius:2px;background:var(--pbb4-line);overflow:hidden}
${R} .pbb4-seg-fill{position:absolute;inset:0;background:var(--accent-fill,var(--accent));transform-origin:top;transform:scaleY(0);transition:transform .5s cubic-bezier(.2,.7,.2,1)}
${R} .pbb4-seg[data-lit] .pbb4-seg-fill{transform:scaleY(1)}
@media (min-width:65rem){
${R} .pbb4-path{gap:var(--pbb4-gap);align-items:start}
${R} .pbb4-path[data-stops='3']{grid-template-columns:minmax(0,.9fr) minmax(0,1.25fr) minmax(0,1fr)}
${R} .pbb4-path[data-stops='2']{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
${R} .pbb4-path[data-stops='1']{grid-template-columns:minmax(0,30rem)}
${R} .pbb4-stop{padding-left:0;padding-top:40px}
${R} .pbb4-rail{top:0;bottom:auto;right:calc(-1 * var(--pbb4-gap));width:auto;height:16px}
${R} .pbb4-stop:last-child .pbb4-rail{right:0}
${R} .pbb4-seg{left:24px;right:8px;top:7px;bottom:auto;width:auto;height:2px}
${R} .pbb4-seg-fill{transform-origin:left;transform:scaleX(0)}
${R} .pbb4-seg[data-lit] .pbb4-seg-fill{transform:scaleX(1)}
}
${R} .pbb4-stop-title{display:flex;align-items:baseline;gap:12px;margin:0 0 12px;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;color:var(--band-ink)}
${R} .pbb4-stop-title > span:last-child{min-width:0;text-wrap:balance}
${R} .pbb4-num{flex:none;font-variant-numeric:tabular-nums;color:var(--pbb4-soft)}
${R} .pbb4-intro{margin:0 0 20px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--pbb4-soft);text-wrap:pretty}
${R} .pbb4-intro strong{color:var(--band-ink);font-weight:700}
${R} .pbb4-specs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:16px;margin:0}
${R} .pbb4-spec{min-width:0;padding:12px 0;border-bottom:1px solid var(--pbb4-line)}
${R} .pbb4-spec dt{margin:0 0 4px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--pbb4-soft)}
${R} .pbb4-spec dd{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.125rem;line-height:1.2;font-variant-numeric:tabular-nums;color:var(--band-ink);overflow-wrap:anywhere}
${R} .pbb4-unit{margin-left:.25em;font-size:.9375rem;font-weight:700;color:var(--pbb4-soft)}
@media (min-width:65rem){
${R} .pbb4-specs{grid-template-columns:minmax(0,1fr)}
${R} .pbb4-spec{display:flex;align-items:baseline;justify-content:space-between;gap:16px}
${R} .pbb4-spec dt{margin:0}
${R} .pbb4-spec dd{font-size:1.3125rem;text-align:right}
}
${R} .pbb4-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
${R} .pbb4-chips li{display:flex;min-width:0}
${R} .pbb4-chip{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 14px 8px 12px;border-radius:999px;border:1px solid oklch(from var(--band-ink) l c h / .22);background:oklch(from var(--band-ink) l c h / .08);color:var(--band-ink);font:inherit;font-size:1rem;font-weight:700;line-height:1.2;text-align:left;cursor:pointer;transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
${R} .pbb4-chip svg{flex:none}
${R} .pbb4-chip-w{font-size:.9375rem;font-weight:600;color:var(--pbb4-soft);font-variant-numeric:tabular-nums;white-space:nowrap}
${R} .pbb4-chip:hover{background:oklch(from var(--band-ink) l c h / .15);border-color:oklch(from var(--band-ink) l c h / .36);transform:translateY(-1px)}
${R} .pbb4-chip:active{transform:translateY(0) scale(.98)}
${R} .pbb4-chip[aria-pressed='true']{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .pbb4-chip[aria-pressed='true']:hover{background:oklch(from var(--accent-fill,var(--accent)) calc(l - .04) c h)}
${R} .pbb4-chip[aria-pressed='true'] .pbb4-chip-w{color:inherit}
${R} .pbb4-chip:focus-visible{outline:3px solid var(--band-ink);outline-offset:2px}
${R} .pbb4-readout{margin-top:20px;padding:clamp(20px,2.4vw,24px);border-radius:var(--radius,12px);background:oklch(from var(--band-ink) l c h / .07);border:1px solid var(--pbb4-line)}
${R} .pbb4-live{animation:pbb4-rise .3s cubic-bezier(.2,.7,.2,1) both}
${R} .pbb4-verdict{display:flex;align-items:center;gap:12px;margin:0;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;color:var(--band-ink)}
${R} .pbb4-verdict > span:last-child{min-width:0;text-wrap:balance}
${R} .pbb4-badge{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:oklch(from var(--band-ink) l c h / .16);color:var(--band-ink)}
${R} .pbb4-badge[data-tone='yes']{background:var(--success);color:var(--status-glyph,#fff)}
${R} .pbb4-badge[data-tone='no']{background:var(--danger);color:var(--status-glyph,#fff)}
${R} .pbb4-figure{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 10px;margin:20px 0 0;color:var(--band-ink)}
${R} .pbb4-figcap{flex-basis:100%;margin-bottom:12px;font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--pbb4-soft)}
${R} .pbb4-big{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
${R} .pbb4-big-unit{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.15}
${R} .pbb4-detail{margin:12px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--pbb4-soft);text-wrap:pretty}
${R} .pbb4-meter{margin-top:20px}
${R} .pbb4-gauge{height:10px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .14);overflow:hidden}
${R} .pbb4-gauge-fill{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transition:width .4s cubic-bezier(.2,.7,.2,1)}
${R} .pbb4-readout[data-verdict='no'] .pbb4-gauge-fill{background:var(--danger)}
${R} .pbb4-load{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--pbb4-soft);font-variant-numeric:tabular-nums}
${R} .pbb4-note{margin:16px 0 0;font-size:.9375rem;line-height:1.4;color:var(--pbb4-soft);text-wrap:pretty}
${R} .pbb4-note strong{color:var(--band-ink);font-weight:700}
${R} .pbb4-card{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(--pbb4-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--pbb4-shadow) l c h / .32)));padding:clamp(20px,3vw,28px)}
${R} .pbb4-risk{margin:0 0 20px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .pbb4-risk strong{color:var(--ink);font-weight:700}
${R} .pbb4-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0 0 12px}
${R} .pbb4-price-num{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${R} .pbb4-price-suffix{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.15;color:var(--ink)}
${R} .pbb4-price-note,${R} .pbb4-financing{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .pbb4-financing{margin-top:8px;font-weight:600;color:var(--ink)}
${R} .pbb4-off{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger)}
${R} .pbb4-assure{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-align:center;text-wrap:pretty}
${R} .pbb4-assure-item{white-space:nowrap;margin-inline:.45em}
${R} .pbb4-assure svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em;color:var(--success)}
${R} .pbb4-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:0 24px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.4vw,1.25rem);line-height:1.15;text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--pbb4-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--pbb4-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .pbb4-btn-sep{opacity:.8}
${R} .pbb4-btn-price{font-variant-numeric:tabular-nums}
${R} .pbb4-btn:hover:not(:disabled),${R}[data-force='hover'] .pbb4-btn:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--pbb4-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--pbb4-shadow) l c h / .5))}
${R} .pbb4-btn:active:not(:disabled),${R}[data-force='active'] .pbb4-btn:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 1px oklch(from var(--pbb4-shadow) l c h / .3)}
${R} .pbb4-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none;cursor:not-allowed}
${R} .pbb4-btn--card{width:100%;min-height:72px;margin-top:20px}
${R} .pbb4-btn--card:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .pbb4-dock{position:sticky;bottom:0;z-index:3;margin:40px calc(-1 * var(--pbb4-gutter)) 0;padding:12px var(--pbb4-gutter) calc(12px + env(safe-area-inset-bottom,0px));background:oklch(from var(--band) calc(l + .04) c h);box-shadow:0 -1px 2px oklch(from var(--pbb4-shadow) calc(l - .1) c h / .35),0 -8px 16px -6px oklch(from var(--pbb4-shadow) calc(l - .1) c h / .45)}
${R} .pbb4-dock .pbb4-btn{width:100%;min-height:60px;white-space:nowrap}
${R} .pbb4-dock .pbb4-btn:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
@media (min-width:65rem){${R} .pbb4-dock{display:none}}
@media (max-width:64.999rem){${R} .pbb4-btn--card{display:none}}
@keyframes pbb4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
${R} .pbb4-head,${R} .pbb4-stop,${R} .pbb4-live{animation:none}
${R} .pbb4-chip,${R} .pbb4-btn,${R} .pbb4-node,${R} .pbb4-seg-fill,${R} .pbb4-gauge-fill{transition:none}
${R} .pbb4-chip:hover,${R} .pbb4-chip:active,${R} .pbb4-btn:hover:not(:disabled),${R} .pbb4-btn:active:not(:disabled),${R}[data-force] .pbb4-btn:not(:disabled){transform:none}
}
`
pieces/offer/product-buy-box-4/specimen.tsx 64 lines
import __studioImage9bfb1d3c from "../assets/beff90ffc1aa3c0b.webp";
import * as React from 'react'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { ProductBuyBox4, type ProductBuyBox4State } from '../product-buy-box-4'
export const states = ['default', 'hover', 'active', 'disabled']
export default function ProductBuyBox4Specimen({ state = 'default' }: { state?: ProductBuyBox4State }) {
return (
<ProductBuyBox4
state={state}
name='Voltline 2kWh Portable Power Station'
benefit='Keep the fridge cold, the CPAP running and the laptop charged when the grid goes down. Check your own devices below before you pay.'
productImage={slot(
'product',
__studioImage9bfb1d3c
)}
productImageAlt='Voltline 2kWh portable power station with AC and USB-C outlets on the front'
specsTitle='Built to carry a night off the grid'
specsIntro={{ lead: 'No guessing.', text: 'Every number you need to size your backup, right here.' }}
specs={[
{ label: 'Capacity', value: '2,048', unit: 'Wh' },
{ label: 'Continuous output', value: '2,200', unit: 'W' },
{ label: 'Surge output', value: '4,400', unit: 'W' },
{ label: 'AC recharge to 80%', value: '70', unit: 'min' },
{ label: 'Outlets', value: '6 AC · 4 USB-C' },
{ label: 'Cell life', value: '4,000', unit: 'cycles' },
{ label: 'Weight', value: '22.4', unit: 'kg' },
{ label: 'Chemistry', value: 'LiFePO4' },
]}
checkerTitle='Will it run your devices?'
checkerIntro={{
lead: 'Prove it fits first.',
text: 'Tap what you’d plug in during an outage. Your run time updates as you go.',
}}
devices={[
{ id: 'fridge', name: 'Fridge', watts: 60, icon: 'fridge' },
{ id: 'cpap', name: 'CPAP', watts: 40, icon: 'cpap' },
{ id: 'laptop', name: 'Laptop', watts: 65, icon: 'laptop' },
{ id: 'router', name: 'Wi-Fi router', watts: 12, icon: 'router' },
{ id: 'phone', name: 'Phone', watts: 15, icon: 'phone' },
{ id: 'tv', name: 'TV', watts: 110, icon: 'tv' },
{ id: 'microwave', name: 'Microwave', watts: 1100, icon: 'microwave' },
{ id: 'heater', name: 'Space heater', watts: 1500, icon: 'heater' },
]}
defaultSelected={['fridge', 'cpap', 'router']}
capacityWh={2048}
usablePercent={85}
maxOutputW={2200}
actionTitle='Try it for 30 days'
guarantee={{
lead: 'Run your real devices for 30 days.',
text: 'If it doesn’t keep up with your home, send it back for a full refund.',
}}
price='$1,299'
priceSuffix='today. That’s it.'
priceNote='One payment. No subscription, no app account needed to use it.'
label='Try It For 30 Days'
reassurance={[defaults.sample.guarantee, 'Secure checkout']}
/>
)
}
| Name | Type | Details |
|---|---|---|
name RequiredProductBuyBox4 |
string |
|
benefit OptionalProductBuyBox4 |
React.ReactNode |
|
productImage OptionalProductBuyBox4 |
string |
|
productImageAlt OptionalProductBuyBox4 |
string |
Default ''
|
specs OptionalProductBuyBox4 |
ProductSpec[] |
Default []
|
specsTitle OptionalProductBuyBox4 |
string |
Default 'Every spec, in plain numbers'
|
specsIntro OptionalProductBuyBox4 |
LeadIn |
|
devices OptionalProductBuyBox4 |
PowerDevice[] |
Default []
|
defaultSelected OptionalProductBuyBox4 |
string[] |
Default []
|
capacityWh RequiredProductBuyBox4 |
number |
|
usablePercent OptionalProductBuyBox4 |
number |
|
maxOutputW OptionalProductBuyBox4 |
number |
|
checkerTitle OptionalProductBuyBox4 |
string |
Default 'Will it run what you need?'
|
checkerIntro OptionalProductBuyBox4 |
LeadIn |
|
actionTitle OptionalProductBuyBox4 |
string |
Default 'Get yours today'
|
guarantee OptionalProductBuyBox4 |
LeadIn |
|
price RequiredProductBuyBox4 |
string |
|
priceSuffix OptionalProductBuyBox4 |
string |
|
priceNote OptionalProductBuyBox4 |
string |
|
financing OptionalProductBuyBox4 |
string |
|
label OptionalProductBuyBox4 |
string |
Default 'Order Now'
|
showPriceOnDock OptionalProductBuyBox4 |
boolean |
Default true
|
reassurance OptionalProductBuyBox4 |
string[] |
Default []
|
disabled OptionalProductBuyBox4 |
boolean |
Default false
|
state OptionalProductBuyBox4 |
ProductBuyBox4State |
Default 'default'
|
copy OptionalProductBuyBox4 |
Partial<ProductBuyBox4Copy> |
|
onAction OptionalProductBuyBox4 |
(fit: ProductBuyBox4Fit) => void |
|
href OptionalProductBuyBox4 |
string |
|
className OptionalProductBuyBox4 |
string |
Default ''
|
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
beff90ffc1aa3c0b.webp
image/webp · 75.8 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB