One Click Downsell 1
Offers a lighter one-click alternative while preserving the buyer’s existing order.
Use it in a prompt
Use checkout/one-click-downsell 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/one-click-downsell.tsx. - Import it and pass your copy and images (Props tab):
import { OneClickDownsell } from "@/components/funneldna/checkout/one-click-downsell"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-click-downsell/component.tsx 497 lines
// Offers a lighter one-click alternative while preserving the buyer’s existing order.
"use client"
import * as React from "react"
import { AlertCircle, Check, Loader2, Lock, Minus, ShieldCheck } from "lucide-react"
export type OneClickDownsellProps = {
/** Generated labels replace {count} and {value} as text. */
copy?: Partial<DownsellCopy>
/** Accept destination: the yes button renders as a link when set (takes precedence over continueHref). */
href?: string
/** Accept action; takes precedence over onAccept. A returned promise shows loadingLabel; a rejection shows errorMessage. */
onAction?: () => void | Promise<void>
className?: string
steps?: DownsellStep[]
headline?: string
highlight?: string
lead?: string
/** Text records; strings remain supported for existing pages. */
reliefPoints?: Array<{ text: React.ReactNode } | string>
productName?: string
/** Small line under the product name, e.g. "One payment · Lifetime access". Hidden by default. */
productNote?: string
productImage?: string
productImageAlt?: string
mediaCaption?: string
items?: DownsellItem[]
/** Kept for existing pages; the price now lives in the button label. */
wasLabel?: string
/** Kept for existing pages; the price now lives in the button label. */
priceLabel?: string
/** Kept for existing pages; the price now lives in the button label. */
regularPrice?: string
/** Kept for existing pages; the price now lives in the button label. */
price?: string
/** Kept for existing pages; the price now lives in the button label. */
savingsLabel?: string
ctaLabel?: string
loadingLabel?: string
/** Line under the button, e.g. "One click · Instant download". Hidden by default. */
reassurance?: string
guaranteeTitle?: string
guaranteeText?: string
sealGuaranteeImage?: string
declineLabel?: string
declineHref?: string
/** @deprecated No longer rendered: the builder wires what happens after the click. */
declineNote?: string
/** @deprecated No longer rendered: the builder wires what happens after the click. */
successTitle?: string
/** @deprecated No longer rendered: the builder wires what happens after the click. */
successMessage?: string
/** @deprecated No longer rendered: the builder wires what happens after the click. */
continueLabel?: string
/** Legacy alias for href. */
continueHref?: string
errorMessage?: string
headingAs?: "h1" | "h2"
disabled?: boolean
/** "success" is accepted for older callers and renders as default. */
state?: DownsellState
onAccept?: () => void | Promise<void>
onDecline?: () => void
}
export function OneClickDownsell({
copy: copyOverrides,
href,
onAction,
className,
steps = DEFAULT_STEPS,
headline = "No problem. How about this instead?",
highlight = "this instead?",
lead = "Totally fine. Here’s a lighter way to start, added to your order in one click.",
reliefPoints = ["Nothing changes unless you click yes", "One click, no forms to fill in"],
productName = "The Funnel Starter Kit",
productNote,
productImage,
productImageAlt = "",
mediaCaption,
items = DEFAULT_ITEMS,
ctaLabel = "Yes! Add It For $47",
loadingLabel = "Adding to your order…",
reassurance,
guaranteeTitle = "30-day money-back guarantee",
guaranteeText = "Try it for 30 days. If it isn’t right for you, ask for your money back.",
sealGuaranteeImage,
declineLabel = "No thanks, I’ll skip this offer",
declineHref = "#decline",
continueHref,
errorMessage = "We couldn’t add this to your order. Please try again.",
headingAs = "h2",
disabled = false,
state = "default",
onAccept,
onDecline,
}: OneClickDownsellProps) {
const copy = { ...DOWNSELL_COPY, ...Object.fromEntries(Object.entries(copyOverrides ?? {}).filter(([, value]) => value !== undefined)) }
const action = onAction !== undefined ? onAction : onAccept
const destination = href !== undefined ? href : continueHref
const headingId = React.useId()
const forced = state === "default" ? undefined : state
const initial: "idle" | "loading" | "error" =
forced === "error" || forced === "loading" ? forced : "idle"
const [status, setStatus] = React.useState(initial)
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setStatus(initial)
}, [initial])
const isDisabled = disabled || forced === "disabled"
const loading = status === "loading"
const caption = mediaCaption ?? (items.length ? formatCopy(copy.caption, { count: String(items.length) }) : "")
const Heading = headingAs
const at = highlight ? headline.indexOf(highlight) : -1
const title =
at < 0 ? (
headline
) : (
<>
{headline.slice(0, at)}
<span className="ocd-mark">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
async function run() {
if (!action) return
try {
const result = action()
if (!result) return
setStatus("loading")
await result
if (alive.current) setStatus("idle")
} catch {
if (alive.current) setStatus("error")
}
}
function accept(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault()
if (isDisabled || status === "loading") return
void run()
}
function acceptLink(e: React.MouseEvent<HTMLAnchorElement>) {
if (status === "loading") {
e.preventDefault()
return
}
void run()
}
function decline(e: React.MouseEvent<HTMLAnchorElement>) {
if (onDecline) {
e.preventDefault()
onDecline()
return
}
if (!declineHref || declineHref.startsWith("#")) e.preventDefault()
}
const buttonInner = loading ? (
<>
<Loader2 className="ocd-spin" size={22} aria-hidden="true" />
<span>{loadingLabel}</span>
</>
) : (
<span>{ctaLabel}</span>
)
return (
<section className={["cf-one-click-downsell", className].filter(Boolean).join(" ")} data-force={forced} aria-labelledby={headingId}>
<style>{CSS}</style>
<div className="ocd-slab" aria-hidden="true" />
<div className="ocd-inner">
{steps.length > 0 && (
<ol className="ocd-steps" aria-label={copy.orderProgress}>
{steps.map((s, n) => (
<li
key={s.label}
className={"ocd-step is-" + s.status}
aria-current={s.status === "current" ? "step" : undefined}
>
<span className="ocd-dot" aria-hidden="true">
{s.status === "done" ? (
<Check size={14} strokeWidth={3.2} />
) : s.status === "skipped" ? (
<Minus size={14} strokeWidth={3.2} />
) : (
n + 1
)}
</span>
<span className="ocd-step-label">
{s.label}
<span className="ocd-sr">
{s.status === "done" ? copy.completeStep : s.status === "current" ? copy.currentStep : ""}
</span>
</span>
</li>
))}
</ol>
)}
<header className="ocd-head">
<Heading id={headingId} className="ocd-h">
{title}
</Heading>
{lead && <p className="ocd-lead">{lead}</p>}
{reliefPoints.length > 0 && (
<ul className="ocd-relief">
{reliefPoints.map((point, index) => (
<li key={index}>
<span className="ocd-tick" aria-hidden="true">
<Check size={14} strokeWidth={3.4} />
</span>
{typeof point === "string" ? point : point.text}
</li>
))}
</ul>
)}
</header>
<div className={"ocd-wrap" + (productImage ? "" : " no-media")}>
<article className="ocd-card" aria-label={productName}>
{productImage && (
<aside className="ocd-media">
<figure className="ocd-figure">
<div className="ocd-shot">
<img src={productImage} alt={productImageAlt} width={1200} height={900} decoding="async" />
</div>
{caption && <figcaption className="ocd-cap">{caption}</figcaption>}
</figure>
</aside>
)}
<div className="ocd-body">
<h3 className="ocd-name">{productName}</h3>
{productNote && <p className="ocd-note">{productNote}</p>}
{items.length > 0 && (
<ul className="ocd-items">
{items.map((item) => (
<li key={item.name} className={"ocd-item" + (item.itemImage ? " has-img" : "")}>
{item.itemImage && (
<img
className="ocd-thumb"
src={item.itemImage}
alt={item.itemImageAlt ?? ""}
width={56}
height={56}
loading="lazy"
decoding="async"
/>
)}
<div>
<p className="ocd-item-name">{item.name}</p>
{item.detail && <p className="ocd-item-detail">{item.detail}</p>}
</div>
{item.value && <span className="ocd-val">{formatCopy(copy.itemValue, { value: item.value })}</span>}
</li>
))}
</ul>
)}
<div className="ocd-action" aria-live="polite">
<form onSubmit={accept} noValidate>
{status === "error" && (
<p className="ocd-error" role="alert">
<AlertCircle size={18} aria-hidden="true" />
{errorMessage}
</p>
)}
{destination && !isDisabled ? (
<a
href={destination}
className="ocd-btn"
aria-busy={loading || undefined}
data-loading={loading || undefined}
onClick={acceptLink}
>
{buttonInner}
</a>
) : (
<button
type="submit"
className="ocd-btn"
disabled={isDisabled}
aria-busy={loading || undefined}
data-loading={loading || undefined}
>
{buttonInner}
</button>
)}
{reassurance && (
<p className="ocd-reassure">
<Lock size={15} aria-hidden="true" />
{reassurance}
</p>
)}
</form>
</div>
{guaranteeTitle && (
<div className="ocd-guarantee">
{sealGuaranteeImage ? (
<img className="ocd-seal" src={sealGuaranteeImage} alt="" width={64} height={64} loading="lazy" decoding="async" />
) : (
<span className="ocd-seal-ico" aria-hidden="true">
<ShieldCheck size={30} />
</span>
)}
<div>
<p className="ocd-g-title">{guaranteeTitle}</p>
{guaranteeText && <p className="ocd-g-text">{guaranteeText}</p>}
</div>
</div>
)}
{declineLabel && (
<p className="ocd-decline">
<a href={declineHref} onClick={decline}>
{declineLabel}
</a>
</p>
)}
</div>
</article>
</div>
</div>
</section>
)
}
export type DownsellItem = {
name: string
detail?: string
value?: string
itemImage?: string
itemImageAlt?: string
}
export type DownsellStep = { label: string; status: "done" | "skipped" | "current" }
/** "success" is accepted for older callers and renders as default. */
export type DownsellState = "default" | "hover" | "active" | "disabled" | "loading" | "error" | "success"
const DEFAULT_STEPS: DownsellStep[] = [
{ label: "Order placed", status: "done" },
{ label: "Upgrade skipped", status: "skipped" },
{ label: "Last option", status: "current" },
]
const DEFAULT_ITEMS: DownsellItem[] = [
{ name: "Funnel Planning Guide", detail: "Map your offer and the pages your funnel needs." },
{ name: "Page Copy Workbook", detail: "Draft your headline, offer, and call to action." },
{ name: "Launch Checklist", detail: "Review the links, forms, and next steps before launch." },
]
const CSS = `
.cf-one-click-downsell{--ocd-marker:color-mix(in oklch,var(--marker,#fae37c) 20%,var(--card));--ocd-r:var(--radius,22px);position:relative;isolation:isolate;overflow:hidden;overflow:clip;background:var(--band,#0f2747);color:var(--band-ink,#fff);font-family:var(--font-body,Arial,sans-serif);padding:clamp(36px,6vw,80px) clamp(16px,4vw,40px) clamp(52px,7vw,104px);-webkit-font-smoothing:antialiased}
.cf-one-click-downsell *,.cf-one-click-downsell *::before,.cf-one-click-downsell *::after{box-sizing:border-box}
.cf-one-click-downsell :where(h1,h2,h3,p,ul,ol,figure){margin:0;padding:0}
.cf-one-click-downsell :where(ul,ol){list-style:none}
.cf-one-click-downsell img{display:block;max-width:100%}
:where(.cf-one-click-downsell) .ocd-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
:where(.cf-one-click-downsell) .ocd-slab{position:absolute;left:0;right:0;bottom:0;height:44%;z-index:-1;background:color-mix(in oklch,var(--band) 94%,var(--band-ink));clip-path:polygon(0 22%,100% 0,100% 100%,0 100%)}
:where(.cf-one-click-downsell) .ocd-inner{max-width:1120px;margin:0 auto}
:where(.cf-one-click-downsell) .ocd-steps{display:flex;align-items:center;width:max-content;max-width:100%;margin:0 auto clamp(28px,4vw,44px);padding:6px;border-radius:999px;background:color-mix(in oklch,var(--band) 94%,var(--band-ink));box-shadow:inset 0 0 0 1px oklch(from var(--card) calc(l - 0.12) c h / 0.16),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21)}
:where(.cf-one-click-downsell) .ocd-step{display:flex;align-items:center;gap:10px;padding:9px 18px 9px 10px;border-radius:999px;color:var(--band-ink);font-size:15px;font-weight:600;line-height:1.2;white-space:nowrap}
:where(.cf-one-click-downsell) .ocd-step.is-done{color:var(--band-ink,#fff)}
:where(.cf-one-click-downsell) .ocd-step.is-current{background:var(--card,#fff);color:var(--ink,#101828);font-weight:800;box-shadow:inset 0 1px 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.21)}
:where(.cf-one-click-downsell) .ocd-dot{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:50%;font-family:var(--font-display,Arial,sans-serif);font-size:13px;font-weight:800}
:where(.cf-one-click-downsell) .ocd-step.is-done .ocd-dot{background:var(--success);color:var(--card);box-shadow:0 0 0 2px var(--band-ink,#fff)}
:where(.cf-one-click-downsell) .ocd-step.is-skipped .ocd-dot{background:var(--danger);color:var(--card);box-shadow:0 0 0 2px var(--band-ink,#fff)}
:where(.cf-one-click-downsell) .ocd-step.is-current .ocd-dot{background:var(--band,#0f2747);color:var(--band-ink,#fff)}
:where(.cf-one-click-downsell) .ocd-head{max-width:920px;margin:0 auto;text-align:center}
:where(.cf-one-click-downsell) .ocd-h{margin:0 auto;color:var(--band-ink,#fff);font-family:var(--font-display);font-size:clamp(2.6rem,6.6vw,5.25rem);font-weight:var(--display-weight,900);line-height:1.02;letter-spacing:var(--display-tracking,-.035em);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-one-click-downsell) .ocd-mark{color:var(--ink,#101828);background:var(--ocd-marker);padding:0 .12em .02em;margin:0 -.02em;border-radius:.2em .55em .25em .6em/.55em .25em .6em .3em;-webkit-box-decoration-break:clone;box-decoration-break:clone;box-shadow:0 1px 0px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21)}
:where(.cf-one-click-downsell) .ocd-lead{max-width:52ch;margin:clamp(16px,2vw,24px) auto 0;color:var(--band-ink);font-size:clamp(1.0625rem,1.6vw,1.3rem);font-weight:500;line-height:1.5;text-wrap:pretty}
:where(.cf-one-click-downsell) .ocd-relief{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 26px;margin-top:22px}
:where(.cf-one-click-downsell) .ocd-relief li{display:inline-flex;align-items:center;gap:10px;color:var(--band-ink,#fff);font-size:16px;font-weight:600;line-height:1.3;text-wrap:pretty}
:where(.cf-one-click-downsell) .ocd-tick{display:grid;place-items:center;flex:none;width:24px;height:24px;border-radius:50%;background:var(--success);color:var(--card);box-shadow:0 0 0 2px var(--band-ink,#fff)}
:where(.cf-one-click-downsell) .ocd-wrap{position:relative;isolation:isolate;max-width:1040px;margin:clamp(34px,5vw,56px) auto 0}
:where(.cf-one-click-downsell) .ocd-wrap.no-media{max-width:620px}
:where(.cf-one-click-downsell) .ocd-card{position:relative;display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);align-items:stretch;overflow:hidden;overflow:clip;border:1px solid oklch(from var(--ink,#101828) l c h / 0.14);border-radius:var(--card-radius,var(--radius,var(--ocd-r)));background:var(--card,#fff);color:var(--ink,#101828);box-shadow:var(--card-shadow,inset 0 0 0 6px oklch(from var(--ink) l c h / 0.14),inset 0 0 0 7px oklch(from var(--ink) l c h / 0.14),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.16))}
:where(.cf-one-click-downsell) .ocd-wrap.no-media .ocd-card{grid-template-columns:1fr}
:where(.cf-one-click-downsell) .ocd-media{position:relative;margin:7px 0 7px 7px;padding:clamp(20px,2.6vw,32px);border-radius:calc(var(--ocd-r) - 6px);background:transparent;border:1px solid oklch(from var(--ink) l c h / 0.16);border-color:transparent}
:where(.cf-one-click-downsell) .ocd-figure{position:-webkit-sticky;position:sticky;top:clamp(16px,3vh,32px);display:grid;gap:14px}
:where(.cf-one-click-downsell) .ocd-shot{position:relative;overflow:visible;border-radius:16px;background:transparent;box-shadow:none}
:where(.cf-one-click-downsell) .ocd-shot img{width:100%;height:auto;aspect-ratio:4/3;object-fit:contain;transition:transform .7s cubic-bezier(.2,.7,.2,1);animation:ocd-zoom .9s cubic-bezier(.2,.7,.2,1) backwards;filter:drop-shadow(0 3px 4px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21))}
:where(.cf-one-click-downsell) .ocd-card:hover .ocd-shot img{transform:scale(1.03)}
:where(.cf-one-click-downsell) .ocd-cap{justify-self:center;padding:8px 16px;border-radius:999px;background:var(--card,#fff);color:var(--ink,#101828);font-size:14px;font-weight:700;line-height:1.3;text-align:center;text-wrap:balance;box-shadow:0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21),0 0 0 1px oklch(from var(--card) calc(l - 0.12) c h / 0.08)}
:where(.cf-one-click-downsell) .ocd-body{padding:clamp(24px,3.4vw,44px) clamp(20px,3.4vw,44px) clamp(22px,3vw,34px)}
:where(.cf-one-click-downsell) .ocd-name{font-family:var(--font-display);font-size:clamp(1.6rem,2.6vw,2.2rem);font-weight:var(--display-weight,900);line-height:1.08;letter-spacing:var(--display-tracking,-.02em);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-one-click-downsell) .ocd-note{margin-top:10px;color:var(--muted,#4a5565);font-size:16px;font-weight:600;line-height:1.4}
:where(.cf-one-click-downsell) .ocd-items{display:grid;gap:14px;margin-top:22px}
:where(.cf-one-click-downsell) .ocd-item{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:14px}
:where(.cf-one-click-downsell) .ocd-item.has-img{grid-template-columns:56px minmax(0,1fr) auto}
:where(.cf-one-click-downsell) .ocd-thumb{width:56px;height:56px;border-radius:12px;object-fit:contain;background:transparent;box-shadow:none;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21))}
:where(.cf-one-click-downsell) .ocd-item-name{font-size:17px;font-weight:700;line-height:1.3;text-wrap:balance}
:where(.cf-one-click-downsell) .ocd-item-detail{margin-top:3px;color:var(--muted,#4a5565);font-size:15px;line-height:1.45;text-wrap:pretty}
:where(.cf-one-click-downsell) .ocd-val{margin-top:2px;padding:5px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--ink,#101828);font-size:14px;font-weight:700;line-height:1.3;white-space:nowrap;box-shadow:inset 0 0 0 1px oklch(from var(--card) calc(l - 0.12) c h / 0.08)}
:where(.cf-one-click-downsell) .ocd-action{margin-top:28px}
:where(.cf-one-click-downsell) .ocd-error{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px;padding:12px 14px;border-radius:12px;background:var(--danger-soft);border:1px solid var(--danger);color:var(--danger);font-size:15px;font-weight:600;line-height:1.4;text-wrap:pretty;animation:ocd-shake .4s ease}
:where(.cf-one-click-downsell) .ocd-error svg{flex:none;margin-top:1px}
:where(.cf-one-click-downsell) .ocd-btn{--sh:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);position:relative;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:70px;padding:14px 20px;border:1px solid var(--cta-2,#b42318);border-radius:var(--button-radius,var(--radius,16px));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-size:clamp(1.15rem,2vw,1.45rem);font-weight:var(--button-weight,800);line-height:1.15;text-align:center;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 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21));transition:transform .14s ease,box-shadow .14s ease,filter .14s 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);text-shadow:var(--button-text-shadow,none);text-decoration:none}
:where(.cf-one-click-downsell) .ocd-btn::after{content:"";position:absolute;top:-2px;bottom:-2px;left:-40%;width:34%;background:linear-gradient(100deg in oklch,transparent,var(--button-bg,var(--cta)),transparent);transform:skewX(-18deg);opacity:0;pointer-events:none}
:where(.cf-one-click-downsell) .ocd-btn:not(:disabled):hover,.cf-one-click-downsell[data-force=hover] .ocd-btn:not(:disabled){transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow,inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21))}
:where(.cf-one-click-downsell) .ocd-btn:not(:disabled):hover::after,.cf-one-click-downsell[data-force=hover] .ocd-btn:not(:disabled)::after{animation:ocd-sheen .8s ease}
:where(.cf-one-click-downsell) .ocd-btn:not(:disabled):active,.cf-one-click-downsell[data-force=active] .ocd-btn:not(:disabled){transform:translateY(4px);filter:none;background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l - 0.12) c h / 0.35),inset 0 3px 8px oklch(from var(--card) calc(l - 0.12) c h / 0.35),0 1px 0px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21),0 3px 6px -1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21)}
:where(.cf-one-click-downsell) .ocd-btn:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:4px}
:where(.cf-one-click-downsell) .ocd-btn:disabled{cursor:not-allowed;border-color:var(--card-border,oklch(from var(--ink) l c h / 0.22));background:var(--card);color:var(--muted);filter:none;box-shadow:none;text-shadow:none}
:where(.cf-one-click-downsell) .ocd-btn[data-loading]{cursor:progress}
:where(.cf-one-click-downsell) .ocd-spin{flex:none;animation:ocd-spin .8s linear infinite}
:where(.cf-one-click-downsell) .ocd-reassure{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:14px;color:var(--muted,#4a5565);font-size:15px;font-weight:600;line-height:1.35;text-align:center;text-wrap:pretty}
:where(.cf-one-click-downsell) .ocd-reassure svg{flex:none}
:where(.cf-one-click-downsell) .ocd-guarantee{display:grid;grid-template-columns:64px minmax(0,1fr);gap:14px;align-items:start;margin-top:22px;padding:14px 16px;border-radius:var(--card-radius,var(--radius,14px));background:color-mix(in oklch,var(--ink) 4%,var(--card));border:1px solid oklch(from var(--ink) l c h / 0.08);box-shadow:none}
:where(.cf-one-click-downsell) .ocd-seal{width:64px;height:64px;object-fit:contain;mix-blend-mode:normal;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.21))}
:where(.cf-one-click-downsell) .ocd-seal-ico{display:grid;place-items:center;width:56px;height:56px;border-radius:50%;background:transparent;color:var(--success);box-shadow:none}
:where(.cf-one-click-downsell) .ocd-g-title{font-size:16px;font-weight:800;line-height:1.3;text-wrap:balance}
:where(.cf-one-click-downsell) .ocd-g-text{margin-top:3px;color:var(--muted,#4a5565);font-size:15px;line-height:1.45;text-wrap:pretty}
:where(.cf-one-click-downsell) .ocd-decline{margin-top:16px;text-align:center}
:where(.cf-one-click-downsell) .ocd-decline a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:6px 8px;border-radius:8px;color:var(--button-2-ink,var(--ink));font-size:16px;font-weight:600;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--accent,#0f5fc2) l c h / 0.4);text-decoration-thickness:1.5px;text-underline-offset:4px;text-wrap:pretty;transition:color .15s ease,text-decoration-color .15s ease}
:where(.cf-one-click-downsell) .ocd-decline a:hover{color:var(--button-2-ink,var(--ink));text-decoration-color:currentColor}
:where(.cf-one-click-downsell) .ocd-decline a:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:2px}
:where(.cf-one-click-downsell) .ocd-h,:where(.cf-one-click-downsell) .ocd-lead,:where(.cf-one-click-downsell) .ocd-relief,:where(.cf-one-click-downsell) .ocd-wrap{animation:ocd-in .45s cubic-bezier(.2,.7,.2,1) backwards}
:where(.cf-one-click-downsell) .ocd-lead{animation-delay:.08s}
:where(.cf-one-click-downsell) .ocd-relief{animation-delay:.14s}
:where(.cf-one-click-downsell) .ocd-wrap{animation-delay:.2s}
@keyframes ocd-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ocd-zoom{from{transform:scale(1.06)}to{transform:scale(1)}}
@keyframes ocd-sheen{from{left:-40%;opacity:1}to{left:120%;opacity:1}}
@keyframes ocd-spin{to{transform:rotate(360deg)}}
@keyframes ocd-shake{0%,100%{transform:none}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media (max-width:860px){
:where(.cf-one-click-downsell) .ocd-card{grid-template-columns:1fr}
:where(.cf-one-click-downsell) .ocd-media{margin:7px 7px 0}
:where(.cf-one-click-downsell) .ocd-figure{position:static}
:where(.cf-one-click-downsell) .ocd-shot img{aspect-ratio:16/10}
}
@media (max-width:640px){
:where(.cf-one-click-downsell) .ocd-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;border-radius:18px}
:where(.cf-one-click-downsell) .ocd-step{flex-direction:column;gap:6px;padding:10px 6px;border-radius:13px;font-size:14px;white-space:normal;text-align:center;text-wrap:balance}
:where(.cf-one-click-downsell) .ocd-relief{display:none}
:where(.cf-one-click-downsell) .ocd-item{grid-template-columns:minmax(0,1fr)}
:where(.cf-one-click-downsell) .ocd-item.has-img{grid-template-columns:52px minmax(0,1fr);gap:12px}
:where(.cf-one-click-downsell) .ocd-thumb{width:52px;height:52px}
:where(.cf-one-click-downsell) .ocd-val{justify-self:start;margin-top:-4px}
:where(.cf-one-click-downsell) .ocd-item.has-img .ocd-val{grid-column:2}
:where(.cf-one-click-downsell) .ocd-action{margin-top:24px}
:where(.cf-one-click-downsell) .ocd-btn{min-height:64px;gap:10px;padding:12px 14px;font-size:1.125rem}
:where(.cf-one-click-downsell) .ocd-guarantee{grid-template-columns:56px minmax(0,1fr);padding:12px 14px}
:where(.cf-one-click-downsell) .ocd-seal{width:56px;height:56px}
}
@media (prefers-reduced-motion:reduce){
.cf-one-click-downsell *,.cf-one-click-downsell *::before,.cf-one-click-downsell *::after{animation:none!important;transition:none!important}
:where(.cf-one-click-downsell) .ocd-btn:not(:disabled):hover,:where(.cf-one-click-downsell) .ocd-btn:not(:disabled):active{transform:none}
:where(.cf-one-click-downsell) .ocd-card:hover .ocd-shot img{transform:none}
}
@media (forced-colors:active){:where(.cf-one-click-downsell) .ocd-btn,:where(.cf-one-click-downsell) .ocd-card{border:2px solid CanvasText}}
`
export default OneClickDownsell
const DOWNSELL_COPY = {
caption: '{count} pieces · one download', orderProgress: 'Order progress', completeStep: ' (complete)', currentStep: ' (current step)',
itemValue: '{value} value', price: 'Price', regularPrice: 'Regular price ', today: 'Today ', savings: 'You save {amount}', percentOff: '{percent}% off',
}
type DownsellCopy = typeof DOWNSELL_COPY
function formatCopy(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => values[key] ?? match)
}
pieces/checkout/one-click-downsell/specimen.tsx 37 lines
import __studioImage596d5e75 from "../assets/21518f2df10a14f5.webp";
import __studioImagecbeee13c from "../assets/d4d125d79ddea947.webp";
import * as React from "react"
import { slot } from '../../slots'
import defaults from "../../studio-defaults.json"
import OneClickDownsell, { type DownsellState } from "../one-click-downsell"
export const states = ["default", "hover", "active", "disabled", "error"]
export default function OneClickDownsellSpecimen({ state = "default" }: { state?: string }) {
const s = defaults.sample
return (
<div>
<OneClickDownsell
state={state as DownsellState}
headline="No problem. How about this instead?"
highlight="this instead?"
lead={"Totally fine. " + s.reason}
reliefPoints={["Nothing changes unless you click yes", "One click, no forms to fill in"]}
productName={s.name}
productNote={s.note}
productImage={slot('product',__studioImage596d5e75)}
productImageAlt="The Funnel Starter Kit: planning guide, page copy workbook and launch checklist"
mediaCaption="Guide · Workbook · Checklist"
items={s.items.map(({image,imageAlt,...item},i)=>({...item,itemImage:slot(`item-${i+1}`,image),itemImageAlt:imageAlt}))}
ctaLabel={"Yes! Add It For " + s.price}
reassurance="One click · Instant download"
guaranteeTitle={s.guarantee}
guaranteeText="Try the whole kit for 30 days. If it isn’t right for you, ask for your money back."
sealGuaranteeImage={slot('seal-guarantee',__studioImagecbeee13c)}
declineLabel="No thanks, I’ll plan my funnel without the kit"
declineHref="#decline"
errorMessage="We couldn’t add this to your order. Please try again."
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalOneClickDownsell |
Partial<DownsellCopy> |
|
href OptionalOneClickDownsell |
string |
|
onAction OptionalOneClickDownsell |
() => void | Promise<void> |
|
className OptionalOneClickDownsell |
string |
|
steps OptionalOneClickDownsell |
DownsellStep[] |
Default DEFAULT_STEPS
|
headline OptionalOneClickDownsell |
string |
Default "No problem. How about this instead?"
|
highlight OptionalOneClickDownsell |
string |
Default "this instead?"
|
lead OptionalOneClickDownsell |
string |
Default "Totally fine. Here’s a lighter way to start, added to your order in one click."
|
reliefPoints OptionalOneClickDownsell |
Array<{ text: React.ReactNode } | string> |
Default ["Nothing changes unless you click yes", "One click, no forms to fill in"]
|
productName OptionalOneClickDownsell |
string |
Default "The Funnel Starter Kit"
|
productNote OptionalOneClickDownsell |
string |
|
productImage OptionalOneClickDownsell |
string |
|
productImageAlt OptionalOneClickDownsell |
string |
Default ""
|
mediaCaption OptionalOneClickDownsell |
string |
|
items OptionalOneClickDownsell |
DownsellItem[] |
Default DEFAULT_ITEMS
|
wasLabel OptionalOneClickDownsell |
string |
|
priceLabel OptionalOneClickDownsell |
string |
|
regularPrice OptionalOneClickDownsell |
string |
|
price OptionalOneClickDownsell |
string |
|
savingsLabel OptionalOneClickDownsell |
string |
|
ctaLabel OptionalOneClickDownsell |
string |
Default "Yes! Add It For $47"
|
loadingLabel OptionalOneClickDownsell |
string |
Default "Adding to your order…"
|
reassurance OptionalOneClickDownsell |
string |
|
guaranteeTitle OptionalOneClickDownsell |
string |
Default "30-day money-back guarantee"
|
guaranteeText OptionalOneClickDownsell |
string |
Default "Try it for 30 days. If it isn’t right for you, ask for your money back."
|
sealGuaranteeImage OptionalOneClickDownsell |
string |
|
declineLabel OptionalOneClickDownsell |
string |
Default "No thanks, I’ll skip this offer"
|
declineHref OptionalOneClickDownsell |
string |
Default "#decline"
|
declineNote OptionalOneClickDownsell |
string |
|
successTitle OptionalOneClickDownsell |
string |
|
successMessage OptionalOneClickDownsell |
string |
|
continueLabel OptionalOneClickDownsell |
string |
|
continueHref OptionalOneClickDownsell |
string |
|
errorMessage OptionalOneClickDownsell |
string |
Default "We couldn’t add this to your order. Please try again."
|
headingAs OptionalOneClickDownsell |
"h1" | "h2" |
Default "h2"
|
disabled OptionalOneClickDownsell |
boolean |
Default false
|
state OptionalOneClickDownsell |
DownsellState |
Default "default"
|
onAccept OptionalOneClickDownsell |
() => void | Promise<void> |
|
onDecline OptionalOneClickDownsell |
() => void |
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-ink- 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.
--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).
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
21518f2df10a14f5.webp
image/webp · 93.8 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d4d125d79ddea947.webp
image/webp · 353 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB