Freebie Delivery 4
Thank-you spread for a free download: the guide's pages fan out to flip through before downloading, one big download button, a short letter, then one soft step to the paid offer.
Use it in a prompt
Use checkout/freebie-delivery-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/checkout/freebie-delivery-4.tsx. - Import it and pass your copy and images (Props tab):
import { FreebieDelivery4 } from "@/components/funneldna/checkout/freebie-delivery-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/freebie-delivery-4/component.tsx 513 lines
// layout: magazine-spread
// Thank-you spread for a free download: the guide's pages fan out to flip through before downloading, one big download button, a short letter, then one soft step to the paid offer.
import * as React from "react"
import { AlertCircle, ChevronLeft, ChevronRight, Loader2, Mail, Smartphone } from "lucide-react"
import { FX_HOST, Pattern } from "../fx/fx"
export type FreebieDelivery4Page = {
// Slot "item-n": a generated preview image of one page of the download.
image: string
alt?: string
title: string
detail?: string
}
export type FreebieDelivery4Props = {
headline?: string
// Phrase inside the headline set in the accent colour.
emphasis?: string
lead?: string
// Page previews fanned beside the copy; pages without an image are skipped.
pages?: FreebieDelivery4Page[]
// Accessible name of the page fan.
previewLabel?: string
prevLabel?: string
nextPageLabel?: string
// "{n}" is replaced with the page number.
dotLabel?: string
// "{n}" and "{total}" are replaced.
countLabel?: string
downloadLabel?: string
loadingLabel?: string
// Leads the button's second line, before file type and size.
freeLabel?: string
fileType?: string
fileSize?: string
// File URL; renders the button as a download link.
downloadHref?: string
// true keeps the server file name, a string renames the file.
download?: boolean | string
onDownload?: () => void
// Shows the preparing state on the button while the file is fetched.
loading?: boolean
inboxNote?: string
// Shown on touch devices only.
touchTip?: string
errorMessage?: string
// Large editorial line above the letter.
pullLine?: string
salutation?: string
paragraphs?: React.ReactNode[]
signOff?: string
// Name under the sign-off, set in the display face (a page may supply --signature-face).
signName?: string
signRole?: string
nextHeadline?: string
nextText?: string
nextLabel?: string
// Supplied price of the next offer and the alternative it replaces; both optional.
offerPrice?: string
offerAlternative?: string
// Destination of the soft next step.
nextHref?: string
// Handles the soft next-step click.
onAction?: () => void
state?: "default" | "hover" | "active" | "disabled" | "error"
className?: string
}
export function FreebieDelivery4(props: FreebieDelivery4Props) {
const {
headline = "Your next seven dinners are already planned",
emphasis = "already planned",
lead = "Flip through your free meal plan, then download it and keep it handy all week.",
pages = [],
previewLabel = "Preview the meal plan pages",
prevLabel = "Previous page",
nextPageLabel = "Next page",
dotLabel = "Show page {n}",
countLabel = "{n}/{total}",
downloadLabel = "Download my meal plan",
loadingLabel = "Preparing your plan…",
freeLabel = "Free",
fileType = "PDF",
fileSize,
downloadHref,
download = true,
onDownload,
loading = false,
inboxNote = "A copy is on its way to your inbox too.",
touchTip = "Save it to your phone: tap download, then keep it in your Files for the store.",
errorMessage = "Your download didn't start. Tap the button again, or open the copy in your inbox.",
pullLine = "Seven dinners. One shopping list.",
salutation = "Hi friend,",
paragraphs = DEFAULT_PARAGRAPHS,
signOff = "Happy cooking,",
signName,
signRole,
nextHeadline = "Rather skip the grocery run?",
nextText = "Your first box brings the ingredients for these recipes to your door.",
nextLabel = "Show me my first box",
offerPrice,
offerAlternative,
nextHref,
onAction,
state = "default",
className,
} = props
const headingId = React.useId()
const errorId = React.useId()
const pageList = pages.filter((page) => page && page.image)
const total = pageList.length
const [active, setActive] = React.useState(0)
const current = total ? Math.min(active, total - 1) : 0
const currentPage = pageList[current]
const go = React.useCallback(
(step: number) => {
if (!total) return
setActive((a) => (((Math.min(a, total - 1) + step) % total) + total) % total)
},
[total],
)
const startX = React.useRef<number | null>(null)
const swiped = React.useRef(false)
const onKey = (event: React.KeyboardEvent<HTMLDivElement>) => {
if (total < 2) return
if (event.key === "ArrowRight") {
event.preventDefault()
go(1)
} else if (event.key === "ArrowLeft") {
event.preventDefault()
go(-1)
} else if (event.key === "Home") {
event.preventDefault()
setActive(0)
} else if (event.key === "End") {
event.preventDefault()
setActive(total - 1)
}
}
const onPointerDown = (event: React.PointerEvent<HTMLDivElement>) => {
startX.current = event.clientX
swiped.current = false
}
const onPointerUp = (event: React.PointerEvent<HTMLDivElement>) => {
if (startX.current === null) return
const dx = event.clientX - startX.current
startX.current = null
if (Math.abs(dx) > 40 && total > 1) {
swiped.current = true
go(dx < 0 ? 1 : -1)
}
}
const onPointerCancel = () => {
startX.current = null
}
const onPageClick = (index: number, rel: number) => {
if (swiped.current) {
swiped.current = false
return
}
if (total < 2) return
if (rel === 0) go(1)
else setActive(index)
}
const disabled = state === "disabled"
const busy = loading && !disabled
const blocked = disabled || busy
const showError = state === "error" && !blocked
const meta = [freeLabel, fileType, fileSize].filter(Boolean).join(" · ")
const onDl = (event: React.MouseEvent<HTMLElement>) => {
if (blocked) {
event.preventDefault()
return
}
onDownload?.()
}
const btnClass = [
"fd4-btn",
state === "hover" && !blocked ? "is-hover" : "",
state === "active" && !blocked ? "is-active" : "",
busy ? "is-loading" : "",
]
.filter(Boolean)
.join(" ")
const inner = (
<>
<span className="fd4-btn-main">
{busy ? <Loader2 className="fd4-spin" strokeWidth={2.5} aria-hidden="true" /> : null}
<span>{busy ? loadingLabel : downloadLabel}</span>
</span>
{meta ? <span className="fd4-btn-sub">{meta}</span> : null}
</>
)
const downloadAttr = download === true ? "" : download === false ? undefined : download
return (
<section
className={["cf-freebie-delivery-4", className].filter(Boolean).join(" ")}
data-state={state}
aria-labelledby={headingId}
>
<style>{CSS}</style>
<div className={total ? "fd4-wrap" : "fd4-wrap is-solo"}>
<header className="fd4-head fd4-rise">
<h2 id={headingId} className="fd4-title">
{renderHeadline(headline, emphasis)}
</h2>
{lead ? <p className="fd4-lead">{lead}</p> : null}
</header>
{total && currentPage ? (
<div className="fd4-fan fd4-rise" style={{ "--d": 1 } as React.CSSProperties}>
<div className="fd4-stage" style={FX_HOST}>
<Pattern name="rings" fade="edges" />
<div
className="fd4-deck"
role="group"
aria-roledescription="carousel"
aria-label={previewLabel}
tabIndex={0}
onKeyDown={onKey}
onPointerDown={onPointerDown}
onPointerUp={onPointerUp}
onPointerCancel={onPointerCancel}
>
{pageList.map((page, i) => {
const rel = relative(i, current, total)
const front = rel === 0
return (
<div
key={`${page.title}-${i}`}
className={front ? "fd4-page is-front" : "fd4-page"}
style={{ "--rel": rel, "--abs": Math.abs(rel) } as React.CSSProperties}
aria-hidden={front ? undefined : true}
onClick={() => onPageClick(i, rel)}
>
<img
src={page.image}
alt={front ? page.alt ?? page.title : ""}
width={600}
height={800}
draggable={false}
decoding="async"
/>
</div>
)
})}
</div>
<div className="fd4-cap" aria-live="polite">
<p className="fd4-cap-title">
{total > 1 ? (
<span className="fd4-count">{fill(countLabel, { n: current + 1, total })}</span>
) : null}
{currentPage.title}
</p>
{currentPage.detail ? <p className="fd4-cap-detail">{currentPage.detail}</p> : null}
</div>
{total > 1 ? (
<div className="fd4-ctrl">
<button type="button" className="fd4-nav" aria-label={prevLabel} onClick={() => go(-1)}>
<ChevronLeft strokeWidth={2.5} aria-hidden="true" />
</button>
<div className="fd4-dots">
{pageList.map((page, i) => (
<button
key={`dot-${page.title}-${i}`}
type="button"
className="fd4-dot"
aria-label={fill(dotLabel, { n: i + 1 })}
aria-current={i === current ? "true" : undefined}
onClick={() => setActive(i)}
/>
))}
</div>
<button type="button" className="fd4-nav" aria-label={nextPageLabel} onClick={() => go(1)}>
<ChevronRight strokeWidth={2.5} aria-hidden="true" />
</button>
</div>
) : null}
</div>
</div>
) : null}
<div className="fd4-act fd4-rise" style={{ "--d": 2 } as React.CSSProperties}>
{downloadHref ? (
<a
className={btnClass}
href={downloadHref}
download={downloadAttr}
aria-disabled={blocked || undefined}
aria-busy={busy || undefined}
aria-describedby={showError ? errorId : undefined}
onClick={onDl}
>
{inner}
</a>
) : (
<button
type="button"
className={btnClass}
disabled={disabled}
aria-busy={busy || undefined}
aria-describedby={showError ? errorId : undefined}
onClick={onDl}
>
{inner}
</button>
)}
{showError ? (
<p id={errorId} className="fd4-err" role="alert">
<AlertCircle strokeWidth={2.5} aria-hidden="true" />
{errorMessage}
</p>
) : null}
{inboxNote ? (
<p className="fd4-note">
<Mail strokeWidth={2.5} aria-hidden="true" />
{inboxNote}
</p>
) : null}
{touchTip ? (
<p className="fd4-tip">
<Smartphone strokeWidth={2.5} aria-hidden="true" />
{touchTip}
</p>
) : null}
</div>
<div className="fd4-story fd4-rise" style={{ "--d": 3 } as React.CSSProperties}>
{pullLine ? <p className="fd4-pull">{pullLine}</p> : null}
<div className="fd4-letter">
{salutation ? <p className="fd4-hello">{salutation}</p> : null}
{paragraphs.map((paragraph, i) => (
<p key={i}>{paragraph}</p>
))}
{signOff || signName ? (
<div className="fd4-sign">
{signOff ? <p className="fd4-sign-close">{signOff}</p> : null}
{signName ? <p className="fd4-sign-name">{signName}</p> : null}
{signRole ? <p className="fd4-sign-role">{signRole}</p> : null}
</div>
) : null}
</div>
{nextLabel ? (
<div className="fd4-next">
{nextHeadline ? <h3 className="fd4-next-title">{nextHeadline}</h3> : null}
{nextText ? <p className="fd4-next-text">{nextText}</p> : null}
{offerPrice ? (
<p className="fd4-offer">
<strong>{offerPrice}</strong>
{offerAlternative ? <span> {offerAlternative}</span> : null}
</p>
) : null}
{nextHref ? (
<a className="fd4-btn2" href={nextHref} onClick={() => onAction?.()}>
{nextLabel}
</a>
) : (
<button type="button" className="fd4-btn2" onClick={() => onAction?.()}>
{nextLabel}
</button>
)}
</div>
) : null}
</div>
</div>
</section>
)
}
export default FreebieDelivery4
const DEFAULT_PARAGRAPHS: React.ReactNode[] = [
"You asked for a week of easy dinners, so here it is. Free, with no card and no catch.",
"Pick one recipe for tonight. The shopping list and the Sunday prep plan take care of the rest of the week.",
]
function relative(index: number, current: number, total: number) {
let r = (((index - current) % total) + total) % total
if (r > total / 2) r -= total
return r
}
function renderHeadline(text: string, emphasis?: string) {
if (!emphasis) return text
const at = text.indexOf(emphasis)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className="fd4-em">{emphasis}</span>
{text.slice(at + emphasis.length)}
</>
)
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? String(values[key]) : match))
}
const R = ".cf-freebie-delivery-4"
const CSS = `
${R}{--fd4-soft:color-mix(in oklch,var(--ink) 78%,var(--surface));--fd4-well:color-mix(in oklch,var(--ink) 4%,var(--surface));position:relative;overflow:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R},${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .fd4-wrap{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);grid-template-areas:'head fan' 'act fan' 'story fan';grid-template-rows:auto auto 1fr;column-gap:clamp(32px,5vw,72px);align-items:start}
${R} .fd4-wrap.is-solo{grid-template-columns:minmax(0,46rem);justify-content:center;grid-template-areas:'head' 'act' 'story';grid-template-rows:auto}
${R} .fd4-head{grid-area:head;min-width:0}
${R} .fd4-fan{grid-area:fan;align-self:start;position:sticky;top:32px;min-width:0}
${R} .fd4-act{grid-area:act;margin-top:32px;display:grid;gap:12px;justify-items:stretch;min-width:0}
${R} .fd4-story{grid-area:story;margin-top:48px;min-width:0}
${R} .fd4-title{margin:0;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)}
${R} .fd4-em{color:var(--accent)}
${R} .fd4-lead{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .fd4-stage{position:relative;border-radius:var(--card-radius,var(--radius,14px));background:var(--fd4-well);padding:clamp(24px,3vw,40px) clamp(16px,3vw,32px) clamp(20px,2.5vw,28px)}
${R} .fd4-deck,${R} .fd4-cap,${R} .fd4-ctrl{position:relative}
${R} .fd4-deck{display:grid;justify-items:center;align-items:start;padding:12px 0 24px;touch-action:pan-y;user-select:none;-webkit-user-select:none;border-radius:12px;outline:none}
${R} .fd4-deck:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:4px}
${R} .fd4-page{grid-area:1/1;width:min(60%,320px);aspect-ratio:3/4;cursor:pointer;transform-origin:50% 100%;transform:translateX(calc(var(--rel) * 30%)) translateY(calc(var(--abs) * 14px - var(--lift,0px))) rotate(calc(var(--rel) * 6deg)) scale(calc(1 - var(--abs) * .07));z-index:calc(10 - var(--abs));filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .26)) drop-shadow(0 12px 16px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .2));transition:transform .45s cubic-bezier(.2,.7,.2,1),filter .2s ease,opacity .3s ease}
${R} .fd4-page.is-front{filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32)) drop-shadow(0 18px 22px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3))}
${R} .fd4-page img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 30%;border-radius:8px;pointer-events:none}
@media (hover:hover) and (min-width:641px){${R} .fd4-page:not(.is-front):hover{--lift:12px}${R} .fd4-page.is-front:hover{--lift:4px}}
${R} .fd4-cap{margin-top:8px;text-align:center}
${R} .fd4-cap-title{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;font-weight:700;color:var(--ink);text-wrap:balance}
${R} .fd4-count{margin-inline-end:8px;font-size:.875rem;font-weight:800;font-variant-numeric:tabular-nums;color:var(--fd4-soft)}
${R} .fd4-cap-detail{margin:4px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--fd4-soft);text-wrap:pretty}
${R} .fd4-ctrl{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:16px}
${R} .fd4-dots{display:flex;align-items:center;gap:2px}
${R} .fd4-dot{appearance:none;width:32px;height:32px;display:grid;place-items:center;margin:0;padding:0;border:0;border-radius:999px;background:none;cursor:pointer}
${R} .fd4-dot::before{content:'';display:block;width:9px;height:9px;border-radius:999px;background:oklch(from var(--ink) l c h / .32);transition:width .2s ease,background .2s ease}
${R} .fd4-dot[aria-current='true']::before{width:24px;background:var(--accent-fill,var(--accent))}
${R} .fd4-dot:hover:not([aria-current='true'])::before{background:oklch(from var(--ink) l c h / .55)}
${R} .fd4-dot:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:0}
${R} .fd4-nav{appearance:none;width:44px;height:44px;flex:0 0 auto;display:inline-grid;place-items:center;margin:0;padding:0;border-radius:999px;border:1px solid var(--button-2-border,transparent);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:transform .16s ease,background .16s ease}
${R} .fd4-nav svg{width:20px;height:20px}
${R} .fd4-nav:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .05) c h)}
${R} .fd4-nav:active{transform:translateY(1px)}
${R} .fd4-nav:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
${R} .fd4-btn{appearance:none;margin:0;border:0;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:72px;padding:12px 28px;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);text-shadow:var(--button-text-shadow,none);text-align:center;cursor:pointer;-webkit-tap-highlight-color:transparent;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(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .fd4-btn-main{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15}
${R} .fd4-btn-sub{font-family:var(--font-body);font-size:.9375rem;line-height:1.3;font-weight:600;letter-spacing:.01em}
${R} .fd4-btn:not([disabled]):not([aria-disabled='true']):hover,${R} .fd4-btn.is-hover{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 + .12) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 12px 20px -8px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .52))}
${R} .fd4-btn:not([disabled]):not([aria-disabled='true']):active,${R} .fd4-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .09) c h));box-shadow:var(--button-shadow,inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .18) c h),0 1px 1px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3))}
${R} .fd4-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .fd4-btn[disabled],${R} .fd4-btn[aria-disabled='true']{background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:var(--shadow-sm);cursor:not-allowed;transform:none}
${R} .fd4-btn.is-loading{cursor:progress}
${R} .fd4-spin{width:20px;height:20px;flex:0 0 auto;animation:fd4-spin .8s linear infinite}
@keyframes fd4-spin{to{transform:rotate(360deg)}}
${R} .fd4-note{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .fd4-tip{display:none;margin:0;padding:10px 14px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,var(--surface));font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
@media (hover:none) and (pointer:coarse){${R} .fd4-tip{display:block}}
${R} .fd4-err{display:block;margin:0;padding:10px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
${R} .fd4-note svg,${R} .fd4-tip svg,${R} .fd4-err svg{display:inline-block;width:16px;height:16px;vertical-align:-.15em;margin-inline-end:.4em}
${R} .fd4-pull{margin:0 0 24px;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;color:var(--ink);text-wrap:balance}
${R} .fd4-letter p{margin:0 0 16px;max-width:60ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;color:var(--ink);text-wrap:pretty}
${R} .fd4-letter .fd4-hello{margin-bottom:12px;font-weight:700}
${R} .fd4-sign{margin-top:32px}
${R} .fd4-letter .fd4-sign-close{margin:0}
${R} .fd4-letter .fd4-sign-name{margin:12px 0 0;font-family:var(--signature-font,var(--signature-face,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(1.3125rem,1.8vw,1.625rem);line-height:1.15;color:var(--signature-ink,var(--ink))}
${R} .fd4-letter .fd4-sign-role{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
${R} .fd4-next{margin-top:40px;display:grid;gap:12px;padding:clamp(20px,3vw,32px);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))}
${R} .fd4-next-title{margin:0;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}
${R} .fd4-next-text{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${R} .fd4-offer{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600}
${R} .fd4-offer strong{font-family:var(--font-display);font-weight:var(--display-weight,800);font-variant-numeric:tabular-nums}
${R} .fd4-btn2{appearance:none;justify-self:stretch;width:100%;margin:4px 0 0;display:inline-flex;align-items:center;justify-content:center;min-height:56px;padding:0 24px;border-radius:var(--button-radius,var(--radius,12px));border:1px solid var(--button-2-border,transparent);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:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.15;text-align:center;text-decoration:none;cursor:pointer;transition:transform .16s ease,background .16s ease}
${R} .fd4-btn2:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .05) c h)}
${R} .fd4-btn2:active{transform:translateY(1px)}
${R} .fd4-btn2:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
@keyframes fd4-rise{from{opacity:.82;transform:translateY(8px)}}
${R} .fd4-rise{animation:fd4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--d,0) * .07s)}
@media (max-width:899px){
${R} .fd4-wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'fan' 'act' 'story';grid-template-rows:auto}
${R} .fd4-fan{position:relative;top:auto;margin-top:32px;width:100%;max-width:560px;justify-self:center}
${R} .fd4-act{margin-top:24px}
}
@media (max-width:640px){
${R} .fd4-stage{overflow:hidden;padding:20px 0 16px}
${R} .fd4-deck{padding:8px 0 16px}
${R} .fd4-page{width:min(76%,300px);transform:translateX(calc(var(--rel) * 108%)) scale(calc(1 - var(--abs) * .08));opacity:calc(1 - var(--abs) * .6);transform-origin:50% 50%;transition:transform .4s cubic-bezier(.2,.7,.2,1),opacity .3s ease}
${R} .fd4-cap{padding:0 16px}
${R} .fd4-ctrl{margin-top:8px}
${R} .fd4-nav{display:none}
${R} .fd4-btn{padding:12px 20px}
}
@media (prefers-reduced-motion:reduce){
${R} .fd4-rise{animation:none}
${R} .fd4-page,${R} .fd4-btn,${R} .fd4-btn2,${R} .fd4-nav,${R} .fd4-dot::before{transition:none}
${R} .fd4-spin{animation:none}
}
`
pieces/checkout/freebie-delivery-4/specimen.tsx 72 lines
import __studioImage8b06d5c1 from "../assets/a7cdafe9e9020d84.webp";
import __studioImagefa0faabb from "../assets/fde7ca215fc6c7a6.webp";
import __studioImage662a5f02 from "../assets/1a2d2d1961e3937f.webp";
// Specimen: Greenroot Kitchen's free 7-day meal plan, delivered as a fanned page spread with one soft step to the first box.
import * as React from "react"
import { FreebieDelivery4 } from "../freebie-delivery-4"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
type DemoState = "default" | "hover" | "active" | "disabled" | "error"
export default function FreebieDelivery4Demo({ state = "default" }: { state?: DemoState }) {
return (
<FreebieDelivery4
state={state}
headline="Your next seven dinners are already planned"
emphasis="already planned"
lead="Flip through your free Greenroot Kitchen meal plan, then download it and keep it on your phone all week."
pages={[
{
image: slot(
"item-1",
__studioImage8b06d5c1,
),
alt: "Meal plan page showing a grain bowl photo above the week's dinner menu",
title: "Your week at a glance",
detail: "Seven dinners, Monday to Sunday",
},
{
image: slot(
"item-2",
__studioImagefa0faabb,
),
alt: "Meal plan page with four photos of Sunday prep steps",
title: "Sunday prep in one hour",
detail: "Chop, roast and portion once",
},
{
image: slot(
"item-3",
__studioImage662a5f02,
),
alt: "Shopping list page with fresh groceries beside a checklist",
title: "One shopping list",
detail: "Everything for the week, sorted by aisle",
},
]}
previewLabel="Preview the meal plan pages"
downloadLabel="Download my meal plan"
freeLabel="Free"
fileType="PDF"
fileSize="4.2 MB"
inboxNote="We've also sent a copy to your inbox."
touchTip="Save it to your phone: tap download, then keep it in your Files for the store."
errorMessage="Your download didn't start. Tap the button again, or open the copy we sent to your inbox."
pullLine="Seven dinners. One shopping list. No more 6 pm guesswork."
salutation="Hi friend,"
paragraphs={[
"You asked for a week of easy dinners, so here they are. Free, with no card and no catch.",
"Every recipe works from the same short shopping list, and most nights are on the table in about 30 minutes.",
"Cook one tonight. I think you'll like how calm Tuesday feels.",
]}
signOff="Happy cooking,"
signName="Maya Torres"
signRole="Head cook, Greenroot Kitchen"
nextHeadline="Rather skip the grocery run?"
nextText="Your first Greenroot box brings the ingredients for these same recipes to your door."
nextLabel="Show me my first box"
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalFreebieDelivery4 |
string |
|
emphasis OptionalFreebieDelivery4 |
string |
|
lead OptionalFreebieDelivery4 |
string |
|
pages OptionalFreebieDelivery4 |
FreebieDelivery4Page[] |
|
previewLabel OptionalFreebieDelivery4 |
string |
|
prevLabel OptionalFreebieDelivery4 |
string |
|
nextPageLabel OptionalFreebieDelivery4 |
string |
|
dotLabel OptionalFreebieDelivery4 |
string |
|
countLabel OptionalFreebieDelivery4 |
string |
|
downloadLabel OptionalFreebieDelivery4 |
string |
|
loadingLabel OptionalFreebieDelivery4 |
string |
|
freeLabel OptionalFreebieDelivery4 |
string |
|
fileType OptionalFreebieDelivery4 |
string |
|
fileSize OptionalFreebieDelivery4 |
string |
|
downloadHref OptionalFreebieDelivery4 |
string |
|
download OptionalFreebieDelivery4 |
boolean | string |
|
onDownload OptionalFreebieDelivery4 |
() => void |
|
loading OptionalFreebieDelivery4 |
boolean |
|
inboxNote OptionalFreebieDelivery4 |
string |
|
touchTip OptionalFreebieDelivery4 |
string |
|
errorMessage OptionalFreebieDelivery4 |
string |
|
pullLine OptionalFreebieDelivery4 |
string |
|
salutation OptionalFreebieDelivery4 |
string |
|
paragraphs OptionalFreebieDelivery4 |
React.ReactNode[] |
|
signOff OptionalFreebieDelivery4 |
string |
|
signName OptionalFreebieDelivery4 |
string |
|
signRole OptionalFreebieDelivery4 |
string |
|
nextHeadline OptionalFreebieDelivery4 |
string |
|
nextText OptionalFreebieDelivery4 |
string |
|
nextLabel OptionalFreebieDelivery4 |
string |
|
offerPrice OptionalFreebieDelivery4 |
string |
|
offerAlternative OptionalFreebieDelivery4 |
string |
|
nextHref OptionalFreebieDelivery4 |
string |
|
onAction OptionalFreebieDelivery4 |
() => void |
|
state OptionalFreebieDelivery4 |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalFreebieDelivery4 |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
1a2d2d1961e3937f.webp
image/webp · 190 KB
-
a7cdafe9e9020d84.webp
image/webp · 192 KB
-
fde7ca215fc6c7a6.webp
image/webp · 230 KB