Preorder 3
Early-bird pre-order staircase. Prices climb left to right as physical steps. The chosen step carries a quantity stepper with a live total, a reason-why tile explains the lower price, and a dark action tile sets the total against the later price.
Use it in a prompt
Use offer/preorder-3 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/preorder-3.tsx. - Import it and pass your copy and images (Props tab):
import { Preorder3 } from "@/components/funneldna/offer/preorder-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/preorder-3/component.tsx 640 lines
// layout: bento-grid
// Early-bird pre-order staircase. Prices climb left to right as physical steps. The chosen step carries a quantity stepper with a live total, a reason-why tile explains the lower price, and a dark action tile sets the total against the later price.
import * as React from "react"
import { motion, useReducedMotion } from "motion/react"
import { CalendarClock, Check, CreditCard, Minus, Plus, ShieldCheck, TrendingUp } from "lucide-react"
export type Preorder3Tier = {
id: string
/** Step name, e.g. "Early bird" */
name: string
/** Supplied price per copy, e.g. "$29" */
price: string
/** What this step includes; every step is compared against the full list */
includes?: string[]
/** Supplied only: the step is full and shows its gone state */
gone?: boolean
/** A price that applies later (e.g. retail after launch): shown on the staircase, not choosable */
later?: boolean
/** Status chip text for a later step, e.g. "From launch day" */
when?: string
/** How a later step reads beside today's total, e.g. "once it's in shops" */
alternative?: string
}
export type Preorder3Reason = {
/** Set bold, e.g. "You're funding the first print run." */
title: string
text?: string
}
export type Preorder3Order = { tier: Preorder3Tier; quantity: number; total: string }
export type Preorder3Copy = {
stepsHeading: string
openLabel: string
goneLabel: string
laterLabel: string
eachLabel: string
chooseLabel: string
/** Screen-reader prefix on rows a step does not include */
notIncluded: string
quantityLabel: string
fewerLabel: string
moreLabel: string
/** {quantity}, {price} and {total} are replaced */
lineTotal: string
/** {max} is replaced; shown when the stepper reaches its limit */
maxNote: string
copyOne: string
copyMany: string
/** {tier} is replaced by the chosen step's name */
actionHeading: string
/** {quantity}, {copies} and {tier} are replaced */
summary: string
/** {total} becomes the struck later total, {alternative} the later step's wording */
anchor: string
/** Used as {alternative} when the later step has none; {tier} is replaced */
anchorFallback: string
/** {month} is replaced by the ship month */
shipsLabel: string
/** {amount} is replaced by the price climb between two steps */
riserLabel: string
closedHeading: string
}
export type Preorder3Props = {
headline?: React.ReactNode
/** Phrase inside a string headline set in the accent colour */
highlight?: string
lead?: React.ReactNode
/** Book and author line, e.g. "A hardcover cookbook by Mara Ellison" */
byline?: string
/** Short supplied facts shown as chips */
facts?: string[]
/** The photo tile (scene slot): the product in use */
image?: string
imageAlt?: string
/** The staircase, cheapest first */
tiers?: Preorder3Tier[]
defaultTierId?: string
defaultQuantity?: number
minQuantity?: number
maxQuantity?: number
reasonsHeading?: string
/** Reason-why list for the lower price, numbered inline */
reasons?: Preorder3Reason[]
/** Product name used in the button, e.g. "The Pantry Garden" */
product?: string
/** Button template; {product} is replaced */
label?: string
/** Supplied ship month, e.g. "March 2027" */
shipMonth?: string
/** Supplied charge timing, e.g. "Your card is charged when your book ships." */
chargeTiming?: string
/** Supplied guarantee line */
guarantee?: string
href?: string
onAction?: (order: Preorder3Order) => void
/** Pre-orders closed: steps and button are disabled */
closed?: boolean
state?: "default" | "hover" | "active" | "disabled"
copy?: Partial<Preorder3Copy>
className?: string
}
const DEFAULT_COPY: Preorder3Copy = {
stepsHeading: "Pick your step. The earlier you order, the less you pay.",
openLabel: "Open now",
goneLabel: "Gone",
laterLabel: "After launch",
eachLabel: "each",
chooseLabel: "Choose this step",
notIncluded: "Not included:",
quantityLabel: "How many copies?",
fewerLabel: "One fewer copy",
moreLabel: "One more copy",
lineTotal: "{quantity} × {price} = {total}",
maxNote: "{max} copies is the most per order.",
copyOne: "copy",
copyMany: "copies",
actionHeading: "Lock in the {tier} price",
summary: "{quantity} {copies} at the {tier} price",
anchor: "vs. {total} {alternative}",
anchorFallback: "at the {tier} price",
shipsLabel: "Ships {month}",
riserLabel: "+{amount}",
closedHeading: "Pre-orders are closed right now",
}
const DEFAULT_REASONS: Preorder3Reason[] = [
{ title: "You're funding the first print run.", text: "Early orders tell the printer how many to make and help pay for the press." },
{ title: "You wait a little longer.", text: "The lowest step is your reward for ordering before the ship date." },
{ title: "The price climbs in steps.", text: "Each later step costs more, so the earliest open step is the best price on the staircase." },
]
export function Preorder3(props: Preorder3Props) {
const {
headline = "Pre-order early and pay the lowest step",
highlight = "the lowest step",
lead = "Every copy ordered before launch helps pay for the first print run, so the earliest step costs the least.",
byline = "",
facts = [],
image,
imageAlt = "",
tiers = [],
defaultTierId,
defaultQuantity = 1,
minQuantity = 1,
maxQuantity = 10,
reasonsHeading = "Why it costs less right now",
reasons = DEFAULT_REASONS,
product = "my copies",
label = "Yes! I want {product}",
shipMonth = "",
chargeTiming = "",
guarantee = "",
href,
onAction,
closed = false,
state = "default",
copy: copyProp,
className,
} = props
const copy: Preorder3Copy = { ...DEFAULT_COPY, ...copyProp }
const reduce = useReducedMotion()
const uid = React.useId()
const headingId = `${uid}-h`
const stepsId = `${uid}-steps`
const qtyId = `${uid}-qty`
const lo = Math.max(1, Math.floor(minQuantity))
const hi = Math.max(lo, Math.floor(maxQuantity))
const [qty, setQty] = React.useState(() => clamp(Math.floor(defaultQuantity), lo, hi))
const q = clamp(qty, lo, hi)
const firstOpen = tiers.findIndex(isOpen)
const [selectedId, setSelectedId] = React.useState<string | undefined>(() => {
const d = tiers.find((t) => t.id === defaultTierId && isOpen(t))
return d?.id ?? tiers[firstOpen]?.id
})
const chosen = tiers.find((t) => t.id === selectedId && isOpen(t)) ?? (firstOpen >= 0 ? tiers[firstOpen] : undefined)
const isClosed = closed || state === "disabled" || !chosen
const features: string[] = []
for (const t of tiers) for (const f of t.includes ?? []) if (!features.includes(f)) features.push(f)
const prices = tiers.map((t) => parseMoney(t.price))
const cp = chosen ? parseMoney(chosen.price) : null
const total = chosen ? (cp ? formatMoney(cp, cp.value * q) : chosen.price) : ""
const alt = [...tiers].reverse().find((t) => t.later)
const ap = alt ? parseMoney(alt.price) : null
const altTotal = cp && ap && ap.value > cp.value ? formatMoney(ap, ap.value * q) : ""
const copies = q === 1 ? copy.copyOne : copy.copyMany
const anchorParts = alt
? fill(copy.anchor, { alternative: alt.alternative ?? fill(copy.anchorFallback, { tier: alt.name }), quantity: q, copies }).split("{total}")
: []
const lineParts = chosen ? fill(copy.lineTotal, { quantity: q, price: chosen.price }).split("{total}") : []
let head: React.ReactNode = headline
if (typeof headline === "string" && highlight && headline.includes(highlight)) {
const at = headline.indexOf(highlight)
head = (
<>
{headline.slice(0, at)}
<span className="po3-em">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
}
const fire = () => {
if (chosen && !isClosed) onAction?.({ tier: chosen, quantity: q, total })
}
const ctaClass = cx("po3-cta", state === "hover" && "is-hover", state === "active" && "is-active")
const ctaText = fill(label, { product })
const hasPhoto = !!image
const hasReasons = reasons.length > 0
const delay = (n: number) => ({ "--d": `${Math.min(n * 0.07, 0.28)}s` }) as React.CSSProperties
const stepper = chosen ? (
<div className="po3-qty">
<span className="po3-qlabel" id={qtyId}>
{copy.quantityLabel}
</span>
<div className="po3-qrow">
<div className="po3-qctl" role="group" aria-labelledby={qtyId}>
<button
type="button"
className="po3-qbtn"
aria-label={copy.fewerLabel}
disabled={q <= lo}
onClick={() => setQty(clamp(q - 1, lo, hi))}
>
<Minus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<output className="po3-qval" aria-labelledby={qtyId}>
{q}
</output>
<button
type="button"
className="po3-qbtn"
aria-label={copy.moreLabel}
disabled={q >= hi}
onClick={() => setQty(clamp(q + 1, lo, hi))}
>
<Plus size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
<span className="po3-qline" aria-live="polite">
{lineParts.length > 1 ? (
<>
{lineParts[0]}
<strong>{total}</strong>
{lineParts[1]}
</>
) : (
lineParts[0]
)}
</span>
</div>
{q >= hi && hi > lo ? <p className="po3-qnote">{fill(copy.maxNote, { max: hi })}</p> : null}
</div>
) : null
return (
<section className={cx("cf-preorder-3", className)} aria-labelledby={headingId}>
<style>{CSS}</style>
<div className={cx("po3-wrap", !hasPhoto && "no-photo", !hasReasons && "no-reasons")}>
<div className="po3-tile po3-promise po3-rv">
<h2 id={headingId} className="po3-h2">
{head}
</h2>
{lead ? <p className="po3-lead">{lead}</p> : null}
{byline || facts.length > 0 ? (
<div className="po3-meta">
{byline ? <p className="po3-byline">{byline}</p> : null}
{facts.map((f) => (
<span key={f} className="po3-chip">
{f}
</span>
))}
</div>
) : null}
</div>
{hasPhoto ? (
<figure className="po3-photo po3-rv" style={delay(1)}>
<img src={image} alt={imageAlt} width={1536} height={1024} loading="lazy" decoding="async" />
</figure>
) : null}
{hasReasons ? (
<div className="po3-tile po3-reasons po3-rv" style={delay(2)}>
<h3 className="po3-h3">{reasonsHeading}</h3>
<ol>
{reasons.map((r, i) => (
<li key={i}>
<span className="po3-num" aria-hidden="true">
{i + 1}
</span>
<p>
<strong>{r.title}</strong>
{r.text ? ` ${r.text}` : ""}
</p>
</li>
))}
</ol>
</div>
) : null}
{tiers.length > 0 ? (
<div className="po3-steps">
<h3 id={stepsId} className="po3-h3">
{copy.stepsHeading}
</h3>
<div
className="po3-stairs"
role="radiogroup"
aria-labelledby={stepsId}
style={{ "--n": tiers.length } as React.CSSProperties}
>
{tiers.map((t, i) => {
const rid = `${uid}-t${i}`
const open = isOpen(t)
const can = open && !isClosed
const active = !isClosed && chosen?.id === t.id
const prev = i > 0 ? prices[i - 1] : null
const cur = prices[i]
const delta = prev && cur && cur.value > prev.value ? formatMoney(cur, cur.value - prev.value) : ""
const status = t.gone ? copy.goneLabel : t.later ? t.when || copy.laterLabel : isClosed ? "" : copy.openLabel
const described = [status ? `${rid}-s` : "", features.length ? `${rid}-l` : ""].filter(Boolean).join(" ")
return (
<div
key={t.id}
className={cx("po3-col po3-rv", i === firstOpen && "is-lead")}
style={{ "--i": i, "--d": `${Math.min((i + 2) * 0.07, 0.28)}s` } as React.CSSProperties}
>
<div className={cx("po3-step", active && "is-chosen", t.gone && "is-gone", !can && "is-off")}>
<input
className="po3-radio"
type="radio"
id={rid}
name={`${uid}-tier`}
value={t.id}
checked={active}
disabled={!can}
onChange={() => setSelectedId(t.id)}
aria-labelledby={`${rid}-n ${rid}-p`}
aria-describedby={described || undefined}
/>
<div className="po3-top">
{status ? (
<span className="po3-chip" id={`${rid}-s`}>
{open ? <span className="po3-dot" aria-hidden="true" /> : null}
{status}
</span>
) : (
<span />
)}
<span className="po3-tick" aria-hidden="true">
{active ? <Check size={16} strokeWidth={3} /> : null}
</span>
</div>
<span className="po3-name" id={`${rid}-n`}>
{t.name}
</span>
<span className="po3-price" id={`${rid}-p`}>
<span className="po3-pnum">{t.price}</span>
<span className="po3-each">{copy.eachLabel}</span>
</span>
{features.length > 0 ? (
<ul className="po3-incl" id={`${rid}-l`}>
{features.map((f) => {
const has = (t.includes ?? []).includes(f)
return (
<li key={f} className={has ? undefined : "is-no"}>
{has ? (
<Check size={18} strokeWidth={2.5} aria-hidden="true" />
) : (
<Minus size={18} strokeWidth={2.5} aria-hidden="true" />
)}
<span>
{has ? null : <span className="po3-sr">{copy.notIncluded} </span>}
{f}
</span>
</li>
)
})}
</ul>
) : null}
<div className="po3-foot">
{active ? (
stepper
) : can ? (
<span className="po3-choose" aria-hidden="true">
{copy.chooseLabel}
</span>
) : null}
</div>
</div>
{i > 0 ? (
<div className="po3-riser" aria-hidden="true">{delta ? (
<>
<TrendingUp size={16} strokeWidth={2.5} />
<span>{fill(copy.riserLabel, { amount: delta })}</span>
</>
) : null}</div>
) : null}
</div>
)
})}
</div>
</div>
) : null}
<div className="po3-tile po3-act po3-rv" style={delay(3)}>
<h3 className="po3-h3">
{isClosed || !chosen ? copy.closedHeading : fill(copy.actionHeading, { tier: chosen.name })}
</h3>
{!isClosed && chosen ? (
<>
<p className="po3-sum">{fill(copy.summary, { quantity: q, copies, tier: chosen.name })}</p>
<p className="po3-total">
<motion.span
key={total}
initial={reduce ? false : { opacity: 0.82, y: 6 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3, ease: [0.2, 0.7, 0.2, 1] }}
>
{total}
</motion.span>
</p>
{altTotal && anchorParts.length > 1 ? (
<p className="po3-anchor">
{anchorParts[0]}
<s>{altTotal}</s>
{anchorParts[1]}
</p>
) : null}
</>
) : null}
<div className="po3-go">
{href && !isClosed ? (
<a className={ctaClass} href={href} onClick={fire}>
{ctaText}
</a>
) : (
<button type="button" className={ctaClass} disabled={isClosed} onClick={fire}>
{ctaText}
</button>
)}
</div>
{shipMonth || chargeTiming || guarantee ? (
<ul className="po3-reass">
{shipMonth ? (
<li>
<CalendarClock size={16} strokeWidth={2.5} aria-hidden="true" />
{fill(copy.shipsLabel, { month: shipMonth })}
</li>
) : null}
{chargeTiming ? (
<li>
<CreditCard size={16} strokeWidth={2.5} aria-hidden="true" />
{chargeTiming}
</li>
) : null}
{guarantee ? (
<li>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden="true" />
{guarantee}
</li>
) : null}
</ul>
) : null}
</div>
</div>
</section>
)
}
export default Preorder3
type Money = { prefix: string; suffix: string; value: number; decimals: number }
function isOpen(t: Preorder3Tier) {
return !t.gone && !t.later
}
function clamp(n: number, lo: number, hi: number) {
if (!Number.isFinite(n)) return lo
return Math.min(hi, Math.max(lo, n))
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(" ")
}
function fill(template: string, vars: Record<string, string | number>) {
return Object.keys(vars).reduce((s, k) => s.split(`{${k}}`).join(String(vars[k])), template)
}
function isDigit(ch: string) {
return ch >= "0" && ch <= "9"
}
function parseMoney(input?: string): Money | null {
if (!input) return null
const str = input.trim()
let start = -1
for (let i = 0; i < str.length; i++) {
if (isDigit(str[i])) {
start = i
break
}
}
if (start < 0) return null
let end = start
while (end < str.length && (isDigit(str[end]) || str[end] === "," || str[end] === ".")) end++
const digits = str.slice(start, end).split(",").join("")
const value = Number(digits)
if (!Number.isFinite(value)) return null
const dot = digits.indexOf(".")
return { prefix: str.slice(0, start), suffix: str.slice(end), value, decimals: dot < 0 ? 0 : digits.length - dot - 1 }
}
function formatMoney(m: Money, value: number) {
const n = value.toLocaleString("en-US", { minimumFractionDigits: m.decimals, maximumFractionDigits: m.decimals })
return `${m.prefix}${n}${m.suffix}`
}
const CSS = `
.cf-preorder-3{--po3-gap:clamp(16px,2vw,24px);--po3-stair:44px;--po3-shadow:var(--shadow, oklch(0.22 0.03 260));position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-preorder-3 *,.cf-preorder-3 *::before,.cf-preorder-3 *::after{box-sizing:border-box}
.cf-preorder-3 .po3-wrap{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr);gap:var(--po3-gap)}
.cf-preorder-3 .po3-tile{min-width:0;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-md, 0 1px 2px oklch(0.22 0.03 260 / .22), 0 4px 10px -2px oklch(0.22 0.03 260 / .2)));padding:clamp(20px,3vw,32px)}
.cf-preorder-3 .po3-promise{display:flex;flex-direction:column;padding:clamp(24px,3.6vw,44px)}
.cf-preorder-3 .po3-h2{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(--ink)}
.cf-preorder-3 .po3-em{color:var(--accent)}
.cf-preorder-3 .po3-lead{margin:0 0 24px;max-width:56ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:var(--ink)}
.cf-preorder-3 .po3-meta{margin-top:auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.cf-preorder-3 .po3-byline{margin:0 0 4px;width:100%;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-preorder-3 .po3-chip{display:inline-flex;align-items:center;gap:8px;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
.cf-preorder-3 .po3-photo{position:relative;margin:0;min-width:0;border-radius:12px;overflow:hidden;aspect-ratio:4/3;max-height:440px;background:color-mix(in oklch, var(--ink) 6%, var(--surface))}
.cf-preorder-3 .po3-photo img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 55%}
.cf-preorder-3 .po3-h3{margin:0 0 20px;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-preorder-3 .po3-reasons ol{list-style:none;margin:0;padding:0;display:grid;gap:16px}
.cf-preorder-3 .po3-reasons li{display:grid;grid-template-columns:1.4em minmax(0,1fr);gap:12px;align-items:baseline}
.cf-preorder-3 .po3-num{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--accent);font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-reasons p{margin:0;text-wrap:pretty}
.cf-preorder-3 .po3-reasons strong{font-weight:700}
.cf-preorder-3 .po3-steps{min-width:0;padding:8px 0}
.cf-preorder-3 .po3-steps > .po3-h3{margin-bottom:24px}
.cf-preorder-3 .po3-stairs{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.cf-preorder-3 .po3-col{display:flex;flex-direction:column;min-width:0}
.cf-preorder-3 .po3-col.is-lead{order:-1}
.cf-preorder-3 .po3-riser{order:-1;align-self:center;display:inline-flex;align-items:center;gap:6px;min-height:28px;margin:0 0 8px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--surface));color:var(--ink);font-family:var(--font-display);font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-riser svg{flex:none;color:var(--accent)}
.cf-preorder-3 .po3-riser:empty,.cf-preorder-3 .po3-col.is-lead .po3-riser{display:none}
.cf-preorder-3 .po3-step{position:relative;z-index:1;flex:1 1 auto;display:flex;flex-direction:column;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(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / .18), 0 1px 3px oklch(0.22 0.03 260 / .14));padding:clamp(18px,2.2vw,24px);cursor:pointer;transition:border-color .16s ease, box-shadow .16s ease, transform .16s ease, background-color .16s ease}
.cf-preorder-3 .po3-step:not(.is-off):not(.is-chosen):hover{border-color:oklch(from var(--accent) l c h / .55);box-shadow:var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / .22), 0 4px 10px -2px oklch(0.22 0.03 260 / .2))}
.cf-preorder-3 .po3-step:not(.is-off):has(.po3-radio:active){transform:scale(.985)}
.cf-preorder-3 .po3-step:has(.po3-radio:focus-visible){outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .6);outline-offset:3px}
.cf-preorder-3 .po3-step.is-chosen{background:color-mix(in oklch, var(--accent) 7%, var(--card));border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent), var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 260 / .22), 0 12px 24px -8px oklch(0.22 0.03 260 / .32))}
.cf-preorder-3 .po3-step.is-off{cursor:default;background:color-mix(in oklch, var(--ink) 4%, var(--card));box-shadow:none}
.cf-preorder-3 .po3-radio{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;appearance:none;cursor:inherit;border-radius:inherit}
.cf-preorder-3 .po3-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px}
.cf-preorder-3 .po3-dot{flex:none;width:8px;height:8px;border-radius:999px;background:var(--success)}
.cf-preorder-3 .po3-tick{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:999px;border:2px solid oklch(from var(--ink) l c h / .28);background:var(--card);color:var(--accent-fill-ink, var(--card));transition:background-color .16s ease, border-color .16s ease}
.cf-preorder-3 .is-chosen .po3-tick{background:var(--accent-fill, var(--accent));border-color:var(--accent-fill, var(--accent))}
.cf-preorder-3 .is-off .po3-tick{visibility:hidden}
.cf-preorder-3 .po3-tick svg{animation:po3-pop .3s ease both}
.cf-preorder-3 .po3-name{display:block;margin:0 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-preorder-3 .po3-price{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:0 0 20px}
.cf-preorder-3 .po3-pnum{font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-each{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-preorder-3 .is-gone .po3-pnum{color:var(--muted);text-decoration:line-through;text-decoration-thickness:3px;text-decoration-color:var(--danger)}
.cf-preorder-3 .po3-incl{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.cf-preorder-3 .po3-incl li{display:grid;grid-template-columns:18px minmax(0,1fr);gap:10px;align-items:start;line-height:1.4;text-wrap:pretty}
.cf-preorder-3 .po3-incl svg{margin-top:.15em;color:var(--success)}
.cf-preorder-3 .po3-incl li.is-no,.cf-preorder-3 .po3-incl li.is-no svg{color:var(--muted)}
.cf-preorder-3 .po3-foot{position:relative;z-index:2;margin-top:auto;padding-top:20px;pointer-events:none}
.cf-preorder-3 .is-chosen .po3-foot{pointer-events:auto}
.cf-preorder-3 .po3-choose{display:flex;align-items:center;justify-content:center;min-height:48px;padding:8px 16px;border:1px solid var(--button-2-border, transparent);border-radius:var(--button-radius, var(--radius, 12px));background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));box-shadow:var(--button-2-shadow, var(--shadow-sm));font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight, 800);text-transform:var(--button-case, none);font-size:.9375rem;line-height:1.2;text-align:center;transition:background-color .16s ease}
.cf-preorder-3 .po3-step:hover .po3-choose{background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - .04) c h)}
.cf-preorder-3 .po3-qty{border-radius:10px;padding:12px 14px 14px;background:oklch(from var(--ink) l c h / .05)}
.cf-preorder-3 .po3-qlabel{display:block;margin:0 0 8px;font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--label-ink, var(--ink))}
.cf-preorder-3 .po3-qrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.cf-preorder-3 .po3-qctl{display:inline-flex;align-items:center;gap:4px;padding:4px;background:var(--field, var(--card));color:var(--field-ink, var(--ink));border:1px solid var(--field-border, color-mix(in oklch, var(--ink) 22%, transparent));border-radius:var(--field-radius, var(--radius, 12px))}
.cf-preorder-3 .po3-qbtn{appearance:none;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--button-2-border, transparent);border-radius:max(0px, calc(var(--field-radius, var(--radius, 12px)) - 4px));background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));box-shadow:var(--button-2-shadow, var(--shadow-sm));cursor:pointer;transition:background-color .16s ease, transform .16s ease, box-shadow .16s ease}
.cf-preorder-3 .po3-qbtn:hover:not(:disabled){background:oklch(from var(--button-2-bg, var(--secondary)) calc(l - .05) c h)}
.cf-preorder-3 .po3-qbtn:active:not(:disabled){transform:translateY(1px);box-shadow:none}
.cf-preorder-3 .po3-qbtn:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .6);outline-offset:2px}
.cf-preorder-3 .po3-qbtn:disabled{cursor:not-allowed;background:transparent;box-shadow:none;color:color-mix(in oklch, var(--field-ink, var(--ink)) 35%, var(--field, var(--card)))}
.cf-preorder-3 .po3-qval{min-width:48px;text-align:center;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-qline{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-qline strong{font-weight:800}
.cf-preorder-3 .po3-qnote{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ink)}
.cf-preorder-3 .po3-act{display:flex;flex-direction:column;background:var(--band);color:var(--band-ink);border-color:oklch(from var(--band-ink) l c h / .14)}
.cf-preorder-3 .po3-act .po3-h3{margin-bottom:12px;color:var(--band-ink)}
.cf-preorder-3 .po3-sum{margin:0 0 8px;font-weight:500;text-wrap:pretty}
.cf-preorder-3 .po3-total{margin:0;font-family:var(--font-display);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-preorder-3 .po3-total span{display:inline-block}
.cf-preorder-3 .po3-anchor{margin:12px 0 0;font-weight:600;text-wrap:pretty}
.cf-preorder-3 .po3-anchor s{text-decoration-thickness:2px}
.cf-preorder-3 .po3-go{margin-top:24px}
.cf-preorder-3 .po3-act .po3-h3 + .po3-go{margin-top:12px}
.cf-preorder-3 .po3-cta{appearance:none;display:flex;align-items:center;justify-content:center;width:100%;min-height:64px;padding:12px 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.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;text-decoration:none;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(--po3-shadow) l c h / .35), 0 8px 16px -6px oklch(from var(--po3-shadow) l c h / .5));transition:transform .16s ease, box-shadow .16s ease, background .16s ease}
.cf-preorder-3 .po3-cta:hover:not(:disabled),.cf-preorder-3 .po3-cta.is-hover: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));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 - .18) c h), 0 1px 2px oklch(from var(--po3-shadow) l c h / .4), 0 10px 18px -6px oklch(from var(--po3-shadow) l c h / .6))}
.cf-preorder-3 .po3-cta:active:not(:disabled),.cf-preorder-3 .po3-cta.is-active:not(:disabled){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg, var(--cta)) calc(l - .22) 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(--po3-shadow) l c h / .3)}
.cf-preorder-3 .po3-cta:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-preorder-3 .po3-cta:disabled{cursor:not-allowed;background:var(--button-2-bg, var(--secondary));color:var(--button-2-ink, var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow, var(--shadow-sm))}
.cf-preorder-3 .po3-reass{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:8px;font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-preorder-3 .po3-reass svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-preorder-3 .po3-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-preorder-3 .po3-rv{animation:po3-in .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
@keyframes po3-in{from{opacity:.82;transform:translateY(8px)}}
@keyframes po3-grow{from{transform:scaleY(.35)}}
@keyframes po3-pop{from{transform:scale(.9)}}
@media (max-width:420px){.cf-preorder-3 .po3-cta{font-size:1rem;padding:12px 14px}}
@media (min-width:760px){
.cf-preorder-3 .po3-stairs{grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:clamp(12px,1.6vw,20px)}
.cf-preorder-3 .po3-col.is-lead{order:0}
.cf-preorder-3 .po3-col{padding-top:calc((var(--n,3) - 1 - var(--i,0)) * var(--po3-stair))}
.cf-preorder-3 .po3-col:not(:first-child) .po3-step{flex:0 0 auto}
.cf-preorder-3 .po3-riser,.cf-preorder-3 .po3-riser:empty,.cf-preorder-3 .po3-col.is-lead .po3-riser{display:flex;order:0;align-self:stretch;flex:1 0 auto;align-items:flex-start;justify-content:center;gap:6px;min-height:calc(var(--i,0) * var(--po3-stair) + 14px);margin:-14px 0 0;padding:30px 12px 16px;border-radius:0 0 var(--card-radius, var(--radius, 14px)) var(--card-radius, var(--radius, 14px));background:color-mix(in oklch, var(--ink) 7%, var(--surface));color:var(--ink);transform-origin:bottom;animation:po3-grow .5s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
}
@media (min-width:1024px){
.cf-preorder-3 .po3-wrap{grid-template-columns:repeat(12,minmax(0,1fr))}
.cf-preorder-3 .po3-promise{grid-column:1 / 8;grid-row:1}
.cf-preorder-3 .po3-photo{grid-column:8 / 13;grid-row:1;aspect-ratio:auto;max-height:none;min-height:340px}
.cf-preorder-3 .po3-wrap.no-photo .po3-promise{grid-column:1 / 13}
.cf-preorder-3 .po3-steps{grid-column:1 / 13;grid-row:2}
.cf-preorder-3 .po3-reasons{grid-column:1 / 7;grid-row:3}
.cf-preorder-3 .po3-act{grid-column:7 / 13;grid-row:3}
.cf-preorder-3 .po3-wrap.no-reasons .po3-act{grid-column:4 / 10}
}
@media (prefers-reduced-motion:reduce){
.cf-preorder-3 .po3-rv,.cf-preorder-3 .po3-riser,.cf-preorder-3 .po3-tick svg{animation:none}
.cf-preorder-3 .po3-step,.cf-preorder-3 .po3-tick,.cf-preorder-3 .po3-choose,.cf-preorder-3 .po3-qbtn,.cf-preorder-3 .po3-cta{transition:none}
.cf-preorder-3 .po3-step:not(.is-off):has(.po3-radio:active),.cf-preorder-3 .po3-qbtn:active:not(:disabled),.cf-preorder-3 .po3-cta:active:not(:disabled),.cf-preorder-3 .po3-cta.is-active:not(:disabled){transform:none}
}
`
pieces/offer/preorder-3/specimen.tsx 71 lines
import __studioImage9adb3f5c from "../assets/625d074c8a17c024.webp";
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
import { Preorder3, type Preorder3Tier, type Preorder3Reason } from "../preorder-3"
export const states = ["default", "hover", "active", "disabled"]
const tiers: Preorder3Tier[] = [
{
id: "early",
name: "Early bird",
price: "$29",
includes: ["Hardcover first edition", "Signed bookplate", "Digital edition"],
},
{
id: "preorder",
name: "Pre-order",
price: "$35",
includes: ["Hardcover first edition", "Digital edition"],
},
{
id: "retail",
name: "After launch",
price: "$45",
includes: ["Hardcover first edition"],
later: true,
when: "From launch day",
alternative: "once it's in shops",
},
]
const reasons: Preorder3Reason[] = [
{
title: "You're funding the first print run.",
text: "Every early order tells the printer how many copies to make and helps pay for the press.",
},
{
title: "You order straight from the author.",
text: "No bookshop markup sits between you and the book.",
},
{
title: "You wait until March 2027.",
text: "The lowest step is the thank-you for ordering before a single page is printed.",
},
]
export default function Preorder3Specimen({ state = "default" }: { state?: "default" | "hover" | "active" | "disabled" }) {
return (
<Preorder3
headline="Get The Pantry Garden for less by ordering before it's printed"
highlight="for less"
lead="Seasonal recipes built from what's already on your shelf. Order early and you pay the lowest step, with the most included."
byline="A hardcover cookbook by Mara Ellison"
facts={["Hardcover · 256 pages", "120 pantry-first recipes"]}
image={slot(
"scene",
__studioImage9adb3f5c
)}
imageAlt="The Pantry Garden cookbook open on a kitchen counter beside fresh basil and jars of beans"
tiers={tiers}
defaultQuantity={2}
reasonsHeading="Three reasons the early price is lower"
reasons={reasons}
product="The Pantry Garden"
shipMonth="March 2027"
chargeTiming="Your card is charged when your books ship, not before."
guarantee={defaults.sample.guarantee}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalPreorder3 |
React.ReactNode |
|
highlight OptionalPreorder3 |
string |
|
lead OptionalPreorder3 |
React.ReactNode |
|
byline OptionalPreorder3 |
string |
|
facts OptionalPreorder3 |
string[] |
|
image OptionalPreorder3 |
string |
|
imageAlt OptionalPreorder3 |
string |
|
tiers OptionalPreorder3 |
Preorder3Tier[] |
|
defaultTierId OptionalPreorder3 |
string |
|
defaultQuantity OptionalPreorder3 |
number |
|
minQuantity OptionalPreorder3 |
number |
|
maxQuantity OptionalPreorder3 |
number |
|
reasonsHeading OptionalPreorder3 |
string |
|
reasons OptionalPreorder3 |
Preorder3Reason[] |
|
product OptionalPreorder3 |
string |
|
label OptionalPreorder3 |
string |
|
shipMonth OptionalPreorder3 |
string |
|
chargeTiming OptionalPreorder3 |
string |
|
guarantee OptionalPreorder3 |
string |
|
href OptionalPreorder3 |
string |
|
onAction OptionalPreorder3 |
(order: Preorder3Order) => void |
|
closed OptionalPreorder3 |
boolean |
|
state OptionalPreorder3 |
"default" | "hover" | "active" | "disabled" |
|
copy OptionalPreorder3 |
Partial<Preorder3Copy> |
|
className OptionalPreorder3 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
625d074c8a17c024.webp
image/webp · 122 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB