One Click Downsell 5
First-step downsell after a declined programme: a calm photo panel says “no problem”, then a white offer card rises over
Use it in a prompt
Use checkout/one-click-downsell-5 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-5.tsx. - Import it and pass your copy and images (Props tab):
import { OneClickDownsell5 } from "@/components/funneldna/checkout/one-click-downsell-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-click-downsell-5/component.tsx 554 lines
// layout: scroll-panels
// First-step downsell after a declined programme: a calm photo panel says “no problem”, then a white offer card rises over
// its edge with one session, its three parts, a till-receipt price and a reveal of how the fee carries over to the programme.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, Plus, ShieldCheck, Sprout } from 'lucide-react'
export type OneClickDownsell5Step = {
/** What happens in this part of the session. */
text: string
/** Length in minutes; when every step has one, a time bar shows the split. */
minutes?: number
/** Label beside the line; defaults to minutesLabel when minutes are set. */
label?: string
}
export type OneClickDownsell5Line = {
label: string
/** As shown, e.g. '$120', 'Included' or '−$25'; the row hides when empty. */
amount?: string
}
export type OneClickDownsell5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneClickDownsell5Props = {
/** Calm status line above the headline; hidden when empty. */
notice?: string
/** First headline line, e.g. 'No problem.' */
opener?: string
headline?: string
lead?: string
/** Slot 'scene': the full-bleed room photo; it becomes a short banner on phones. */
sceneImage?: string
sceneImageAlt?: string
/** CSS object-position for the photo, e.g. '62% 50%'. */
sceneFocus?: string
productName?: string
/** Small line under the name, e.g. '45 minutes · One-to-one'; hidden when empty. */
productNote?: string
/** The promise of the session; the highlight phrase inside it gets one marker stroke. */
promise?: string
highlight?: string
/** What happens in the session, as short lines. */
steps?: OneClickDownsell5Step[]
/** '{minutes}' is replaced with the step’s minutes. */
minutesLabel?: string
/** Accessible name for the step list. */
stepsLabel?: string
/** Accessible name for the receipt. */
receiptLabel?: string
/** Receipt rows above the subtotal. */
lines?: OneClickDownsell5Line[]
/** Subtotal as shown; the row hides when empty. */
subtotal?: string
subtotalLabel?: string
/** Discount row; hidden without an amount. */
discount?: OneClickDownsell5Line
/** Today’s total; the total row hides when empty. */
price?: string
totalLabel?: string
/** Foot-in-the-door line saying the fee counts toward the programme. Only when supplied. */
creditLine?: string
/** The supplied credit rule, revealed by the toggle; the toggle hides when empty. */
creditRule?: React.ReactNode
creditQuestion?: string
/** Show the credit rule open on first render. */
defaultOpen?: boolean
/** Risk reversal that leads into the button; hidden when empty. */
riskTitle?: string
riskText?: string
ctaLabel?: string
/** Button text while a returned onAction promise is pending. */
loadingLabel?: string
/** One short line under the button. */
reassurance?: string
/** Shown when onAction rejects, or in the error state. */
errorMessage?: string
/** Quiet decline link; hidden when empty. */
declineLabel?: string
/** Decline destination; '#' links stay on the page. */
declineHref?: string
/** Accept destination: when set the button renders as a link. */
href?: string
/** Accept action. A returned promise shows loadingLabel; a rejection shows errorMessage. */
onAction?: () => void | Promise<void>
/** Decline action; when set it replaces declineHref navigation. */
onDecline?: () => void
headingAs?: 'h1' | 'h2'
disabled?: boolean
state?: OneClickDownsell5State
className?: string
}
const DEFAULT_STEPS: OneClickDownsell5Step[] = [
{ label: 'First', text: 'Where you are right now, in plain words.' },
{ label: 'Then', text: 'The one change that matters most this month.' },
{ label: 'Last', text: 'A written plan you take home.' },
]
export function OneClickDownsell5({
notice = 'Your order is saved. Nothing changes unless you say yes.',
opener = 'No problem.',
headline = 'Start with a single session.',
lead = 'Not ready for the full programme? Book one focused session and leave knowing the change to make first.',
sceneImage,
sceneImageAlt = '',
sceneFocus = '62% 50%',
productName = 'Your First-Step Session',
productNote = '',
promise = 'Leave with one clear next step, written down.',
highlight = 'one clear next step',
steps = DEFAULT_STEPS,
minutesLabel = '{minutes} min',
stepsLabel = 'What happens in your session',
receiptLabel = 'Today’s order',
lines = [],
subtotal,
subtotalLabel = 'Subtotal',
discount,
price,
totalLabel = 'Today',
creditLine,
creditRule,
creditQuestion = 'What if I want the full programme later?',
defaultOpen = false,
riskTitle = '',
riskText = '',
ctaLabel = 'Yes, Book My First Session',
loadingLabel = 'Booking your session…',
reassurance = 'One click · No new forms',
errorMessage = 'We couldn’t book your session. Please try again.',
declineLabel = 'No thanks, I’ll skip the session',
declineHref = '#decline',
href,
onAction,
onDecline,
headingAs = 'h2',
disabled = false,
state = 'default',
className,
}: OneClickDownsell5Props) {
const headingId = React.useId()
const ruleId = React.useId()
const riskId = React.useId()
const noteId = React.useId()
const errorId = React.useId()
const forcedError = state === 'error'
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>(forcedError ? 'error' : 'idle')
const [open, setOpen] = React.useState(defaultOpen)
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setStatus(forcedError ? 'error' : 'idle')
}, [forcedError])
const isDisabled = disabled || state === 'disabled'
const loading = status === 'loading'
const blocked = isDisabled || loading
const Heading = headingAs
const rows = lines.filter((line) => line.amount)
const showBar = steps.length > 0 && steps.every((step) => typeof step.minutes === 'number' && step.minutes > 0)
const hasRisk = Boolean(riskTitle || riskText)
const hasCredit = Boolean(creditLine || creditRule)
const hasRows = rows.length > 0 || Boolean(subtotal) || Boolean(discount?.amount) || Boolean(price)
const hasReceipt = hasRows || hasCredit
const describedBy =
[hasRisk ? riskId : '', reassurance ? noteId : '', status === 'error' ? errorId : ''].filter(Boolean).join(' ') ||
undefined
async function run() {
if (!onAction) return
try {
const result: unknown = onAction()
if (result && typeof (result as PromiseLike<void>).then === 'function') {
setStatus('loading')
await result
if (alive.current) setStatus('idle')
} else {
setStatus('idle')
}
} catch {
if (alive.current) setStatus('error')
}
}
function accept() {
if (blocked) return
void run()
}
function acceptLink(event: React.MouseEvent<HTMLAnchorElement>) {
if (loading) {
event.preventDefault()
return
}
void run()
}
function decline(event: React.MouseEvent<HTMLAnchorElement>) {
if (onDecline) {
event.preventDefault()
onDecline()
return
}
if (!declineHref || declineHref.startsWith('#')) event.preventDefault()
}
const btnClass = ['ocd5-btn', state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : '']
.filter(Boolean)
.join(' ')
const inner = loading ? (
<>
<Loader2 className='ocd5-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{ctaLabel}</span>
)
const actionControl =
href && !blocked ? (
<a className={btnClass} href={href} onClick={acceptLink} aria-describedby={describedBy}>
{inner}
</a>
) : (
<button
type='button'
className={btnClass}
onClick={accept}
disabled={blocked}
aria-busy={loading || undefined}
aria-describedby={describedBy}
>
{inner}
</button>
)
return (
<section className={['cf-one-click-downsell-5', className].filter(Boolean).join(' ')} aria-labelledby={headingId}>
<style>{CSS}</style>
<div className={sceneImage ? 'ocd5-stage has-photo' : 'ocd5-stage'}>
{sceneImage ? (
<img
className='ocd5-photo'
src={sceneImage}
alt={sceneImageAlt}
width={1600}
height={900}
decoding='async'
style={{ objectPosition: sceneFocus }}
/>
) : null}
<div className='ocd5-copy'>
<div className='ocd5-copy-col'>
{notice ? (
<p className='ocd5-notice ocd5-in'>
<Check className='ocd5-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{notice}
</p>
) : null}
<Heading className='ocd5-title ocd5-in' id={headingId} style={delay('.07s')}>
{opener ? <span>{opener}</span> : null}
<span>{headline}</span>
</Heading>
{lead ? (
<p className='ocd5-lead ocd5-in' style={delay('.14s')}>
{lead}
</p>
) : null}
</div>
</div>
</div>
<div className='ocd5-card ocd5-in' style={delay('.21s')}>
<div className='ocd5-session'>
<h3 className='ocd5-name'>{productName}</h3>
{productNote ? <p className='ocd5-note'>{productNote}</p> : null}
{promise ? <p className='ocd5-promise'>{marked(promise, highlight)}</p> : null}
{showBar ? (
<div className='ocd5-bar' aria-hidden='true'>
{steps.map((step, i) => (
<span key={i} style={{ ...segment(i), flexGrow: step.minutes }} />
))}
</div>
) : null}
{steps.length ? (
<ol className={showBar ? 'ocd5-steps' : 'ocd5-steps is-plain'} aria-label={stepsLabel}>
{steps.map((step, i) => {
const when =
step.label ?? (step.minutes ? minutesLabel.replace('{minutes}', String(step.minutes)) : '')
return (
<li key={i} className={when ? undefined : 'no-when'} style={segment(i)}>
{when ? (
<span className='ocd5-when'>
{showBar ? <span className='ocd5-dot' aria-hidden='true' /> : null}
{when}
</span>
) : null}
<span className='ocd5-what'>{step.text}</span>
</li>
)
})}
</ol>
) : null}
</div>
<div className='ocd5-buy'>
{hasReceipt ? (
<div className='ocd5-receipt' role='group' aria-label={receiptLabel}>
{hasRows ? (
<dl className='ocd5-rows'>
{rows.map((line, i) => (
<div className='ocd5-row' key={i}>
<dt>{line.label}</dt>
<dd>{line.amount}</dd>
</div>
))}
{subtotal ? (
<div className='ocd5-row is-sub'>
<dt>{subtotalLabel}</dt>
<dd>{subtotal}</dd>
</div>
) : null}
{discount?.amount ? (
<div className='ocd5-row is-off'>
<dt>{discount.label}</dt>
<dd>{discount.amount}</dd>
</div>
) : null}
{price ? (
<div className='ocd5-total'>
<dt>{totalLabel}</dt>
<dd>{price}</dd>
</div>
) : null}
</dl>
) : null}
{hasCredit ? (
<div className='ocd5-credit'>
{creditLine ? (
<p className='ocd5-credit-line'>
<Sprout className='ocd5-inline' size={18} strokeWidth={2.5} aria-hidden='true' />
{creditLine}
</p>
) : null}
{creditRule ? (
<>
<button
type='button'
className='ocd5-toggle'
aria-expanded={open}
aria-controls={ruleId}
onClick={() => setOpen((value) => !value)}
>
<span>{creditQuestion}</span>
<span className='ocd5-toggle-icon' aria-hidden='true'>
<Plus size={16} strokeWidth={2.5} />
</span>
</button>
<div className='ocd5-rule' id={ruleId} data-open={open ? '' : undefined}>
<div className='ocd5-rule-inner'>
<p>{creditRule}</p>
</div>
</div>
</>
) : null}
</div>
) : null}
</div>
) : null}
{hasRisk ? (
<div className='ocd5-risk' id={riskId}>
{riskTitle ? (
<p className='ocd5-risk-title'>
<ShieldCheck className='ocd5-inline' size={20} strokeWidth={2.5} aria-hidden='true' />
{riskTitle}
</p>
) : null}
{riskText ? <p className='ocd5-risk-text'>{riskText}</p> : null}
</div>
) : null}
<div className='ocd5-action'>{actionControl}</div>
{reassurance ? (
<p className='ocd5-reassure' id={noteId}>
<Lock className='ocd5-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
{status === 'error' ? (
<p className='ocd5-error' id={errorId} role='alert'>
<AlertCircle className='ocd5-inline' size={18} strokeWidth={2.5} aria-hidden='true' />
{errorMessage}
</p>
) : null}
{declineLabel ? (
<p className='ocd5-decline-wrap'>
<a className='ocd5-decline' href={declineHref || '#'} onClick={decline}>
{declineLabel}
</a>
</p>
) : null}
</div>
</div>
</section>
)
}
export default OneClickDownsell5
const SEGMENTS = ['100%', '64%', '38%']
function delay(value: string): React.CSSProperties {
return { '--d': value } as React.CSSProperties
}
function segment(index: number): React.CSSProperties {
return {
'--seg': `color-mix(in oklch, var(--accent-fill, var(--accent)) ${SEGMENTS[index % SEGMENTS.length]}, var(--card))`,
} as React.CSSProperties
}
function marked(text: string, phrase?: string) {
const at = phrase ? text.indexOf(phrase) : -1
if (!phrase || at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='ocd5-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
const S = '.cf-one-click-downsell-5'
const CSS = `
${S}{--ocd5-g:clamp(16px,5vw,48px);--ocd5-overlap:clamp(112px,12vw,176px);--ocd5-marker:var(--marker,#fae37c);--ocd5-hair:oklch(from var(--ink) l c h / .12);--ocd5-well:color-mix(in oklch,var(--ink) 4%,var(--card));--ocd5-shadow:var(--shadow,oklch(.22 .03 260));--ocd5-btn:var(--button-bg,var(--cta));position:relative;display:block;width:100%;overflow-x:clip;padding-bottom:clamp(64px,8.5vw,120px);background:var(--surface);color:var(--ink);font-family:var(--font-body)}
${S} *,${S} *::before,${S} *::after{box-sizing:border-box}
${S} :where(h2,h3,p,ol,dl,dt,dd){margin:0}
${S} .ocd5-stage{position:relative;isolation:isolate;min-height:clamp(460px,44vw,640px);background:var(--band);color:var(--band-ink)}
${S} .ocd5-photo{position:absolute;inset:0;z-index:-2;display:block;width:100%;height:100%;object-fit:cover}
${S} .ocd5-stage.has-photo::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(90deg,oklch(from var(--band) l c h / .94) 0,oklch(from var(--band) l c h / .9) calc(max(var(--ocd5-g),50% - 560px) + 36rem),oklch(from var(--band) l c h / .4) calc(max(var(--ocd5-g),50% - 560px) + 36rem + 18vw),oklch(from var(--band) l c h / .08) 100%)}
${S} .ocd5-copy{position:relative;width:min(1120px,100% - 2 * var(--ocd5-g));margin-inline:auto;padding-block:clamp(56px,8vw,112px) calc(var(--ocd5-overlap) + clamp(40px,5vw,64px))}
${S} .ocd5-copy-col{max-width:34rem}
${S} .ocd5-notice{display:inline-block;max-width:100%;margin-bottom:24px;padding:6px 14px;border-radius:1.25em;background:oklch(from var(--band-ink) l c h / .12);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${S} .ocd5-inline{display:inline-block;flex:none;vertical-align:-.15em;margin-inline-end:.4em}
${S} .ocd5-title{font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);font-weight:var(--display-weight,800);line-height:1.06;letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);text-wrap:balance}
${S} .ocd5-title>span{display:block}
${S} .ocd5-lead{margin-top:16px;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;text-wrap:pretty}
${S} .ocd5-card{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,27rem);align-items:start;gap:clamp(32px,5vw,64px);width:min(1120px,100% - 2 * var(--ocd5-g));margin:calc(-1 * var(--ocd5-overlap)) auto 0;padding:clamp(20px,3vw,32px);border:1px solid var(--card-border,color-mix(in oklch,var(--accent) 22%,var(--card)));border-radius:var(--card-radius,var(--radius,14px));background:var(--card);color:var(--ink);box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--ocd5-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--ocd5-shadow) l c h / .32)))}
${S} .ocd5-name{font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);font-weight:var(--display-weight,800);line-height:1.15;letter-spacing:-.01em;text-transform:var(--display-case,none);text-wrap:balance}
${S} .ocd5-note{margin-top:8px;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4}
${S} .ocd5-promise{margin-top:16px;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:600;line-height:1.4;text-wrap:pretty}
${S} .ocd5-mark{margin:0 -.06em;padding:0 .18em;border-radius:.2em .45em .3em .5em;background:linear-gradient(180deg,transparent 10%,color-mix(in oklch,var(--ocd5-marker) 88%,transparent) 10%,color-mix(in oklch,var(--ocd5-marker) 88%,transparent) 94%,transparent 94%);color:var(--field-ink,var(--ink));-webkit-box-decoration-break:clone;box-decoration-break:clone}
${S} .ocd5-bar{display:flex;gap:3px;height:8px;margin-top:24px;border-radius:999px;overflow:hidden}
${S} .ocd5-bar span{min-width:12px;background:var(--seg)}
${S} .ocd5-steps{margin-top:12px;padding:0;list-style:none}
${S} .ocd5-steps.is-plain{margin-top:20px}
${S} .ocd5-steps li{display:grid;grid-template-columns:5.5rem minmax(0,1fr);align-items:start;gap:12px;padding-block:12px}
${S} .ocd5-steps li.no-when{grid-template-columns:minmax(0,1fr)}
${S} .ocd5-steps li+li{border-top:1px solid var(--ocd5-hair)}
${S} .ocd5-when{display:inline-flex;align-items:center;gap:8px;padding-top:.22em;color:var(--accent);font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap}
${S} .ocd5-dot{flex:none;width:10px;height:10px;border-radius:999px;background:var(--seg)}
${S} .ocd5-what{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${S} .ocd5-buy>:first-child{margin-top:0}
${S} .ocd5-receipt{padding:16px 20px 20px;border-radius:10px;background:var(--ocd5-well)}
${S} .ocd5-rows{display:grid;gap:8px}
${S} .ocd5-row{display:flex;align-items:baseline;justify-content:space-between;gap:16px;font-size:1.0625rem;line-height:1.4}
${S} .ocd5-row dt{min-width:0;text-wrap:pretty}
${S} .ocd5-row dd{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
${S} .ocd5-row.is-sub{font-size:.9375rem;font-weight:700}
${S} .ocd5-row.is-sub dd{font-weight:700}
${S} .ocd5-row.is-off{color:var(--success);font-weight:700}
${S} .ocd5-row.is-off dd{font-weight:800}
${S} .ocd5-total{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-top:8px}
${S} .ocd5-total dt{font-size:1.0625rem;font-weight:800;line-height:1.2}
${S} .ocd5-total dd{font-family:var(--font-display);font-size:clamp(2.5rem,4.2vw,3.75rem);font-weight:var(--display-weight,800);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;white-space:nowrap}
${S} .ocd5-rows+.ocd5-credit{margin-top:16px;padding-top:12px;border-top:1px solid var(--ocd5-hair)}
${S} .ocd5-credit-line{font-size:1rem;font-weight:700;line-height:1.45;text-wrap:pretty}
${S} .ocd5-credit-line .ocd5-inline{color:var(--success)}
${S} .ocd5-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;width:calc(100% + 24px);min-height:44px;margin:8px -12px 0;padding:8px 12px;border:0;border-radius:8px;background:transparent;color:var(--ink);font:inherit;font-size:1rem;font-weight:700;line-height:1.3;text-align:left;cursor:pointer;transition:background .16s ease}
${S} .ocd5-credit>.ocd5-toggle:first-child{margin-top:0}
${S} .ocd5-toggle:hover{background:color-mix(in oklch,var(--ink) 6%,var(--ocd5-well))}
${S} .ocd5-toggle:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
${S} .ocd5-toggle-icon{display:grid;flex:none;place-items:center;width:28px;height:28px;border-radius:999px;background:var(--secondary);color:var(--secondary-ink);transition:transform .2s cubic-bezier(.2,.7,.2,1)}
${S} .ocd5-toggle[aria-expanded=true] .ocd5-toggle-icon{transform:rotate(45deg)}
${S} .ocd5-rule{display:grid;grid-template-rows:0fr;visibility:hidden;transition:grid-template-rows .3s cubic-bezier(.2,.7,.2,1),visibility 0s linear .3s}
${S} .ocd5-rule[data-open]{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows .3s cubic-bezier(.2,.7,.2,1),visibility 0s}
${S} .ocd5-rule-inner{min-height:0;overflow:hidden}
${S} .ocd5-rule p{padding-top:8px;font-size:1rem;line-height:1.5;text-wrap:pretty}
${S} .ocd5-risk{margin-top:24px}
${S} .ocd5-risk-title{font-size:1.125rem;font-weight:800;line-height:1.3;text-wrap:balance}
${S} .ocd5-risk-title .ocd5-inline{color:var(--accent)}
${S} .ocd5-risk-text{margin-top:4px;color:var(--muted);font-size:1.0625rem;line-height:1.5;text-wrap:pretty}
${S} .ocd5-action{margin-top:24px}
${S} .ocd5-risk+.ocd5-action{margin-top:16px}
${S} .ocd5-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ocd5-btn) 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-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-align:center;text-decoration:none;text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);text-wrap:balance;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ocd5-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ocd5-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--ocd5-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--ocd5-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${S} .ocd5-btn:not(:disabled):hover,${S} .ocd5-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--ocd5-btn) 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(--ocd5-btn) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--ocd5-btn) calc(l - .2) c h),0 1px 2px oklch(from var(--ocd5-shadow) l c h / .34),0 10px 18px -6px oklch(from var(--ocd5-shadow) l c h / .55))}
${S} .ocd5-btn:not(:disabled):active,${S} .ocd5-btn.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--ocd5-btn) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--ocd5-btn) calc(l - .24) c h / .5),inset 0 -2px 0 oklch(from var(--ocd5-btn) calc(l - .16) c h),0 1px 1px oklch(from var(--ocd5-shadow) l c h / .3)}
${S} .ocd5-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${S} .ocd5-btn:disabled{cursor:not-allowed}
${S} .ocd5-btn:disabled:not([aria-busy=true]){background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm))}
${S} .ocd5-btn[aria-busy=true]{cursor:progress}
${S} .ocd5-reassure{margin-top:12px;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-align:center;text-wrap:pretty}
${S} .ocd5-error{margin-top:12px;padding:10px 12px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty}
${S} .ocd5-decline-wrap{margin-top:8px;text-align:center}
${S} .ocd5-decline{display:inline-flex;align-items:center;min-height:44px;padding:4px 8px;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--muted) l c h / .5);text-underline-offset:.18em;text-wrap:pretty}
${S} .ocd5-decline:hover{color:var(--ink);text-decoration-color:currentColor}
${S} .ocd5-decline:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px;border-radius:6px}
@keyframes ocd5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ocd5-spin{to{transform:rotate(360deg)}}
${S} .ocd5-in{animation:ocd5-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
${S} .ocd5-spin{animation:ocd5-spin .8s linear infinite}
@media (max-width:900px){
${S} .ocd5-card{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:720px){
${S} .ocd5-stage{min-height:0;background:var(--surface);color:var(--ink)}
${S} .ocd5-photo{position:static;z-index:auto;height:200px}
${S} .ocd5-stage.has-photo::after{display:none}
${S} .ocd5-copy{padding-block:28px}
${S} .ocd5-notice{margin-bottom:16px;background:color-mix(in oklch,var(--ink) 6%,var(--surface))}
${S} .ocd5-card{margin-top:0;padding:20px}
${S} .ocd5-receipt{padding:14px 16px 16px}
${S} .ocd5-btn{padding-inline:20px}
}
@media (prefers-reduced-motion:reduce){
${S} .ocd5-in,${S} .ocd5-spin{animation:none}
${S} .ocd5-btn,${S} .ocd5-toggle,${S} .ocd5-toggle-icon,${S} .ocd5-rule,${S} .ocd5-rule[data-open]{transition:none}
${S} .ocd5-btn:not(:disabled):active,${S} .ocd5-btn.is-active:not(:disabled){transform:none}
}
`
pieces/checkout/one-click-downsell-5/specimen.tsx 48 lines
import __studioImagef26e2c82 from "../assets/cb8eda6a9e689ed1.webp";
// Specimen: the fictional Steady Ground first-step session, offered after the 12-week programme is declined.
import { OneClickDownsell5, type OneClickDownsell5State } from '../one-click-downsell-5'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function OneClickDownsell5Specimen({ state = 'default' }: { state?: OneClickDownsell5State }) {
return (
<OneClickDownsell5
state={state}
notice='Your order is saved. Nothing changes unless you say yes.'
opener='No problem.'
headline='Start with one session instead.'
lead='The 12-week Steady Ground programme can wait. Book a single 45-minute session and leave knowing the one change to make first.'
sceneImage={slot(
'scene',
__studioImagef26e2c82
)}
sceneImageAlt='A calm, sunlit coaching room with two armchairs by a window'
sceneFocus='66% 50%'
productName='The First-Step Session'
productNote='45 minutes · One-to-one · On video'
promise='Leave with one clear next step, written down.'
highlight='one clear next step'
steps={[
{ minutes: 15, text: 'Where you are now, put into plain words.' },
{ minutes: 20, text: 'The one change that matters most this month.' },
{ minutes: 10, text: 'Your written plan for the next 30 days.' },
]}
lines={[
{ label: 'First-step session, 45 minutes', amount: '$120' },
{ label: 'Written 30-day plan', amount: 'Included' },
]}
subtotal='$120'
discount={{ label: 'Second-chance price', amount: '−$25' }}
price='$95'
totalLabel='Today'
creditLine='Your $95 counts toward the 12-week programme.'
creditRule='Join the 12-week programme within 30 days of your session and the full $95 comes off the programme fee. Nothing to claim: we apply it for you.'
riskTitle='Try one session, risk free.'
riskText='If you don’t leave with a clear next step, tell us and we refund the full $95.'
ctaLabel='Book My Session for $95'
reassurance='One click · Added to today’s order'
declineLabel='No thanks, I’ll skip the session'
/>
)
}
| Name | Type | Details |
|---|---|---|
notice OptionalOneClickDownsell5 |
string |
Default 'Your order is saved. Nothing changes unless you say yes.'
|
opener OptionalOneClickDownsell5 |
string |
Default 'No problem.'
|
headline OptionalOneClickDownsell5 |
string |
Default 'Start with a single session.'
|
lead OptionalOneClickDownsell5 |
string |
Default 'Not ready for the full programme? Book one focused session and leave knowing the change to make first.'
|
sceneImage OptionalOneClickDownsell5 |
string |
|
sceneImageAlt OptionalOneClickDownsell5 |
string |
Default ''
|
sceneFocus OptionalOneClickDownsell5 |
string |
Default '62% 50%'
|
productName OptionalOneClickDownsell5 |
string |
Default 'Your First-Step Session'
|
productNote OptionalOneClickDownsell5 |
string |
Default ''
|
promise OptionalOneClickDownsell5 |
string |
Default 'Leave with one clear next step, written down.'
|
highlight OptionalOneClickDownsell5 |
string |
Default 'one clear next step'
|
steps OptionalOneClickDownsell5 |
OneClickDownsell5Step[] |
Default DEFAULT_STEPS
|
minutesLabel OptionalOneClickDownsell5 |
string |
Default '{minutes} min'
|
stepsLabel OptionalOneClickDownsell5 |
string |
Default 'What happens in your session'
|
receiptLabel OptionalOneClickDownsell5 |
string |
Default 'Today’s order'
|
lines OptionalOneClickDownsell5 |
OneClickDownsell5Line[] |
Default []
|
subtotal OptionalOneClickDownsell5 |
string |
|
subtotalLabel OptionalOneClickDownsell5 |
string |
Default 'Subtotal'
|
discount OptionalOneClickDownsell5 |
OneClickDownsell5Line |
|
price OptionalOneClickDownsell5 |
string |
|
totalLabel OptionalOneClickDownsell5 |
string |
Default 'Today'
|
creditLine OptionalOneClickDownsell5 |
string |
|
creditRule OptionalOneClickDownsell5 |
React.ReactNode |
|
creditQuestion OptionalOneClickDownsell5 |
string |
Default 'What if I want the full programme later?'
|
defaultOpen OptionalOneClickDownsell5 |
boolean |
Default false
|
riskTitle OptionalOneClickDownsell5 |
string |
Default ''
|
riskText OptionalOneClickDownsell5 |
string |
Default ''
|
ctaLabel OptionalOneClickDownsell5 |
string |
Default 'Yes, Book My First Session'
|
loadingLabel OptionalOneClickDownsell5 |
string |
Default 'Booking your session…'
|
reassurance OptionalOneClickDownsell5 |
string |
Default 'One click · No new forms'
|
errorMessage OptionalOneClickDownsell5 |
string |
Default 'We couldn’t book your session. Please try again.'
|
declineLabel OptionalOneClickDownsell5 |
string |
Default 'No thanks, I’ll skip the session'
|
declineHref OptionalOneClickDownsell5 |
string |
Default '#decline'
|
href OptionalOneClickDownsell5 |
string |
|
onAction OptionalOneClickDownsell5 |
() => void | Promise<void> |
|
onDecline OptionalOneClickDownsell5 |
() => void |
|
headingAs OptionalOneClickDownsell5 |
'h1' | 'h2' |
Default 'h2'
|
disabled OptionalOneClickDownsell5 |
boolean |
Default false
|
state OptionalOneClickDownsell5 |
OneClickDownsell5State |
Default 'default'
|
className OptionalOneClickDownsell5 |
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-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--field-ink- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
cb8eda6a9e689ed1.webp
image/webp · 50.7 KB