Thankyou Block 1
Confirm the promise, set the next-five-minutes expectation, make one ascension ask.
Use it in a prompt
Use checkout/thankyou-block 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/thankyou-block.tsx. - Import it and pass your copy and images (Props tab):
import { ThankyouBlock } from "@/components/funneldna/checkout/thankyou-block"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/thankyou-block/component.tsx 531 lines
// Confirms the promise and directs the buyer to one clear next action.
import * as React from "react"
import { Check, Clock } from "lucide-react"
export type ThankyouBlockProps = {
/** Progress templates replace {done} and {total} as text. */
copy?: Partial<ThankyouCopy>
href?: string
onAction?: (event: React.MouseEvent<HTMLElement>) => void
state?: "default" | "hover" | "active"
headline?: React.ReactNode
/** Key phrase after the headline, drawn with a marker highlight. */
highlight?: React.ReactNode
subheadline?: React.ReactNode
/** The completed first node of the path. Empty string hides it. */
confirmedLabel?: string
confirmedNote?: React.ReactNode
stepsTitle?: string
nowLabel?: string
steps?: NextStep[]
ctaLabel?: string
ctaHref?: string
onCtaClick?: (event: React.MouseEvent<HTMLElement>) => void
ctaNote?: string
/** Optional icon before the button label (none by default), e.g. a download icon for a download CTA. */
ctaIcon?: React.ReactNode
slot?: React.ReactNode
receipt?: ThankyouReceipt
downloadItems?: ThankyouItem[]
readyLabel?: string
previewState?: "hover" | "active"
className?: string
id?: string
}
export function ThankyouBlock({
copy: copyOverrides,
href,
onAction,
state,
headline = "You're in.",
highlight,
subheadline,
confirmedLabel = "You're confirmed",
confirmedNote,
stepsTitle = "Your next steps",
nowLabel = "Start here",
steps = [],
ctaLabel,
ctaHref,
onCtaClick,
ctaNote,
ctaIcon,
/** Calendar embed, video, or download panel: replaces the CTA when present. */
slot,
receipt,
/** Files shown in the first step's download panel. Defaults to receipt.items with images. */
downloadItems,
/** Status line under the files, e.g. "Your kit is ready to download." */
readyLabel = "Ready to download",
/** Studio preview of the button state. */
previewState,
className,
id,
}: ThankyouBlockProps) {
const copy = { ...THANKYOU_COPY, ...Object.fromEntries(Object.entries(copyOverrides ?? {}).filter(([, value]) => value !== undefined)) }
const destination = href !== undefined ? href : ctaHref
const handleAction = onAction !== undefined ? onAction : onCtaClick
const preview = state !== undefined ? (state === "hover" || state === "active" ? state : undefined) : previewState
const uid = React.useId()
const headingId = `${uid}-heading`
const hasSteps = steps.length > 0
const doneCount = confirmedLabel ? 1 : 0
const total = steps.length + doneCount
const pct = total > 0 ? Math.round((doneCount / total) * 100) : 0
const files = (downloadItems ?? receipt?.items ?? []).filter((f) => !!f.itemImage).slice(0, 4)
const hasFiles = files.length > 0
const filesAlways = hasFiles && !receipt
const buttonInner = (
<>
{ctaIcon && (
<span className="tyb-btn-icon" aria-hidden="true">
{ctaIcon}
</span>
)}
<span className="tyb-btn-label">{ctaLabel}</span>
{ctaIcon && (
<span className="tyb-btn-icon tyb-arrow" aria-hidden="true">
{ctaIcon}
</span>
)}
</>
)
const action = slot ? (
<div className="tyb-slot">{slot}</div>
) : ctaLabel ? (
<div className="tyb-cta">
{destination ? (
<a className="tyb-btn" href={destination} onClick={handleAction}>
{buttonInner}
</a>
) : (
<button type="button" className="tyb-btn" onClick={handleAction}>
{buttonInner}
</button>
)}
{ctaNote && <p className="tyb-note">{ctaNote}</p>}
</div>
) : null
const items = receipt?.items ?? []
const cardTitle = receipt?.title ?? (receipt?.free ? copy.freeKit : copy.order)
const totalValue = receipt?.free ? receipt.freeLabel ?? copy.free : receipt?.total
const totalLabel = receipt?.totalLabel ?? (receipt?.free ? copy.yourPrice : copy.total)
return (
<section
id={id}
className={["cf-thankyou-block", className].filter(Boolean).join(" ")}
data-preview={preview}
aria-labelledby={headingId}
>
<style>{CSS}</style>
<svg className="tyb-rings" viewBox="0 0 980 980" fill="none" aria-hidden="true">
{[120, 200, 280, 360, 440].map((r) => (
<circle key={r} cx="490" cy="490" r={r} stroke="currentColor" strokeWidth="1.5" />
))}
</svg>
<div className="tyb-head">
<span className="tyb-seal" aria-hidden="true">
<Check strokeWidth={3.25} />
</span>
<h1 id={headingId} className="tyb-h1">
{headline}
{highlight && (
<>
{" "}
<span className="tyb-mark">{highlight}</span>
</>
)}
</h1>
{subheadline && <p className="tyb-sub">{subheadline}</p>}
{!hasSteps && action && <div className="tyb-solo-cta">{action}</div>}
</div>
{(hasSteps || receipt) && (
<div className={`tyb-grid${hasSteps && receipt ? "" : " tyb-grid--solo"}`}>
{hasSteps && (
<div className="tyb-card tyb-steps">
<div className="tyb-steps-head">
<h2 className="tyb-h2">{stepsTitle}</h2>
{doneCount > 0 && (
<div className="tyb-progress">
<span
className="tyb-bar"
role="progressbar"
aria-valuemin={0}
aria-valuemax={total}
aria-valuenow={doneCount}
aria-label={formatCopy(copy.progressLabel, { done: String(doneCount), total: String(total) })}
>
<span style={{ width: `${pct}%` }} />
</span>
<span>
{formatCopy(copy.progress, { done: String(doneCount), total: String(total) })}
</span>
</div>
)}
</div>
<ol className="tyb-ol">
{confirmedLabel && (
<li className="tyb-li tyb-li--done">
<span className="tyb-node tyb-node--done">
<Check strokeWidth={3} aria-hidden="true" />
</span>
<div className="tyb-body">
<h3 className="tyb-t">{confirmedLabel}</h3>
{confirmedNote && <div className="tyb-d">{confirmedNote}</div>}
</div>
</li>
)}
{steps.map((step, i) => {
const now = i === 0
const whenChip = (extra?: string) =>
step.when ? (
<span className={`tyb-when${extra ? ` ${extra}` : ""}`}>
<Clock strokeWidth={2.5} aria-hidden="true" />
{step.when}
</span>
) : null
return (
<li
key={`${i}-${step.title}`}
className={`tyb-li ${now ? "tyb-li--now" : "tyb-li--next"}`}
style={{ animationDelay: `${80 + (i + 1) * 70}ms` }}
aria-current={now ? "step" : undefined}
>
<span
className={`tyb-node ${now ? "tyb-node--now" : "tyb-node--next"}`}
aria-hidden={now ? "true" : undefined}
>
{i + 1}
</span>
<div className="tyb-body">
{now ? (
<div
className={[
"tyb-now",
hasFiles ? "tyb-now--files" : "",
filesAlways ? "tyb-now--files-always" : "",
]
.filter(Boolean)
.join(" ")}
>
<div className="tyb-row tyb-now-top">
<span className="tyb-now-num" aria-hidden="true">
{i + 1}
</span>
{nowLabel && <span className="tyb-tag">{nowLabel}</span>}
{whenChip("tyb-when--top")}
</div>
<h3 className="tyb-t">{step.title}</h3>
{step.description && <div className="tyb-d">{step.description}</div>}
{hasFiles && (
<div className={`tyb-files${filesAlways ? " tyb-files--always" : ""}`}>
<ul
className="tyb-files-grid"
style={{
gridTemplateColumns: `repeat(${files.length},minmax(0,1fr))`,
}}
>
{files.map((file, fi) => (
<li key={`${fi}-${file.name}`} className="tyb-file">
<img src={file.itemImage} alt={file.itemImageAlt ?? file.name} />
<span className="tyb-file-check" aria-hidden="true">
<Check strokeWidth={3.5} />
</span>
</li>
))}
</ul>
<div className="tyb-files-foot">
{readyLabel && (
<p className="tyb-ready">
<Check strokeWidth={3} aria-hidden="true" />
{readyLabel}
</p>
)}
{whenChip()}
</div>
</div>
)}
{action}
</div>
) : (
<>
<div className="tyb-row">
<h3 className="tyb-t">{step.title}</h3>
{whenChip()}
</div>
{step.description && <div className="tyb-d">{step.description}</div>}
</>
)}
</div>
</li>
)
})}
</ol>
</div>
)}
{receipt && (
<aside className="tyb-card tyb-receipt" aria-label={cardTitle}>
<div className="tyb-strip">
<h2 className="tyb-strip-t">{cardTitle}</h2>
{(receipt.status ?? copy.confirmed) && (
<span className="tyb-status">
<Check strokeWidth={3} aria-hidden="true" />
{receipt.status ?? copy.confirmed}
</span>
)}
</div>
{receipt.productImage && (
<div className="tyb-shot">
<img src={receipt.productImage} alt={receipt.productImageAlt ?? ""} />
</div>
)}
<div className={`tyb-rbody${receipt.productImage ? "" : " tyb-rbody--pad"}`}>
<h3 className="tyb-pname">{receipt.productName}</h3>
{receipt.note && <p className="tyb-pnote">{receipt.note}</p>}
{items.length > 0 && (
<ul className="tyb-items">
{items.map((item, i) => (
<li key={`${i}-${item.name}`} className="tyb-item">
<span className="tyb-feat">
{item.itemImage ? (
<img src={item.itemImage} alt={item.itemImageAlt ?? ""} />
) : (
<span className="tyb-feat-empty" aria-hidden="true" />
)}
<span className="tyb-feat-check" aria-hidden="true">
<Check strokeWidth={3.5} />
</span>
</span>
<div className="tyb-itext">
<p className="tyb-iname">
{item.name}
<span className="sr-only-cf-thankyou-block">{copy.included}</span>
</p>
{item.detail && <p className="tyb-idetail">{item.detail}</p>}
</div>
</li>
))}
</ul>
)}
{totalValue && (
<div className={`tyb-total${receipt.free ? " tyb-total--free" : ""}`}>
<span className="tyb-total-l">{totalLabel}</span>
<span className="tyb-price">{totalValue}</span>
</div>
)}
</div>
</aside>
)}
</div>
)}
</section>
)
}
export type NextStep = {
title: string
description?: React.ReactNode
/** A date, or "in the next 5 minutes". Only when you can honour it. */
when?: string
}
export type ThankyouItem = {
name: string
detail?: string
/** Featured image for the item (cover, page, product shot). */
itemImage?: string
itemImageAlt?: string
}
export type ThankyouReceipt = {
/** Card title, e.g. "Your free kit". */
title?: string
/** Status on the strip, e.g. "Confirmed". */
status?: string
productName: string
note?: string
/** Raster product shot for the card header. */
productImage?: string
productImageAlt?: string
items?: ThankyouItem[]
totalLabel?: string
/** Price shown in the total row. Use only a real price; leave empty with free. */
total?: string
/** Free signup: the total row shows "Free" in the success colour. */
free?: boolean
/** Label used when free is true. */
freeLabel?: string
}
const CSS = `
.cf-thankyou-block{--tyb-ink:var(--ink,#101828);--tyb-muted:var(--muted,#4a5565);--tyb-card:var(--card,#ffffff);--tyb-accent:var(--accent,#0f5fc2);--tyb-cta:var(--cta,#d92d20);--tyb-cta2:var(--cta-2,#b42318);--tyb-marker:var(--marker,#fae37c);--tyb-green:var(--success);--tyb-green-2:var(--success);--tyb-green-tint:var(--success-soft);--tyb-line:oklch(from var(--tyb-ink) l c h / 0.11);--tyb-r:calc(var(--radius,14px) + 4px);position:relative;isolation:isolate;overflow:hidden;width:100%;max-width:100%;background:color-mix(in oklch,var(--ink) 3%,var(--surface,#ffffff));color:var(--tyb-ink);font-family:var(--font-body,Arial,sans-serif);padding:clamp(56px,8vw,104px) 20px clamp(56px,7vw,96px);border-bottom:1px solid var(--tyb-line)}
.cf-thankyou-block *,.cf-thankyou-block *::before,.cf-thankyou-block *::after{box-sizing:border-box}
:where(.cf-thankyou-block) .tyb-rings{position:absolute;left:50%;top:-350px;width:980px;height:980px;transform:translateX(-50%);color:var(--tyb-ink);opacity:.08;pointer-events:none;z-index:-1;-webkit-mask-image:radial-gradient(closest-side,var(--ink) 45%,transparent 100%);mask-image:radial-gradient(closest-side,var(--ink) 45%,transparent 100%)}
:where(.cf-thankyou-block) .tyb-head{max-width:860px;margin:0 auto;text-align:center;min-width:0}
:where(.cf-thankyou-block) .tyb-seal{position:relative;display:grid;place-items:center;width:76px;height:76px;margin:0 auto;border-radius:999px;color:var(--card);background:var(--success);box-shadow:0 0 0 6px var(--success-soft),0 0 0 13px var(--success-soft),inset 0 2px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),inset 0 -3px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22);animation:tyb-pop .6s cubic-bezier(.2,1.4,.4,1) both}
:where(.cf-thankyou-block) .tyb-seal svg{width:38px;height:38px}
:where(.cf-thankyou-block) .tyb-h1{font-family:var(--font-display);font-weight:var(--display-weight,900);font-size:clamp(2.35rem,5.4vw,4.4rem);line-height:1.04;letter-spacing:var(--display-tracking,-.028em);margin:38px auto 0;text-wrap:balance;overflow-wrap:break-word;color:var(--tyb-ink);text-transform:var(--display-case,none)}
:where(.cf-thankyou-block) .tyb-mark{background-image:linear-gradient(100deg in oklch,transparent .4%,oklch(from var(--marker,#fae37c) l c h / 0.28) 1.8%,oklch(from var(--marker,#fae37c) l c h / 0.24) 97.5%,transparent 99.6%);background-repeat:no-repeat;background-size:100% .72em;background-position:0 88%;padding:0 .14em;margin:0 -.04em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
:where(.cf-thankyou-block) .tyb-sub{margin:22px auto 0;max-width:50ch;font-size:clamp(1.0625rem,1.5vw,1.25rem);line-height:1.55;font-weight:500;color:var(--tyb-muted);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-solo-cta{margin-top:36px;display:flex;justify-content:center}
:where(.cf-thankyou-block) .tyb-solo-cta .tyb-cta{align-items:center}
:where(.cf-thankyou-block) .tyb-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;max-width:1120px;margin:clamp(40px,5vw,60px) auto 0;align-items:start}
:where(.cf-thankyou-block) .tyb-grid>*{min-width:0}
:where(.cf-thankyou-block) .tyb-grid--solo{max-width:760px}
@media (min-width:960px){:where(.cf-thankyou-block) .tyb-grid:not(.tyb-grid--solo){grid-template-columns:minmax(0,1fr) 392px;gap:28px}}
:where(.cf-thankyou-block) .tyb-card{min-width:0;max-width:100%;background:var(--tyb-card);border:1px solid oklch(from var(--tyb-ink) l c h / 0.12);border-radius:var(--card-radius,var(--radius,var(--tyb-r)));box-shadow:var(--card-shadow,inset 0 0 0 4px oklch(from var(--tyb-ink) l c h / 0.025),0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.16))}
:where(.cf-thankyou-block) .tyb-steps{padding:clamp(22px,3vw,36px)}
:where(.cf-thankyou-block) .tyb-steps-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px;margin-bottom:28px}
:where(.cf-thankyou-block) .tyb-h2{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.375rem,2.2vw,1.75rem);line-height:1.15;letter-spacing:var(--display-tracking,-.015em);margin:0;color:var(--tyb-ink);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-thankyou-block) .tyb-progress{display:flex;align-items:center;gap:12px;font-size:14px;font-weight:700;color:var(--tyb-muted);white-space:nowrap}
:where(.cf-thankyou-block) .tyb-bar{display:block;width:120px;height:8px;border-radius:99px;background:color-mix(in oklch,var(--tyb-ink) 9%,var(--tyb-card));overflow:hidden}
:where(.cf-thankyou-block) .tyb-bar>span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg in oklch,var(--tyb-green-2),var(--tyb-green));transform-origin:left center;animation:tyb-fill .9s .25s cubic-bezier(.2,.8,.2,1) both}
:where(.cf-thankyou-block) .tyb-ol{list-style:none;margin:0;padding:0;min-width:0}
:where(.cf-thankyou-block) .tyb-li{position:relative;display:grid;grid-template-columns:44px minmax(0,1fr);gap:16px;padding-bottom:26px;min-width:0;animation:tyb-rise .5s cubic-bezier(.2,.8,.2,1) both}
:where(.cf-thankyou-block) .tyb-li:last-child{padding-bottom:0}
:where(.cf-thankyou-block) .tyb-li:not(:last-child)::before{content:"";position:absolute;left:21px;top:50px;bottom:6px;width:2px;border-radius:2px;background:oklch(from var(--tyb-ink) l c h / 0.12)}
:where(.cf-thankyou-block) .tyb-li--done:not(:last-child)::before{background:var(--tyb-green-2)}
:where(.cf-thankyou-block) .tyb-node{position:relative;z-index:1;display:grid;place-items:center;width:44px;height:44px;border-radius:999px;font-family:var(--font-display,Arial,sans-serif);font-weight:800;font-size:17px;line-height:1;font-variant-numeric:tabular-nums}
:where(.cf-thankyou-block) .tyb-node svg{width:20px;height:20px}
:where(.cf-thankyou-block) .tyb-node--done{background:var(--success);color:var(--card);box-shadow:0 0 0 4px var(--tyb-green-tint)}
:where(.cf-thankyou-block) .tyb-node--now{background:var(--band);color:var(--band-ink);box-shadow:0 0 0 5px oklch(from var(--accent-fill, var(--tyb-accent)) l c h / 0.16),inset 0 -2px 0 oklch(from var(--band) calc(l - 0.12) c h / 0.35)}
:where(.cf-thankyou-block) .tyb-node--now::after{content:"";position:absolute;inset:-5px;border-radius:inherit;border:2px solid oklch(from var(--accent-fill, var(--tyb-accent)) l c h / 0.45);animation:tyb-ping 2.4s ease-out infinite}
:where(.cf-thankyou-block) .tyb-node--next{background:var(--tyb-card);color:var(--tyb-ink);border:2px solid oklch(from var(--tyb-ink) l c h / 0.16)}
:where(.cf-thankyou-block) .tyb-body{min-width:0;padding-top:9px}
:where(.cf-thankyou-block) .tyb-li--now .tyb-body{padding-top:0}
:where(.cf-thankyou-block) .tyb-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-width:0}
:where(.cf-thankyou-block) .tyb-t{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.125rem;line-height:1.3;letter-spacing:var(--display-tracking,-.005em);color:var(--tyb-ink);text-wrap:balance;overflow-wrap:break-word;min-width:0;text-transform:var(--display-case,none)}
:where(.cf-thankyou-block) .tyb-li--done .tyb-t{color:var(--tyb-green)}
:where(.cf-thankyou-block) .tyb-d{margin:6px 0 0;font-size:16px;line-height:1.55;color:var(--tyb-muted);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-when{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:4px 12px;border-radius:99px;background:var(--tyb-green-tint);color:var(--tyb-green);font-size:14px;font-weight:700;line-height:1.3;white-space:nowrap}
:where(.cf-thankyou-block) .tyb-when svg{width:15px;height:15px;flex:none}
:where(.cf-thankyou-block) .tyb-now{min-width:0;max-width:100%;border-radius:var(--card-radius,var(--radius,calc(var(--tyb-r) - 4px)));padding:clamp(18px,2.4vw,26px);background:color-mix(in oklch,var(--accent-fill,var(--tyb-accent)) 8%,var(--tyb-card));border:1.5px solid oklch(from var(--accent-fill, var(--tyb-accent)) l c h / 0.3);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.16))}
:where(.cf-thankyou-block) .tyb-now-top{margin-bottom:14px}
:where(.cf-thankyou-block) .tyb-now-num{display:none;place-items:center;width:30px;height:30px;flex:none;border-radius:999px;background:var(--band);color:var(--band-ink);font-family:var(--font-display,Arial,sans-serif);font-weight:800;font-size:15px;line-height:1;font-variant-numeric:tabular-nums;box-shadow:0 0 0 4px oklch(from var(--ink) l c h / 0.14),inset 0 -2px 0 oklch(from var(--band) calc(l - 0.12) c h / 0.35)}
:where(.cf-thankyou-block) .tyb-now .tyb-t{font-size:clamp(1.25rem,2vw,1.5rem);letter-spacing:-.012em}
:where(.cf-thankyou-block) .tyb-now .tyb-d{margin-top:8px}
:where(.cf-thankyou-block) .tyb-tag{display:inline-flex;align-items:center;padding:4px 12px;border-radius:99px;background:color-mix(in oklch,var(--accent-fill,var(--tyb-accent)) 13%,var(--tyb-card));color:var(--ink);font-size:14px;font-weight:800;line-height:1.3;letter-spacing:.01em}
:where(.cf-thankyou-block) .tyb-files{min-width:0;margin-top:18px;padding:10px 10px 12px;border-radius:var(--card-radius,var(--radius,14px));background:var(--tyb-card);border:1px solid oklch(from var(--ink) l c h / 0.10)}
:where(.cf-thankyou-block) .tyb-files-grid{list-style:none;margin:0;padding:0 6px 6px 0;display:grid;gap:10px;min-width:0}
:where(.cf-thankyou-block) .tyb-file{position:relative;min-width:0;aspect-ratio:4/3;border-radius:10px;background:transparent;border:1px solid oklch(from var(--tyb-ink) l c h / 0.1);box-shadow:none;border-color:transparent}
:where(.cf-thankyou-block) .tyb-file img{display:block;width:100%;height:100%;object-fit:contain;border-radius:9px;filter:drop-shadow(0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22))}
:where(.cf-thankyou-block) .tyb-file-check{position:absolute;right:-6px;bottom:-6px;display:grid;place-items:center;width:22px;height:22px;border-radius:999px;background:var(--success);color:var(--card);box-shadow:0 0 0 3px var(--tyb-card)}
:where(.cf-thankyou-block) .tyb-file-check svg{width:12px;height:12px}
:where(.cf-thankyou-block) .tyb-files-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:10px;padding:0 2px;min-width:0}
:where(.cf-thankyou-block) .tyb-ready{display:inline-flex;align-items:flex-start;gap:8px;margin:0;min-width:0;font-size:15px;font-weight:700;line-height:1.35;color:var(--tyb-ink);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-ready svg{width:17px;height:17px;flex:none;margin-top:1px;color:var(--tyb-green)}
@media (min-width:960px){:where(.cf-thankyou-block) .tyb-files:not(.tyb-files--always){display:none}}
@media (max-width:959px){:where(.cf-thankyou-block) .tyb-now--files .tyb-when--top{display:none}}
:where(.cf-thankyou-block) .tyb-now--files-always .tyb-when--top{display:none}
:where(.cf-thankyou-block) .tyb-cta{margin-top:22px;display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0}
:where(.cf-thankyou-block) .tyb-slot{margin-top:22px;min-width:0}
:where(.cf-thankyou-block) .tyb-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:62px;min-width:340px;max-width:100%;padding:12px 30px;border-radius:var(--button-radius,var(--radius,calc(var(--radius,14px) + 2px)));border:1px solid var(--tyb-cta2);background:linear-gradient(180deg in oklch,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));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);font-size:1.1875rem;line-height:1.2;letter-spacing:-.008em;text-align:center;text-decoration:none;text-wrap:balance;cursor:pointer;box-shadow:var(--button-shadow,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));text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;-webkit-tap-highlight-color:transparent;border-color:var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));text-transform:var(--button-case,none)}
:where(.cf-thankyou-block) .tyb-btn svg{width:22px;height:22px;flex:none}
:where(.cf-thankyou-block) .tyb-btn-icon{display:inline-flex}
:where(.cf-thankyou-block) .tyb-btn-label{min-width:0}
:where(.cf-thankyou-block) .tyb-arrow{visibility:hidden}
:where(.cf-thankyou-block) .tyb-btn:hover,.cf-thankyou-block[data-preview="hover"] .tyb-btn{transform:translateY(-2px);filter:none;background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:var(--button-shadow,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))}
:where(.cf-thankyou-block) .tyb-btn:active,.cf-thankyou-block[data-preview="active"] .tyb-btn{transform:translateY(2px);filter:none;background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:var(--button-shadow,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))}
:where(.cf-thankyou-block) .tyb-btn:focus-visible{outline:3px solid oklch(from var(--tyb-cta) l c h / 0.45);outline-offset:3px}
:where(.cf-thankyou-block) .tyb-note{margin:0;font-size:14px;font-weight:600;line-height:1.4;color:var(--tyb-muted);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-receipt{overflow:hidden}
@media (min-width:960px){:where(.cf-thankyou-block) .tyb-receipt{position:sticky;top:24px}}
:where(.cf-thankyou-block) .tyb-strip{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 22px;background:var(--card);border-bottom:1px solid oklch(from var(--tyb-ink) l c h / 0.13)}
:where(.cf-thankyou-block) .tyb-strip-t{margin:0;font-family:var(--font-display);font-size:15px;font-weight:var(--display-weight,800);color:var(--tyb-ink);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,normal)}
:where(.cf-thankyou-block) .tyb-status{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:700;color:var(--tyb-green)}
:where(.cf-thankyou-block) .tyb-status svg{width:16px;height:16px}
:where(.cf-thankyou-block) .tyb-shot{position:relative;height:196px;background:transparent}
:where(.cf-thankyou-block) .tyb-shot img{display:block;width:100%;height:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22))}
:where(.cf-thankyou-block) .tyb-shot::after{content:"";position:absolute;inset:0;background:none}
:where(.cf-thankyou-block) .tyb-rbody{padding:4px 22px 22px}
:where(.cf-thankyou-block) .tyb-rbody--pad{padding-top:20px}
:where(.cf-thankyou-block) .tyb-pname{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,900);font-size:1.5rem;line-height:1.15;letter-spacing:var(--display-tracking,-.018em);color:var(--tyb-ink);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-thankyou-block) .tyb-pnote{margin:8px 0 0;font-size:15px;font-weight:600;color:var(--tyb-muted);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-items{list-style:none;margin:14px 0 0;padding:0}
:where(.cf-thankyou-block) .tyb-item{display:grid;grid-template-columns:108px minmax(0,1fr);gap:16px;align-items:start;padding:16px 0}
:where(.cf-thankyou-block) .tyb-item+.tyb-item{border-top:1px solid var(--tyb-line)}
:where(.cf-thankyou-block) .tyb-feat{position:relative;display:block;width:108px;aspect-ratio:4/3;padding:5px;border-radius:12px;background:transparent;border:1px solid oklch(from var(--ink) l c h / 0.16);box-shadow:none;border-color:transparent}
:where(.cf-thankyou-block) .tyb-feat img{display:block;width:100%;height:100%;object-fit:contain;border-radius:8px;filter:drop-shadow(0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22))}
:where(.cf-thankyou-block) .tyb-feat-empty{display:block;width:100%;height:100%;border-radius:8px;background:color-mix(in oklch,var(--ink) 7%,var(--tyb-card))}
:where(.cf-thankyou-block) .tyb-feat-check{position:absolute;right:-7px;bottom:-7px;display:grid;place-items:center;width:26px;height:26px;border-radius:999px;background:var(--success);color:var(--card);box-shadow:0 0 0 3px var(--tyb-card),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22)}
:where(.cf-thankyou-block) .tyb-feat-check svg{width:14px;height:14px}
:where(.cf-thankyou-block) .tyb-itext{min-width:0;padding-top:2px}
:where(.cf-thankyou-block) .tyb-iname{margin:0;font-family:var(--font-display);font-size:1.0625rem;font-weight:var(--display-weight,800);line-height:1.25;letter-spacing:var(--display-tracking,-.008em);color:var(--tyb-ink);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-thankyou-block) .tyb-idetail{margin:5px 0 0;font-size:15px;line-height:1.45;color:var(--tyb-muted);text-wrap:pretty}
:where(.cf-thankyou-block) .tyb-total{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:10px;padding:14px 16px;border-radius:var(--card-radius,var(--radius,12px));background:color-mix(in oklch,var(--tyb-ink) 4.5%,var(--tyb-card))}
:where(.cf-thankyou-block) .tyb-total--free{background:var(--tyb-green-tint);box-shadow:inset 0 0 0 1px var(--success-soft)}
:where(.cf-thankyou-block) .tyb-total-l{font-size:15px;font-weight:700;color:var(--tyb-ink)}
:where(.cf-thankyou-block) .tyb-price{font-family:var(--font-display,Arial,sans-serif);font-weight:900;font-size:2rem;line-height:1;letter-spacing:-.02em;color:var(--tyb-ink);font-variant-numeric:tabular-nums}
:where(.cf-thankyou-block) .tyb-total--free .tyb-price{color:var(--tyb-green)}
:where(.cf-thankyou-block) .sr-only-cf-thankyou-block{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes tyb-pop{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
@keyframes tyb-rise{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
@keyframes tyb-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes tyb-ping{0%{transform:scale(1);opacity:.9}70%,100%{transform:scale(1.35);opacity:0}}
@media (max-width:639px){
.cf-thankyou-block{padding:40px 14px 56px}
:where(.cf-thankyou-block) .tyb-rings{top:-400px;width:860px;height:860px}
:where(.cf-thankyou-block) .tyb-seal{width:60px;height:60px;box-shadow:0 0 0 6px var(--success-soft),0 0 0 13px var(--success-soft),inset 0 2px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),inset 0 -3px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22)}
:where(.cf-thankyou-block) .tyb-seal svg{width:30px;height:30px}
:where(.cf-thankyou-block) .tyb-h1{margin-top:28px;font-size:clamp(2.1rem,9.4vw,2.6rem)}
:where(.cf-thankyou-block) .tyb-sub{margin-top:14px;font-size:17px}
:where(.cf-thankyou-block) .tyb-grid{margin-top:28px;gap:20px}
:where(.cf-thankyou-block) .tyb-steps{padding:20px 14px 22px}
:where(.cf-thankyou-block) .tyb-steps-head{margin-bottom:22px}
:where(.cf-thankyou-block) .tyb-li{grid-template-columns:32px minmax(0,1fr);gap:12px}
:where(.cf-thankyou-block) .tyb-node{width:32px;height:32px;font-size:15px}
:where(.cf-thankyou-block) .tyb-node svg{width:17px;height:17px}
:where(.cf-thankyou-block) .tyb-node--done{box-shadow:0 0 0 4px var(--tyb-green-tint)}
:where(.cf-thankyou-block) .tyb-li:not(:last-child)::before{left:15px;top:38px}
:where(.cf-thankyou-block) .tyb-body{padding-top:4px}
:where(.cf-thankyou-block) .tyb-li.tyb-li--now{display:block}
:where(.cf-thankyou-block) .tyb-li.tyb-li--now::before{display:none}
:where(.cf-thankyou-block) .tyb-li--now>.tyb-node{display:none}
:where(.cf-thankyou-block) .tyb-now-num{display:grid}
:where(.cf-thankyou-block) .tyb-now{padding:18px 14px 16px}
:where(.cf-thankyou-block) .tyb-now-top{gap:8px 10px}
:where(.cf-thankyou-block) .tyb-now .tyb-t{font-size:1.375rem}
:where(.cf-thankyou-block) .tyb-when{white-space:normal}
:where(.cf-thankyou-block) .tyb-files{margin-top:16px;padding:8px 8px 10px}
:where(.cf-thankyou-block) .tyb-files-grid{gap:8px}
:where(.cf-thankyou-block) .tyb-cta{align-items:stretch;margin-top:18px}
:where(.cf-thankyou-block) .tyb-btn{width:100%;min-width:0;min-height:58px;padding:14px 18px;gap:10px;font-size:1.125rem;letter-spacing:-.012em}
:where(.cf-thankyou-block) .tyb-btn-icon{display:none}
:where(.cf-thankyou-block) .tyb-btn svg{width:20px;height:20px}
:where(.cf-thankyou-block) .tyb-btn-label{white-space:normal;text-wrap:balance}
:where(.cf-thankyou-block) .tyb-note{text-align:center}
:where(.cf-thankyou-block) .tyb-strip{padding:12px 16px}
:where(.cf-thankyou-block) .tyb-rbody{padding:4px 16px 18px}
:where(.cf-thankyou-block) .tyb-rbody--pad{padding-top:18px}
:where(.cf-thankyou-block) .tyb-shot{height:176px}
:where(.cf-thankyou-block) .tyb-item{grid-template-columns:96px minmax(0,1fr);gap:14px}
:where(.cf-thankyou-block) .tyb-feat{width:96px}
}
@media (max-width:359px){.cf-thankyou-block{padding-left:10px;padding-right:10px}:where(.cf-thankyou-block) .tyb-steps{padding:18px 10px 20px}:where(.cf-thankyou-block) .tyb-now{padding:16px 12px 14px}:where(.cf-thankyou-block) .tyb-btn{font-size:1rem;padding:14px 12px}}
@media (prefers-reduced-motion:reduce){.cf-thankyou-block *,.cf-thankyou-block *::before,.cf-thankyou-block *::after{animation:none !important;transition:none !important}}
`
export default ThankyouBlock
const THANKYOU_COPY = {
freeKit: 'Your free kit', order: 'Your order', free: 'Free', yourPrice: 'Your price', total: 'Total', confirmed: 'Confirmed',
progressLabel: '{done} of {total} steps done', progress: '{done} of {total} done', included: ' (included)',
}
type ThankyouCopy = typeof THANKYOU_COPY
function formatCopy(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => values[key] ?? match)
}
pieces/checkout/thankyou-block/specimen.tsx 81 lines
import __studioImage5a09e92d from "../assets/e4e06fd1e8642e86.webp";
import * as React from "react"
import { Download } from "lucide-react"
import { ThankyouBlock, type NextStep } from "../thankyou-block"
import { slot } from "../../slots"
import defaults from "../../studio-defaults.json"
export const states = ["default", "hover", "active"]
export default function ThankyouBlockSpecimen({
state = "default",
}: {
state?: string
}) {
const sample = defaults.sample
const [guide, workbook, checklist] = sample.items
const steps: NextStep[] = [
{
title: "Download your free kit",
description: "Get the guide, workbook, and checklist in one download. Yours to keep.",
when: sample.reassurance[0],
},
{
title: `Map your funnel with the ${guide.name}`,
description: guide.detail,
},
{
title: `Write your page in the ${workbook.name}`,
description: workbook.detail,
},
{
title: `Run the ${checklist.name} before you go live`,
description: checklist.detail,
},
]
const items = sample.items.map((item,i) => ({
name:item.name,
detail:item.detail,
itemImage:slot(`item-${i+1}`,item.image ?? ""),
itemImageAlt: item.imageAlt || `${item.name} cover`,
}))
const previewState =
state === "hover" || state === "active" ? state : undefined
return (
<div
data-state={state}
>
<ThankyouBlock
headline="You're in!"
highlight="Your free kit is ready."
subheadline={`Download ${sample.name} now, then follow the steps below to plan, write and check your first funnel before you launch.`}
confirmedLabel="You're confirmed"
confirmedNote={`${sample.name} is yours, free.`}
steps={steps}
ctaLabel="Download My Free Kit"
ctaIcon={<Download strokeWidth={2.5} />}
onAction={(event) => event.preventDefault()}
ctaNote="100% free · Yours to keep"
readyLabel={sample.actionStatus}
state={previewState ?? "default"}
receipt={{
title: "Your free kit",
status: "Confirmed",
productName: sample.name,
note: "Free · Instant digital access",
productImage: slot("product",__studioImage5a09e92d),
productImageAlt: `${sample.name}: guide, workbook and checklist`,
items,
free: true,
totalLabel: "Your price",
freeLabel: "Free",
}}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalThankyouBlock |
Partial<ThankyouCopy> |
|
href OptionalThankyouBlock |
string |
|
onAction OptionalThankyouBlock |
(event: React.MouseEvent<HTMLElement>) => void |
|
state OptionalThankyouBlock |
"default" | "hover" | "active" |
|
headline OptionalThankyouBlock |
React.ReactNode |
Default "You're in."
|
highlight OptionalThankyouBlock |
React.ReactNode |
|
subheadline OptionalThankyouBlock |
React.ReactNode |
|
confirmedLabel OptionalThankyouBlock |
string |
Default "You're confirmed"
|
confirmedNote OptionalThankyouBlock |
React.ReactNode |
|
stepsTitle OptionalThankyouBlock |
string |
Default "Your next steps"
|
nowLabel OptionalThankyouBlock |
string |
Default "Start here"
|
steps OptionalThankyouBlock |
NextStep[] |
Default []
|
ctaLabel OptionalThankyouBlock |
string |
|
ctaHref OptionalThankyouBlock |
string |
|
onCtaClick OptionalThankyouBlock |
(event: React.MouseEvent<HTMLElement>) => void |
|
ctaNote OptionalThankyouBlock |
string |
|
ctaIcon OptionalThankyouBlock |
React.ReactNode |
|
slot OptionalThankyouBlock |
React.ReactNode |
|
receipt OptionalThankyouBlock |
ThankyouReceipt |
|
downloadItems OptionalThankyouBlock |
ThankyouItem[] |
|
readyLabel OptionalThankyouBlock |
string |
Default "Ready to download"
|
previewState OptionalThankyouBlock |
"hover" | "active" |
|
className OptionalThankyouBlock |
string |
|
id OptionalThankyouBlock |
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.
--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.
--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.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e4e06fd1e8642e86.webp
image/webp · 47.8 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB