Product Buy Box 1
Helps buyers choose a product variant, confirm value and add their quantity to the cart.
Use it in a prompt
Use offer/product-buy-box 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.tsx. - Import it and pass your copy and images (Props tab):
import { ProductBuyBox } from "@/components/funneldna/offer/product-buy-box"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/product-buy-box/component.tsx 689 lines
// Helps buyers choose a product variant, confirm value and add their quantity to the cart.
"use client"
import * as React from "react"
import {
AlertCircle,
Check,
ChevronDown,
Download,
ListChecks,
Lock,
Minus,
PackageOpen,
Plus,
RotateCcw,
ShieldCheck,
ShoppingCart,
Tag,
} from "lucide-react"
export type ProductBuyBoxProps = {
/** Product name. Not shown as a heading; used for the form's accessible name and the added-to-cart summary. */
name: string
priceLabel?: string
price: string
/** Compare-at price. Shown (with the saving) only when supplied. */
compareAt?: string
compareLabel?: string
priceNote?: string
variants?: BuyBoxVariantGroup[]
quantity?: { min?: number; max?: number; initial?: number }
label?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
loadingLabel?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
addedLabel?: string
sublabel?: string
assurances?: BuyBoxAssurance[]
details?: BuyBoxDetail[]
/** Guarantee seal image (transparent background). Decorative; the guarantee itself lives in text. */
sealGuaranteeImage?: string
sealAlt?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
successTitle?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
checkoutLabel?: string
checkoutHref?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
keepShoppingLabel?: string
errorText?: string
disabled?: boolean
state?: ProductBuyBoxState
/** Labels for calculated prices, quantities, details and validation. */
copy?: Partial<ProductBuyBoxCopy>
onSubmit?: (order: { quantity: number; options: Record<string, string> }) => void
/** Legacy alias for onSubmit. */
onAddToCart?: (order: { quantity: number; options: Record<string, string> }) => void
/** Where a valid submit goes when there is no onSubmit or onAction. */
href?: string
/** Called on a valid submit when there is no onSubmit. */
onAction?: () => void
/** Legacy alias for onAction. */
onCheckout?: () => void
className?: string
}
export function ProductBuyBox({
name,
priceLabel,
price,
compareAt,
compareLabel = "Regular",
priceNote,
variants = [],
quantity,
label = "Add To Cart",
sublabel,
assurances = [],
details = [],
sealGuaranteeImage,
sealAlt = "",
checkoutHref,
href = checkoutHref,
errorText = "We couldn’t add this to your cart. Please try again.",
disabled = false,
state = "default",
copy,
onAddToCart,
onSubmit = onAddToCart,
onCheckout,
onAction = onCheckout,
className = "",
}: ProductBuyBoxProps) {
const text = { ...DEFAULT_COPY, ...copy }
const uid = React.useId().replace(/:/g, "")
const formRef = React.useRef<HTMLFormElement>(null)
const min = Math.max(1, quantity?.min ?? 1)
const max = Math.max(min, quantity?.max ?? 99)
const startQty = clampNum(quantity?.initial ?? min, min, max)
const makeSelection = (forceMissing: boolean) => {
const sel: Record<string, string | null> = {}
variants.forEach((g, i) => {
sel[g.name] = forceMissing && i === variants.length - 1 ? null : g.defaultValue ?? null
})
return sel
}
const missingMessage = (sel: Record<string, string | null>) => {
const g = variants.find((v) => !sel[v.name])
return g ? text.missingOption.replace("{label}", g.label.toLowerCase()) : null
}
const [selection, setSelection] = React.useState<Record<string, string | null>>(() => makeSelection(state === "error"))
const [qty, setQty] = React.useState(startQty)
const [qtyDraft, setQtyDraft] = React.useState(String(startQty))
const [error, setError] = React.useState<string | null>(() =>
state === "error" ? missingMessage(makeSelection(true)) ?? errorText : null
)
const [open, setOpen] = React.useState<string[]>(() =>
details.filter((d, i) => d.defaultOpen ?? i === 0).map((d) => d.id)
)
React.useEffect(() => {
const sel = makeSelection(state === "error")
setSelection(sel)
setQty(startQty)
setQtyDraft(String(startQty))
setError(state === "error" ? missingMessage(sel) ?? errorText : null)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
const isDisabled = disabled || state === "disabled"
const forced = state === "hover" || state === "active" ? state : undefined
const unit = parseMoney(price)
const was = parseMoney(compareAt)
const hasSaving = unit != null && was != null && was > unit
const savingText = hasSaving ? fmtLike((was as number) - (unit as number), price) : null
const pct = hasSaving ? Math.round((((was as number) - (unit as number)) / (was as number)) * 100) : null
const subtotal = unit != null ? fmtLike(unit * qty, price) : price
const subtotalWas = hasSaving && compareAt ? fmtLike((was as number) * qty, compareAt) : null
function setQuantity(n: number) {
const v = clampNum(n, min, max)
setQty(v)
setQtyDraft(String(v))
}
function choose(group: string, value: string) {
const next = { ...selection, [group]: value }
setSelection(next)
if (error) setError(missingMessage(next))
}
function toggle(id: string) {
setOpen((cur) => (cur.includes(id) ? cur.filter((x) => x !== id) : [...cur, id]))
}
function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault()
if (isDisabled) return
const missing = variants.find((g) => !selection[g.name])
if (missing) {
setError(missingMessage(selection))
formRef.current
?.querySelector<HTMLInputElement>(`input[data-group='${missing.name}']:not(:disabled)`)
?.focus()
return
}
setError(null)
if (onSubmit) onSubmit({ quantity: qty, options: selection as Record<string, string> })
else if (onAction) onAction()
else if (href) window.location.assign(href)
}
const priceSpeech = ` ${price}${compareAt ? `, ${compareLabel.toLowerCase()} ${text.priceWord} ${compareAt}` : ""}`
return (
<form
ref={formRef}
className={`cf-product-buy-box text-[var(--pbb-ink)] [font-family:var(--font-body)] ${className}`.trim()}
data-seal={sealGuaranteeImage ? "true" : "false"}
onSubmit={handleSubmit}
noValidate
aria-label={name}
>
<style>{PBB_CSS}</style>
<div className="pbb-card pbb-rise" data-seal={sealGuaranteeImage ? "true" : "false"}>
{sealGuaranteeImage ? (
<img className="pbb-seal" src={sealGuaranteeImage} alt={sealAlt} width={112} height={112} decoding="async" />
) : null}
<div className="pbb-plate">
<div className="pbb-plate-top">
<p className={priceLabel ? "pbb-plate-label" : "pbb-sr"}>
{priceLabel}
<span className="pbb-sr">{priceSpeech}</span>
</p>
<p className="pbb-price-row" aria-hidden="true">
<span className="pbb-price">{price}</span>
{compareAt ? (
<span className="pbb-was">
<span className="pbb-was-label">{compareLabel}</span>
<s>{compareAt}</s>
</span>
) : null}
</p>
</div>
{hasSaving || priceNote ? (
<div className="pbb-plate-foot">
{hasSaving ? (
<span className="pbb-save">
<Tag aria-hidden className="pbb-ico-sm" />
{text.saving} {savingText} <span className="pbb-save-pct">({pct}{`% ${text.off})`}</span>
</span>
) : null}
{priceNote ? <span className="pbb-note">{priceNote}</span> : null}
</div>
) : null}
</div>
<div className="pbb-body">
{variants.map((g) => {
const chosen = g.options.find((o) => o.value === selection[g.name])
const invalid = !!error && !selection[g.name]
return (
<fieldset
key={g.name}
className="pbb-group"
data-invalid={invalid ? "true" : "false"}
aria-describedby={invalid ? `${uid}-err` : undefined}
>
<legend className="pbb-legend">
{g.label}: <span className="pbb-legend-val">{chosen ? chosen.label : text.chooseOne}</span>
</legend>
<div className="pbb-chips">
{g.options.map((o) => {
const checked = selection[g.name] === o.value
return (
<label
key={o.value}
className="pbb-chip"
data-checked={checked ? "true" : "false"}
data-disabled={o.disabled ? "true" : "false"}
>
<input
className="pbb-sr"
type="radio"
name={`${uid}-${g.name}`}
value={o.value}
checked={checked}
disabled={o.disabled}
data-group={g.name}
onChange={() => choose(g.name, o.value)}
/>
{o.swatch ? (
<span className="pbb-swatch" style={{ "--sw": o.swatch } as React.CSSProperties} aria-hidden />
) : null}
<span>{o.label}</span>
<span className="pbb-tick" aria-hidden>
<Check strokeWidth={3.5} />
</span>
</label>
)
})}
</div>
</fieldset>
)
})}
<div className="pbb-qtyrow">
<div>
<span className="pbb-qty-label" id={`${uid}-qty`}>
{text.quantity}
</span>
<div className="pbb-stepper" role="group" aria-labelledby={`${uid}-qty`}>
<button
type="button"
className="pbb-step"
onClick={() => setQuantity(qty - 1)}
disabled={qty <= min}
aria-label={text.decreaseQuantity}
>
<Minus aria-hidden strokeWidth={2.75} />
</button>
<input
className="pbb-qty-input"
type="text"
inputMode="numeric"
pattern="[0-9]*"
placeholder="1"
aria-label={text.quantity}
value={qtyDraft}
onChange={(e) => {
const v = e.target.value.replace(/[^0-9]/g, "").slice(0, 3)
setQtyDraft(v)
const n = parseInt(v, 10)
if (!Number.isNaN(n)) setQty(clampNum(n, min, max))
}}
onBlur={() => setQtyDraft(String(qty))}
/>
<button
type="button"
className="pbb-step"
onClick={() => setQuantity(qty + 1)}
disabled={qty >= max}
aria-label={text.increaseQuantity}
>
<Plus aria-hidden strokeWidth={2.75} />
</button>
</div>
</div>
<div className="pbb-subtotal" aria-live="polite">
<span className="pbb-sub-label">{qty > 1 ? text.subtotalFor.replace("{quantity}", String(qty)) : text.subtotal}</span>
<span className="pbb-sub-val">
{subtotalWas ? (
<s className="pbb-sub-was">
<span className="pbb-sr">{compareLabel} </span>
{subtotalWas}
</s>
) : null}
{subtotal}
</span>
</div>
</div>
{error ? (
<div className="pbb-alert" role="alert" id={`${uid}-err`}>
<AlertCircle aria-hidden className="pbb-ico" />
<span>{error}</span>
</div>
) : null}
<div className="pbb-cta-wrap">
<button
type="submit"
className="pbb-cta"
data-force={forced}
disabled={isDisabled}
>
<span className="pbb-cta-icon" aria-hidden>
<ShoppingCart strokeWidth={2.5} />
</span>
<span className="pbb-cta-label">{label}</span>
<span className="pbb-cta-arrow" aria-hidden />
</button>
{sublabel ? (
<p className="pbb-cta-sub">
<Lock aria-hidden className="pbb-ico-sm" />
{sublabel}
</p>
) : null}
</div>
{assurances.length ? (
<ul className="pbb-assure">
{assurances.map((a) => {
const Icon = ASSURE_ICONS[a.icon] ?? ShieldCheck
return (
<li key={a.title}>
<span className="pbb-a-ico" data-tone={a.icon} aria-hidden>
<Icon strokeWidth={2.25} />
</span>
<span>
<strong className="pbb-a-title">{a.title}</strong>
{a.text ? <span className="pbb-a-text">{a.text}</span> : null}
</span>
</li>
)
})}
</ul>
) : null}
</div>
</div>
{details.length ? (
<div className="pbb-details pbb-rise">
{details.map((d) => {
const isOpen = open.includes(d.id)
const Icon = d.icon === "steps" ? ListChecks : PackageOpen
const meta = d.items?.length
? `${d.items.length} ${d.items.length === 1 ? text.item : text.items}`
: d.steps?.length
? `${d.steps.length} ${d.steps.length === 1 ? text.step : text.steps}`
: null
const vals = d.items?.map((it) => parseMoney(it.value)) ?? []
const sum = vals.length && vals.every((v) => v != null) ? vals.reduce<number>((a, b) => a + (b as number), 0) : null
const firstValue = d.items?.[0]?.value
const showTotal = d.showTotal !== false && sum != null && unit != null && sum > unit && !!firstValue
return (
<div key={d.id} className="pbb-acc" data-open={isOpen ? "true" : "false"}>
<h3 className="pbb-acc-h">
<button
type="button"
className="pbb-acc-btn"
id={`${uid}-${d.id}-btn`}
aria-expanded={isOpen}
aria-controls={`${uid}-${d.id}-panel`}
onClick={() => toggle(d.id)}
>
<span className="pbb-acc-ico" aria-hidden>
<Icon strokeWidth={2.25} />
</span>
<span className="pbb-acc-title">{d.title}</span>
{meta ? <span className="pbb-acc-meta">{meta}</span> : null}
<ChevronDown className="pbb-acc-chev" aria-hidden strokeWidth={2.5} />
</button>
</h3>
<div className="pbb-acc-panel" id={`${uid}-${d.id}-panel`} role="region" aria-labelledby={`${uid}-${d.id}-btn`}>
<div className="pbb-acc-inner">
<div className="pbb-acc-content">
{d.body ? <p className="pbb-acc-body">{d.body}</p> : null}
{d.items?.length ? (
<ul className="pbb-items">
{d.items.map((it) => (
<li key={it.name} className="pbb-item" data-thumb={it.itemImage ? "true" : "false"}>
{it.itemImage ? (
<img className="pbb-thumb" src={it.itemImage} alt={it.imageAlt ?? ""} width={64} height={64} loading="lazy" decoding="async" />
) : null}
<div className="pbb-item-copy">
<p className="pbb-item-name">{it.name}</p>
{it.detail ? <p className="pbb-item-detail">{it.detail}</p> : null}
</div>
{it.value ? <span className="pbb-item-value">{it.value} {text.value}</span> : null}
</li>
))}
</ul>
) : null}
{showTotal ? (
<div className="pbb-total">
<span className="pbb-total-was">
{d.totalLabel ?? text.totalValue} <s>{fmtLike(sum as number, firstValue as string)}</s>
</span>
<span className="pbb-total-today">
{d.todayLabel ?? text.yoursToday} <strong>{price}</strong>
</span>
</div>
) : null}
{d.steps?.length ? (
<ol className="pbb-steps">
{d.steps.map((st) => (
<li key={st.title}>
<div>
<p className="pbb-item-name">{st.title}</p>
{st.text ? <p className="pbb-item-detail">{st.text}</p> : null}
</div>
</li>
))}
</ol>
) : null}
</div>
</div>
</div>
</div>
)
})}
</div>
) : null}
</form>
)
}
export default ProductBuyBox
export type ProductBuyBoxState = "default" | "hover" | "active" | "disabled" | "error" | "success"
export type BuyBoxOption = { value: string; label: string; swatch?: string; disabled?: boolean }
export type BuyBoxVariantGroup = {
name: string
label: string
options: BuyBoxOption[]
defaultValue?: string
}
export type BuyBoxItem = { name: string; detail?: string; value?: string; itemImage?: string; imageAlt?: string }
export type BuyBoxStep = { title: string; text?: string }
export type BuyBoxDetail = {
id: string
title: string
icon?: "included" | "steps"
body?: string
items?: BuyBoxItem[]
steps?: BuyBoxStep[]
defaultOpen?: boolean
/** Show the summed item values against today's price (only when every item value is supplied). */
showTotal?: boolean
totalLabel?: string
todayLabel?: string
}
export type BuyBoxAssurance = { icon: "shipping" | "returns" | "guarantee"; title: string; text?: string }
function clampNum(n: number, min: number, max: number) {
return Math.min(max, Math.max(min, n))
}
function parseMoney(v?: string) {
if (!v) return null
const m = v.replace(/,/g, "").match(/-?[0-9]+([.][0-9]+)?/)
return m ? parseFloat(m[0]) : null
}
function fmtLike(n: number, like: string) {
const prefix = like.match(/^[^0-9-]*/)?.[0] ?? ""
const suffix = like.match(/[^0-9.,]*$/)?.[0] ?? ""
const dec = /[.][0-9]/.test(like) ? 2 : 0
return prefix + n.toLocaleString("en-US", { minimumFractionDigits: dec, maximumFractionDigits: dec }) + suffix
}
const ASSURE_ICONS = { shipping: Download, returns: RotateCcw, guarantee: ShieldCheck }
const DEFAULT_COPY = {
saving: "You save",
off: "off",
priceWord: "price",
chooseOne: "Choose one",
quantity: "Quantity",
decreaseQuantity: "Decrease quantity",
increaseQuantity: "Increase quantity",
subtotal: "Subtotal",
subtotalFor: "Subtotal for {quantity}",
quantityShort: "Qty",
item: "item",
items: "items",
step: "step",
steps: "steps",
value: "value",
totalValue: "Total value",
yoursToday: "Yours today",
missingOption: "Choose your {label} to continue.",
}
/** {quantity} and {label} in the corresponding messages are replaced at render time. */
type ProductBuyBoxCopy = typeof DEFAULT_COPY
// Pure black/white alpha shadows and designed image colours are theme-contract exceptions.
const PBB_CSS = `
.cf-product-buy-box{--pbb-cta:var(--cta);--pbb-cta2:var(--cta-2);--pbb-ink:var(--ink);--pbb-muted:var(--muted);--pbb-band:var(--band);--pbb-band-ink:var(--band-ink);--pbb-accent:var(--accent);--pbb-card:var(--card);--pbb-field:var(--field);--pbb-field-ink:var(--field-ink);--pbb-r:var(--radius,16px);--pbb-marker:color-mix(in oklch,var(--marker,#fae37c) 20%,var(--card));--pbb-line:var(--card-border, oklch(from var(--ink) l c h / 0.12));--pbb-tint:color-mix(in oklch,var(--ink) 3%,var(--card));
position:relative;display:grid;gap:22px;width:100%;max-width:36rem;margin:0 auto;justify-self:center;align-self:start;text-align:left;-webkit-font-smoothing:antialiased}
.cf-product-buy-box[data-seal=true]{padding-top:28px}
.cf-product-buy-box *,.cf-product-buy-box *::before,.cf-product-buy-box *::after{box-sizing:border-box}
.cf-product-buy-box svg{flex:none}
.cf-product-buy-box .pbb-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;accent-color:var(--field-focus, var(--accent))}
.cf-product-buy-box .pbb-ico{width:20px;height:20px}
.cf-product-buy-box .pbb-ico-sm{width:16px;height:16px}
.cf-product-buy-box .pbb-card{position:relative;background:var(--pbb-card);border:1px solid var(--pbb-line);border-radius:var(--card-radius, var(--radius,16px));box-shadow:var(--card-shadow, inset 0 0 0 1px color-mix(in oklch,var(--pbb-band) 4%,var(--card)),inset 0 -3px 0 var(--pbb-tint),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35))}
.cf-product-buy-box .pbb-seal{position:absolute;z-index:2;top:-26px;right:12px;width:clamp(84px,20vw,108px);height:auto;aspect-ratio:1;object-fit:contain;transform:rotate(-8deg);filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)) drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35));pointer-events:none;transition:rotate .35s cubic-bezier(.2,.7,.3,1),scale .35s cubic-bezier(.2,.7,.3,1);animation:pbb-stamp .5s .12s cubic-bezier(.2,.8,.3,1.2) both}
.cf-product-buy-box .pbb-card:hover .pbb-seal{rotate:6deg;scale:1.04}
.cf-product-buy-box .pbb-plate{position:relative;overflow:hidden;margin:6px 6px 0;padding:24px 24px 22px;border-radius:var(--card-radius, var(--radius,16px));background:var(--pbb-band);color:var(--pbb-band-ink);box-shadow:var(--card-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .16),inset 0 0 0 1px oklch(from var(--card) calc(l + 0.04) c h / .07),inset 0 -3px 0 oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .28),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35))}
.cf-product-buy-box .pbb-plate::before{content:'';position:absolute;inset:0 0 auto 0;height:50%;pointer-events:none;background:linear-gradient(180deg,oklch(from var(--band-ink) l c h / 0.04),transparent)}
.cf-product-buy-box .pbb-plate>*{position:relative}
.cf-product-buy-box .pbb-card[data-seal=true] .pbb-plate-top{padding-right:clamp(84px,20vw,112px)}
.cf-product-buy-box .pbb-plate-label{margin:0 0 14px;font-size:15px;font-weight:700;line-height:1.35;color:var(--pbb-band-ink);text-wrap:balance}
.cf-product-buy-box .pbb-price-row{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 16px}
.cf-product-buy-box .pbb-price{font-family:var(--font-display);font-weight:900;font-size:clamp(3.5rem,10vw,4.5rem);line-height:1;letter-spacing:-.04em;color:var(--pbb-band-ink)}
.cf-product-buy-box .pbb-was{display:inline-flex;align-items:baseline;gap:7px;font-family:var(--font-display);font-weight:700;font-size:clamp(1.25rem,3.6vw,1.5rem);line-height:1;color:var(--band-ink)}
.cf-product-buy-box .pbb-was-label{font-family:var(--font-body);font-size:14px;font-weight:600;letter-spacing:0}
.cf-product-buy-box .pbb-was s{text-decoration-thickness:3px;text-decoration-color:var(--danger);background:var(--danger-soft);color:var(--danger)}
.cf-product-buy-box .pbb-plate-foot{margin-top:18px;display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px}
.cf-product-buy-box .pbb-save{display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:6px 14px 6px 12px;border-radius:999px;background:var(--success-soft);border:1px solid oklch(from var(--ink) l c h / 0.15);color:var(--success);font-family:var(--font-display);font-weight:800;font-size:15px;line-height:1.1;white-space:nowrap;box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .7),inset 0 -2px 0 oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .2),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35);border-color:var(--success)}
.cf-product-buy-box .pbb-save-pct{font-weight:700}
.cf-product-buy-box .pbb-note{font-size:14px;font-weight:600;line-height:1.4;color:var(--pbb-band-ink)}
.cf-product-buy-box .pbb-body{display:grid;gap:22px;padding:24px clamp(16px,3.6vw,26px) clamp(18px,3.6vw,26px)}
.cf-product-buy-box .pbb-group{min-width:0;margin:0;padding:0;border:0}
.cf-product-buy-box .pbb-legend{padding:0;margin:0 0 12px;font-size:16px;font-weight:700;line-height:1.3;color:var(--label-ink, var(--ink))}
.cf-product-buy-box .pbb-legend-val{font-weight:500;color:var(--pbb-muted)}
.cf-product-buy-box .pbb-chips{display:flex;flex-wrap:wrap;gap:10px}
.cf-product-buy-box .pbb-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:50px;padding:0 18px;border-radius:var(--field-radius, var(--radius, 12px));border:1.5px solid color-mix(in oklch,var(--pbb-band) 20%,var(--card));background:var(--pbb-field);color:var(--pbb-field-ink);font-size:15px;font-weight:700;line-height:1.2;cursor:pointer;user-select:none;box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)),inset 0 -2px 0 var(--pbb-tint);transition:border-color .18s,box-shadow .18s,transform .18s cubic-bezier(.2,.7,.3,1),background-color .18s;border-color:var(--field-border, oklch(from var(--ink) l c h / 0.22))}
.cf-product-buy-box .pbb-chip:hover{border-color:color-mix(in oklch,var(--pbb-band) 55%,var(--card));transform:translateY(-1px);box-shadow:0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35),inset 0 -2px 0 var(--pbb-tint)}
.cf-product-buy-box .pbb-chip:active{transform:translateY(1px)}
.cf-product-buy-box .pbb-chip[data-checked=true]{border-color:var(--success);background:var(--success-soft);box-shadow:inset 0 0 0 1px var(--success),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35);color:var(--success)}
.cf-product-buy-box .pbb-chip:has(input:focus-visible){outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
.cf-product-buy-box .pbb-chip[data-disabled=true]{cursor:not-allowed;color:var(--field-ink);background:var(--field);text-decoration:line-through;transform:none;box-shadow:none}
.cf-product-buy-box .pbb-group[data-invalid=true] .pbb-chip{border-color:var(--danger);box-shadow:0 0 0 3px var(--danger-soft);border-radius:var(--field-radius, var(--radius, 12px))}
.cf-product-buy-box .pbb-tick{position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--success);color:var(--card);box-shadow:0 0 0 2px var(--pbb-card),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35);transform:scale(0);transition:transform .22s cubic-bezier(.3,1.6,.5,1)}
.cf-product-buy-box .pbb-tick svg{width:13px;height:13px}
.cf-product-buy-box .pbb-chip[data-checked=true] .pbb-tick{transform:scale(1)}
.cf-product-buy-box .pbb-swatch{width:22px;height:22px;border-radius:50%;background:var(--sw);box-shadow:inset 0 0 0 1px oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .2),inset 0 3px 4px oklch(from var(--card) calc(l + 0.04) c h / .35)}
.cf-product-buy-box .pbb-qtyrow{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px}
.cf-product-buy-box .pbb-qty-label{display:block;margin-bottom:12px;font-size:16px;font-weight:700;line-height:1.3;color:var(--label-ink, var(--ink))}
.cf-product-buy-box .pbb-stepper{display:inline-flex;align-items:stretch;height:52px;border-radius:var(--field-radius, var(--radius, 12px));border:1.5px solid color-mix(in oklch,var(--pbb-band) 22%,var(--card));background:var(--pbb-field);overflow:hidden;box-shadow:inset 0 -2px 0 var(--pbb-tint),0 1px 0 oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.05);border-color:var(--field-border, oklch(from var(--ink) l c h / 0.22))}
.cf-product-buy-box .pbb-step{line-height:1.6;width:48px;display:grid;place-items:center;padding:0;border:0;background:var(--button-2-bg, var(--card));color:var(--button-2-ink, var(--ink));cursor:pointer;transition:background-color .15s;font-family:var(--font-body)}
.cf-product-buy-box .pbb-step svg{width:18px;height:18px}
.cf-product-buy-box .pbb-step:hover:not(:disabled){background:var(--button-2-bg, var(--card))}
.cf-product-buy-box .pbb-step:active:not(:disabled){background:var(--button-2-bg, var(--card))}
.cf-product-buy-box .pbb-step:disabled{color:var(--muted);cursor:not-allowed}
.cf-product-buy-box .pbb-step:focus-visible,.cf-product-buy-box .pbb-qty-input:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:-3px}
.cf-product-buy-box .pbb-qty-input{line-height:1.6;width:58px;margin:0;padding:0;border:0;border-inline:1.5px solid var(--field-border, oklch(from var(--ink) l c h / 0.22));background:var(--pbb-field);color:var(--pbb-field-ink);text-align:center;font-family:var(--font-body);font-weight:800;font-size:19px}
.cf-product-buy-box .pbb-qty-input::placeholder{color:color-mix(in oklch, var(--field-ink) 65%, var(--field));opacity:1}
.cf-product-buy-box .pbb-subtotal{text-align:right}
.cf-product-buy-box .pbb-sub-label{display:block;margin-bottom:12px;font-size:14px;font-weight:600;color:var(--pbb-muted)}
.cf-product-buy-box .pbb-sub-val{display:inline-flex;align-items:baseline;gap:10px;font-family:var(--font-display);font-weight:900;font-size:30px;line-height:1;letter-spacing:-.02em;color:var(--pbb-ink)}
.cf-product-buy-box .pbb-sub-was{font-size:16px;font-weight:700;color:var(--danger);text-decoration-thickness:2px;text-decoration-color:var(--danger)}
.cf-product-buy-box .pbb-alert{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:12px;background:var(--danger-soft);border:1px solid oklch(from var(--ink) l c h / 0.22);color:var(--danger);font-size:15px;font-weight:600;line-height:1.4;text-wrap:pretty;animation:pbb-shake .42s cubic-bezier(.36,.07,.19,.97) both;border-color:var(--danger)}
.cf-product-buy-box .pbb-cta-wrap{display:grid;gap:12px}
.cf-product-buy-box .pbb-cta{position:relative;isolation:isolate;overflow:hidden;width:100%;min-height:70px;margin:0 0 5px;display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:14px 16px;border-radius:var(--button-radius, var(--radius, 16px));border:1px solid oklch(from var(--pbb-cta2) calc(l - 0.06) c h);background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));color:var(--button-ink, var(--cta-ink));letter-spacing:.004em;cursor:pointer;text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .4),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2));transition:transform .16s cubic-bezier(.2,.7,.3,1),box-shadow .16s ease,filter .16s ease;border-color:var(--button-bg-2, var(--cta-2));text-transform:var(--button-case, none);font:var(--button-weight, 900) clamp(1.125rem,4.8vw,1.375rem)/1.1 var(--button-font, var(--font-display));filter:none}
.cf-product-buy-box .pbb-cta::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));transform:translateX(-120%)}
.cf-product-buy-box .pbb-cta-icon,.cf-product-buy-box .pbb-cta-arrow{width:24px;height:24px;display:grid;place-items:center}
.cf-product-buy-box .pbb-cta-icon svg{width:22px;height:22px}
.cf-product-buy-box .pbb-cta-label{min-width:0;text-align:center;text-wrap:balance}
.cf-product-buy-box .pbb-cta:hover:not(:disabled),.cf-product-buy-box .pbb-cta[data-force=hover]{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .4),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2))}
.cf-product-buy-box .pbb-cta:hover:not(:disabled)::after,.cf-product-buy-box .pbb-cta[data-force=hover]::after{transform:translateX(120%);transition:transform .75s cubic-bezier(.3,.65,.3,1)}
.cf-product-buy-box .pbb-cta:active:not(:disabled),.cf-product-buy-box .pbb-cta[data-force=active]{transform:translateY(2px);filter:none;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .4),inset 0 -1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22))}
.cf-product-buy-box .pbb-cta:focus-visible{outline:3px solid var(--pbb-accent);outline-offset:4px}
.cf-product-buy-box .pbb-cta:disabled:not([aria-busy=true]){cursor:not-allowed;color:var(--muted);text-shadow:none;border-color:oklch(from var(--ink) l c h / 0.22);background:linear-gradient(180deg,var(--card) 0%,var(--card) 100%);box-shadow:var(--button-2-shadow, var(--shadow-sm));filter:none;transform:none}
.cf-product-buy-box .pbb-cta:disabled:not([aria-busy=true])::after{display:none}
.cf-product-buy-box .pbb-cta-sub{margin:0;display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;font-weight:600;line-height:1.4;color:var(--pbb-muted);text-align:center;text-wrap:pretty}
.cf-product-buy-box .pbb-assure{list-style:none;margin:0;padding:6px 16px;display:grid;border-radius:var(--card-radius, var(--radius,16px));background:var(--pbb-tint);border:1px solid color-mix(in oklch,var(--pbb-band) 10%,var(--card));box-shadow:none}
.cf-product-buy-box .pbb-assure li{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;align-items:start;padding:12px 0}
.cf-product-buy-box .pbb-assure li+li{border-top:1px solid color-mix(in oklch,var(--pbb-band) 9%,var(--card))}
.cf-product-buy-box .pbb-a-ico{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--card);box-shadow:inset 0 0 0 1px oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .08),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)}
.cf-product-buy-box .pbb-a-ico svg{width:20px;height:20px}
.cf-product-buy-box .pbb-a-ico[data-tone=shipping]{background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--pbb-accent)}
.cf-product-buy-box .pbb-a-ico[data-tone=returns]{background:color-mix(in oklch,var(--pbb-band) 10%,var(--card));color:var(--ink)}
.cf-product-buy-box .pbb-a-ico[data-tone=guarantee]{background:var(--success-soft);color:var(--success);box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / 0.12),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)}
.cf-product-buy-box .pbb-a-title{display:block;padding-top:1px;font-family:var(--font-display);font-weight:800;font-size:16px;line-height:1.3;color:var(--pbb-ink)}
.cf-product-buy-box .pbb-a-text{display:block;margin-top:3px;font-size:15px;line-height:1.45;color:var(--pbb-muted);text-wrap:pretty}
.cf-product-buy-box .pbb-details{display:grid;gap:10px}
.cf-product-buy-box .pbb-acc{background:var(--pbb-card);border:1px solid var(--pbb-line);border-radius:var(--card-radius, var(--radius,16px));overflow:hidden;box-shadow:var(--card-shadow, inset 0 -2px 0 var(--pbb-tint),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35));transition:border-color .2s,box-shadow .25s}
.cf-product-buy-box .pbb-acc[data-open=true]{border-color:color-mix(in oklch,var(--pbb-band) 32%,var(--card));box-shadow:var(--card-shadow, 0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35))}
.cf-product-buy-box .pbb-acc-h{margin:0;font:inherit;line-height:1.6}
.cf-product-buy-box .pbb-acc-btn{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:10px 16px;border:0;background:var(--button-2-bg, var(--card));color:var(--button-2-ink, var(--ink));font-family:var(--font-display);font-weight:800;font-size:17px;line-height:1.25;text-align:left;cursor:pointer;transition:background-color .2s}
.cf-product-buy-box .pbb-acc-btn:hover{background:var(--button-2-bg, var(--card))}
.cf-product-buy-box .pbb-acc-btn:focus-visible{outline:3px solid var(--pbb-accent);outline-offset:-3px;border-radius:var(--pbb-r)}
.cf-product-buy-box .pbb-acc-ico{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:color-mix(in oklch,var(--pbb-band) 9%,var(--card));color:var(--ink);transition:background-color .2s,color .2s}
.cf-product-buy-box .pbb-acc-ico svg{width:19px;height:19px}
.cf-product-buy-box .pbb-acc[data-open=true] .pbb-acc-ico{background:var(--pbb-band);color:var(--ink)}
.cf-product-buy-box .pbb-acc-title{flex:1;min-width:0;text-wrap:balance}
.cf-product-buy-box .pbb-acc-meta{font-family:var(--font-body);font-size:14px;font-weight:600;color:var(--pbb-muted);white-space:nowrap}
.cf-product-buy-box .pbb-acc-chev{width:20px;height:20px;color:var(--ink);transition:transform .3s cubic-bezier(.2,.7,.3,1)}
.cf-product-buy-box .pbb-acc[data-open=true] .pbb-acc-chev{transform:rotate(180deg);color:var(--ink)}
.cf-product-buy-box .pbb-acc-panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows .32s cubic-bezier(.2,.7,.3,1)}
.cf-product-buy-box .pbb-acc[data-open=true] .pbb-acc-panel{grid-template-rows:1fr}
.cf-product-buy-box .pbb-acc-inner{min-height:0;overflow:hidden;visibility:hidden;transition:visibility 0s linear .32s}
.cf-product-buy-box .pbb-acc[data-open=true] .pbb-acc-inner{visibility:visible;transition-delay:0s}
.cf-product-buy-box .pbb-acc-content{display:grid;gap:16px;padding:4px 16px 18px}
.cf-product-buy-box .pbb-acc-body{margin:0;font-size:16px;line-height:1.55;color:var(--pbb-muted);text-wrap:pretty}
.cf-product-buy-box .pbb-items{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.cf-product-buy-box .pbb-item{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:14px;align-items:start}
.cf-product-buy-box .pbb-item[data-thumb=false]{grid-template-columns:minmax(0,1fr) auto}
.cf-product-buy-box .pbb-thumb{display:block;width:64px;height:64px;border-radius:10px;object-fit:contain;background:transparent;border:1px solid var(--pbb-line);box-shadow:none;border-color:transparent;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35))}
.cf-product-buy-box .pbb-item-copy{min-width:0}
.cf-product-buy-box .pbb-item-name{margin:0;font-size:16px;font-weight:700;line-height:1.3;color:var(--pbb-ink);text-wrap:balance}
.cf-product-buy-box .pbb-item-detail{margin:4px 0 0;font-size:15px;line-height:1.45;color:var(--pbb-muted);text-wrap:pretty}
.cf-product-buy-box .pbb-item-value{padding:5px 12px;border-radius:999px;background:color-mix(in oklch,var(--pbb-band) 8%,var(--card));border:1px solid color-mix(in oklch,var(--pbb-band) 12%,var(--card));color:var(--ink);font-family:var(--font-display);font-weight:800;font-size:14px;line-height:1.2;white-space:nowrap}
.cf-product-buy-box .pbb-total{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;padding:14px 16px;border-radius:var(--card-radius, var(--radius,16px));background:color-mix(in oklch,var(--ink) 4%,var(--card));border:1px solid oklch(from var(--ink) l c h / 0.08);box-shadow:none}
.cf-product-buy-box .pbb-total-was{font-size:15px;font-weight:700;line-height:1.3;color:var(--muted)}
.cf-product-buy-box .pbb-total-was s{margin-left:4px;font-family:var(--font-display);font-weight:800;font-size:17px;text-decoration-color:var(--danger);text-decoration-thickness:2px;color:var(--danger)}
.cf-product-buy-box .pbb-total-today{display:inline-flex;align-items:baseline;gap:8px;font-size:15px;font-weight:700;line-height:1.2;color:var(--ink)}
.cf-product-buy-box .pbb-total-today strong{font-family:var(--font-display);font-weight:900;font-size:26px;line-height:1;letter-spacing:-.02em;color:var(--ink)}
.cf-product-buy-box .pbb-steps{list-style:none;margin:0;padding:0;display:grid;gap:14px;counter-reset:pbb}
.cf-product-buy-box .pbb-steps li{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;align-items:start;counter-increment:pbb}
.cf-product-buy-box .pbb-steps li::before{content:counter(pbb);width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--pbb-band);color:var(--pbb-band-ink);font-family:var(--font-display);font-weight:800;font-size:15px;box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .2),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.35)}
.cf-product-buy-box .pbb-steps .pbb-item-name{padding-top:5px}
.cf-product-buy-box .pbb-rise{animation:pbb-rise .45s cubic-bezier(.2,.7,.3,1) both}
.cf-product-buy-box .pbb-details.pbb-rise{animation-delay:.08s}
@keyframes pbb-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes pbb-stamp{0%{opacity:0;transform:rotate(-26deg) scale(1.35)}60%{opacity:1;transform:rotate(-5deg) scale(.95)}100%{opacity:1;transform:rotate(-8deg) scale(1)}}
@keyframes pbb-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(3px)}30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}
@media (max-width:440px){
.cf-product-buy-box .pbb-plate{padding:20px 16px 18px}
.cf-product-buy-box .pbb-chip{flex:1 1 auto;padding:0 14px}
.cf-product-buy-box .pbb-cta{gap:10px;padding:14px 12px}
.cf-product-buy-box .pbb-item{grid-template-columns:56px minmax(0,1fr)}
.cf-product-buy-box .pbb-item[data-thumb=false]{grid-template-columns:minmax(0,1fr)}
.cf-product-buy-box .pbb-thumb{width:56px;height:56px}
.cf-product-buy-box .pbb-item-value{grid-column:2;justify-self:start}
.cf-product-buy-box .pbb-item[data-thumb=false] .pbb-item-value{grid-column:1}
}
@media (prefers-reduced-motion:reduce){
.cf-product-buy-box *,.cf-product-buy-box *::before,.cf-product-buy-box *::after,.cf-product-buy-box .pbb-seal,.cf-product-buy-box .pbb-chip,.cf-product-buy-box .pbb-tick,.cf-product-buy-box .pbb-step,.cf-product-buy-box .pbb-alert,.cf-product-buy-box .pbb-cta,.cf-product-buy-box .pbb-cta:hover:not(:disabled)::after,.cf-product-buy-box .pbb-cta[data-force=hover]::after,.cf-product-buy-box .pbb-spin,.cf-product-buy-box .pbb-acc,.cf-product-buy-box .pbb-acc-btn,.cf-product-buy-box .pbb-acc-ico,.cf-product-buy-box .pbb-acc-chev,.cf-product-buy-box .pbb-acc-panel,.cf-product-buy-box .pbb-acc-inner,.cf-product-buy-box .pbb-acc[data-open=true] .pbb-acc-inner,.cf-product-buy-box .pbb-rise,.cf-product-buy-box .pbb-details.pbb-rise{animation:none;transition-duration:.01ms;transition-delay:0s}
.cf-product-buy-box .pbb-cta:hover:not(:disabled),.cf-product-buy-box .pbb-cta[data-force=hover],.cf-product-buy-box .pbb-chip:hover{transform:none}
.cf-product-buy-box .pbb-cta:hover:not(:disabled)::after,.cf-product-buy-box .pbb-cta[data-force=hover]::after{transform:translateX(-120%)}
.cf-product-buy-box .pbb-card:hover .pbb-seal{rotate:0deg;scale:1}
}
`
pieces/offer/product-buy-box/specimen.tsx 91 lines
import __studioImagebcac0e4c from "../assets/5a4987dfe2c67b00.webp";
import * as React from "react"
import { ProductBuyBox, type ProductBuyBoxState } from "../product-buy-box"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
const sample = defaults.sample
export default function ProductBuyBoxSpecimen({ state = "default" }: { state?: string }) {
return (
<div>
<ProductBuyBox
state={state as ProductBuyBoxState}
name={sample.name}
priceLabel={sample.todayLabel}
price={sample.price}
compareAt={sample.regularPrice}
priceNote={sample.note}
sealGuaranteeImage={slot("seal-guarantee", __studioImagebcac0e4c)}
variants={[
{
name: "format",
label: "Workbook format",
defaultValue: "fillable",
options: [
{ value: "fillable", label: "Fillable PDF" },
{ value: "print", label: "Print-ready PDF" },
{ value: "docs", label: "Google Docs" },
],
},
{
name: "cover",
label: "Cover colour",
defaultValue: "navy",
options: [
{ value: "navy", label: "Navy", swatch: "var(--band)" },
{ value: "red", label: "Red", swatch: "var(--cta)" },
{ value: "cream", label: "Cream", swatch: "var(--card)" },
],
},
]}
quantity={{ min: 1, max: 10 }}
label="Yes! Add To My Cart"
sublabel={sample.sublabel}
assurances={[
{
icon: "shipping",
title: "Instant digital delivery",
text: "Nothing to ship. Download right after checkout.",
},
{
icon: "returns",
title: "No-hassle refunds",
text: "One email within 30 days. No return shipping.",
},
{
icon: "guarantee",
title: "30-day money-back guarantee",
text: "Use the whole kit. Not a fit? Every cent back.",
},
]}
details={[
{
id: "included",
title: "What’s included",
icon: "included",
items: sample.items.map((it, i) => ({
name: it.name,
detail: it.detail,
value: it.value,
itemImage: slot(`item-${i + 1}`, it.image),
imageAlt: it.imageAlt,
})),
},
{
id: "how",
title: "How to use it",
icon: "steps",
steps: [
{ title: "Plan with the guide", text: sample.items[0].detail },
{ title: "Write with the workbook", text: sample.items[1].detail },
{ title: "Check with the checklist", text: sample.items[2].detail },
],
},
]}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
name RequiredProductBuyBox |
string |
|
priceLabel OptionalProductBuyBox |
string |
|
price RequiredProductBuyBox |
string |
|
compareAt OptionalProductBuyBox |
string |
|
compareLabel OptionalProductBuyBox |
string |
Default "Regular"
|
priceNote OptionalProductBuyBox |
string |
|
variants OptionalProductBuyBox |
BuyBoxVariantGroup[] |
Default []
|
quantity OptionalProductBuyBox |
{ min?: number; max?: number; initial?: number } |
|
label OptionalProductBuyBox |
string |
Default "Add To Cart"
|
loadingLabel OptionalProductBuyBox |
string |
|
addedLabel OptionalProductBuyBox |
string |
|
sublabel OptionalProductBuyBox |
string |
|
assurances OptionalProductBuyBox |
BuyBoxAssurance[] |
Default []
|
details OptionalProductBuyBox |
BuyBoxDetail[] |
Default []
|
sealGuaranteeImage OptionalProductBuyBox |
string |
|
sealAlt OptionalProductBuyBox |
string |
Default ""
|
successTitle OptionalProductBuyBox |
string |
|
checkoutLabel OptionalProductBuyBox |
string |
|
checkoutHref OptionalProductBuyBox |
string |
|
keepShoppingLabel OptionalProductBuyBox |
string |
|
errorText OptionalProductBuyBox |
string |
Default "We couldn’t add this to your cart. Please try again."
|
disabled OptionalProductBuyBox |
boolean |
Default false
|
state OptionalProductBuyBox |
ProductBuyBoxState |
Default "default"
|
copy OptionalProductBuyBox |
Partial<ProductBuyBoxCopy> |
|
onSubmit OptionalProductBuyBox |
(order: { quantity: number; options: Record<string, string> }) => void |
Default onAddToCart
|
onAddToCart OptionalProductBuyBox |
(order: { quantity: number; options: Record<string, string> }) => void |
|
href OptionalProductBuyBox |
string |
Default checkoutHref
|
onAction OptionalProductBuyBox |
() => void |
Default onCheckout
|
onCheckout OptionalProductBuyBox |
() => void |
|
className OptionalProductBuyBox |
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.
--field--field-border--field-focus--field-ink--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-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
5a4987dfe2c67b00.webp
image/webp · 371 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB