One Click Downsell 2
Second-chance offer after an upsell “no”: the presenter answers in a speech bubble (“no problem, how about this instead?”),
Use it in a prompt
Use checkout/one-click-downsell-2 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-2.tsx. - Import it and pass your copy and images (Props tab):
import { OneClickDownsell2 } from "@/components/funneldna/checkout/one-click-downsell-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-click-downsell-2/component.tsx 677 lines
// layout: presenter-cutout
// Second-chance offer after an upsell “no”: the presenter answers in a speech bubble (“no problem, how about this instead?”),
// quick replies show what’s inside, the guarantee or how it arrives, and a ticked guarantee line leads into a one-click yes.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, ShieldCheck } from 'lucide-react'
export type OneClickDownsell2Item = {
name: string
/** One short line under the name. */
detail?: string
/** Stated value, e.g. '$49'; shown through valueLabel. */
value?: string
/** Item photo (slot item-1 … item-n). */
image?: string
/** Alt text for the photo; falls back to the item name. */
imageAlt?: string
}
export type OneClickDownsell2Reply = 'inside' | 'risk' | 'how'
export type OneClickDownsell2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneClickDownsell2Props = {
/** Calm order-status line across the top of the band; hidden when empty. */
notice?: string
/** The presenter’s opening line, set as the headline inside the speech bubble. */
headline?: string
/** Phrase inside the headline that carries one marker stroke. */
highlight?: string
/** Sub-headline; '{product}' is replaced with the bold product name. */
lead?: string
productName?: string
/** Slot 'presenter-cutout': the person on a transparent background. Without it the bubble stands alone. */
presenterImage?: string
presenterImageAlt?: string
/** Name under the cut-out; hidden when empty. */
presenterName?: string
presenterRole?: string
/** Accessible name for the quick-reply row. */
repliesLabel?: string
insideLabel?: string
riskLabel?: string
howLabel?: string
/** Quick reply that is open first. */
defaultReply?: OneClickDownsell2Reply
/** What is inside the offer; the 'inside' reply hides when empty. */
items?: OneClickDownsell2Item[]
/** '{value}' is replaced with the item value. */
valueLabel?: string
guaranteeTitle?: string
guaranteeText?: string
/** How the offer arrives; the 'how' reply hides when empty. */
steps?: string[]
/** Slot 'product': the kit on a transparent background, beside the price. */
productImage?: string
productImageAlt?: string
/** Price as shown, e.g. '$47'. */
price?: string
/** '{price}' is replaced with the big price figure. */
priceLine?: string
priceNote?: string
/** Combined stated value; the value line hides when empty. */
regularPrice?: string
/** '{value}' is replaced with regularPrice. */
valueLine?: string
/** Commitment line above the button; it starts ticked. Hidden when empty. */
commitLabel?: string
/** Inline error when the visitor unticks the line and presses the button. */
commitError?: string
/** When false the button works with the line unticked. */
requireCommit?: boolean
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
psLabel?: string
psText?: 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?: OneClickDownsell2State
className?: string
}
const DEFAULT_ITEMS: OneClickDownsell2Item[] = [
{ name: 'Funnel Planning Guide', detail: 'Map your offer and the pages your funnel needs.', value: '$49' },
{ name: 'Page Copy Workbook', detail: 'Draft your headline, offer, and call to action.', value: '$29' },
{ name: 'Launch Checklist', detail: 'Review the links, forms, and next steps before launch.', value: '$19' },
]
const DEFAULT_STEPS = [
'Click the button below. No forms to fill in.',
'The kit joins the order you just placed.',
'Download the guide, workbook and checklist right away.',
]
export function OneClickDownsell2({
notice = 'Your order is saved. Nothing changes unless you say yes.',
headline = 'No problem. How about this instead?',
highlight = 'this instead?',
lead = 'Here’s a lighter way to start: {product}. The guide, workbook and checklist in one download, yours to keep.',
productName = 'The Funnel Starter Kit',
presenterImage,
presenterImageAlt = '',
presenterName = '',
presenterRole = '',
repliesLabel = 'Ask about the kit',
insideLabel = 'What’s inside?',
riskLabel = 'What if it’s not for me?',
howLabel = 'How do I get it?',
defaultReply = 'inside',
items = DEFAULT_ITEMS,
valueLabel = '{value} value',
guaranteeTitle = 'Try it for 30 days, risk free.',
guaranteeText = 'You’re covered by our 30-day money-back guarantee. If the kit isn’t right for you, just ask and you get your money back.',
steps = DEFAULT_STEPS,
productImage,
productImageAlt = '',
price = '$47',
priceLine = '{price} today. That’s it.',
priceNote = 'One payment, no subscription. Lifetime access.',
regularPrice = '$97',
valueLine = 'The guide, workbook and checklist add up to {value}.',
commitLabel = 'I understand I’m covered by the 30-day money-back guarantee.',
commitError = 'Tick the box to confirm, then add the kit.',
requireCommit = true,
ctaLabel = 'Yes! Add the Kit for $47',
loadingLabel = 'Adding the kit to your order…',
reassurance = 'One click · Instant digital access',
errorMessage = 'We couldn’t add the kit to your order. Please try again.',
psLabel = 'P.S.',
psText = 'You have a full 30 days to try the kit. If it isn’t right for you, just ask for your money back.',
declineLabel = 'No thanks, I’ll continue without the kit',
declineHref = '#decline',
href,
onAction,
onDecline,
headingAs = 'h2',
disabled = false,
state = 'default',
className,
}: OneClickDownsell2Props) {
const uid = React.useId().replace(/:/g, '')
const headingId = `ocd2-${uid}-heading`
const reassureId = `ocd2-${uid}-reassure`
const errorId = `ocd2-${uid}-error`
const commitId = `ocd2-${uid}-commit`
const commitErrId = `ocd2-${uid}-commit-error`
const forcedError = state === 'error'
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>(forcedError ? 'error' : 'idle')
const [committed, setCommitted] = React.useState(true)
const [commitInvalid, setCommitInvalid] = React.useState(false)
const [reply, setReply] = React.useState<OneClickDownsell2Reply>(defaultReply)
const alive = React.useRef(true)
const boxRef = React.useRef<HTMLInputElement>(null)
const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])
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 hasPresenter = Boolean(presenterImage)
const replies = (
[
{ id: 'inside', label: insideLabel, show: items.length > 0 },
{ id: 'risk', label: riskLabel, show: Boolean(guaranteeTitle || guaranteeText) },
{ id: 'how', label: howLabel, show: steps.length > 0 },
] as Array<{ id: OneClickDownsell2Reply; label: string; show: boolean }>
).filter((r) => r.show && r.label)
const current = replies.some((r) => r.id === reply) ? reply : replies[0]?.id
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(e: React.MouseEvent<HTMLElement>) {
if (blocked) {
e.preventDefault()
return
}
if (requireCommit && commitLabel && !committed) {
e.preventDefault()
setCommitInvalid(true)
boxRef.current?.focus()
return
}
void run()
}
function decline(e: React.MouseEvent<HTMLAnchorElement>) {
if (onDecline) {
e.preventDefault()
onDecline()
return
}
if (!declineHref || declineHref.startsWith('#')) e.preventDefault()
}
function onReplyKey(e: React.KeyboardEvent<HTMLButtonElement>, index: number) {
if (!['ArrowRight', 'ArrowLeft', 'Home', 'End'].includes(e.key)) return
e.preventDefault()
const last = replies.length - 1
let next = index
if (e.key === 'Home') next = 0
else if (e.key === 'End') next = last
else if (e.key === 'ArrowRight') next = index === last ? 0 : index + 1
else next = index === 0 ? last : index - 1
setReply(replies[next].id)
tabRefs.current[next]?.focus()
}
const at = highlight ? headline.indexOf(highlight) : -1
const title =
at < 0 ? (
headline
) : (
<>
{headline.slice(0, at)}
<span className='ocd2-mark'>{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
const leadParts = lead.split('{product}')
const priceParts = priceLine.split('{price}').map((part) => part.trim())
const valueText = regularPrice && valueLine ? valueLine.replace('{value}', regularPrice) : ''
const btnClass = [
'ocd2-btn',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-active' : '',
loading ? 'is-loading' : '',
]
.filter(Boolean)
.join(' ')
const describedBy = [reassurance ? reassureId : '', status === 'error' ? errorId : ''].filter(Boolean).join(' ') || undefined
const inner = loading ? (
<>
<Loader2 className='ocd2-spin' size={22} strokeWidth={2.5} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{ctaLabel}</span>
)
return (
<section
className={['cf-one-click-downsell-2', hasPresenter ? 'has-presenter' : '', className].filter(Boolean).join(' ')}
aria-labelledby={headingId}
>
<style>{CSS}</style>
<div className='ocd2-wrap'>
{notice ? (
<p className='ocd2-notice'>
<span className='ocd2-badge' aria-hidden='true'>
<Check size={14} strokeWidth={3} />
</span>
{notice}
</p>
) : null}
<div className={hasPresenter ? 'ocd2-grid' : 'ocd2-grid is-solo'}>
{hasPresenter ? (
<figure className='ocd2-presenter'>
<div className='ocd2-stage'>
<img
className='ocd2-person'
src={presenterImage}
alt={presenterImageAlt}
width={640}
height={640}
decoding='async'
/>
</div>
{presenterName ? (
<figcaption className='ocd2-caption'>
<span className='ocd2-name'>{presenterName}</span>
{presenterRole ? <span className='ocd2-role'>{presenterRole}</span> : null}
</figcaption>
) : null}
</figure>
) : null}
<div className='ocd2-main'>
<div className='ocd2-bubble'>
<Heading className='ocd2-title' id={headingId}>
{title}
</Heading>
{lead ? (
<p className='ocd2-lead'>
{leadParts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 ? <strong>{productName}</strong> : null}
{part}
</React.Fragment>
))}
</p>
) : null}
{replies.length ? (
<>
<div className='ocd2-replies' role='tablist' aria-label={repliesLabel}>
{replies.map((r, i) => (
<button
key={r.id}
ref={(el) => {
tabRefs.current[i] = el
}}
type='button'
role='tab'
id={`ocd2-${uid}-tab-${r.id}`}
className='ocd2-reply'
aria-selected={r.id === current}
aria-controls={`ocd2-${uid}-panel-${r.id}`}
tabIndex={r.id === current ? 0 : -1}
onClick={() => setReply(r.id)}
onKeyDown={(e) => onReplyKey(e, i)}
>
{r.label}
</button>
))}
</div>
<div className='ocd2-answers'>
{replies.map((r) => {
const on = r.id === current
return (
<div
key={r.id}
id={`ocd2-${uid}-panel-${r.id}`}
role='tabpanel'
aria-labelledby={`ocd2-${uid}-tab-${r.id}`}
aria-hidden={on ? undefined : true}
className={on ? 'ocd2-answer is-on' : 'ocd2-answer'}
tabIndex={on ? 0 : -1}
>
{r.id === 'inside' ? (
<ul className='ocd2-items'>
{items.map((item, i) => (
<li className={item.image ? 'ocd2-item' : 'ocd2-item no-thumb'} key={`${item.name}-${i}`}>
{item.image ? (
<img
className='ocd2-thumb'
src={item.image}
alt={item.imageAlt || item.name}
width={56}
height={56}
loading='lazy'
decoding='async'
/>
) : null}
<span className='ocd2-item-text'>
<span className='ocd2-item-name'>{item.name}</span>
{item.detail ? <span className='ocd2-item-detail'>{item.detail}</span> : null}
</span>
{item.value && valueLabel ? (
<span className='ocd2-value'>{valueLabel.replace('{value}', item.value)}</span>
) : null}
</li>
))}
</ul>
) : null}
{r.id === 'risk' ? (
<div className='ocd2-risk'>
<span className='ocd2-disc' aria-hidden='true'>
<ShieldCheck size={20} strokeWidth={2.5} />
</span>
<div>
{guaranteeTitle ? <h3 className='ocd2-h3'>{guaranteeTitle}</h3> : null}
{guaranteeText ? <p className='ocd2-body'>{guaranteeText}</p> : null}
</div>
</div>
) : null}
{r.id === 'how' ? (
<ol className='ocd2-steps'>
{steps.map((step, i) => (
<li key={i}>
<span className='ocd2-step-num' aria-hidden='true'>
{i + 1}
</span>
<span>{step}</span>
</li>
))}
</ol>
) : null}
</div>
)
})}
</div>
</>
) : null}
</div>
<div className='ocd2-offer'>
<div className={productImage ? 'ocd2-deal' : 'ocd2-deal is-solo'}>
{productImage ? (
<img
className='ocd2-product'
src={productImage}
alt={productImageAlt}
width={360}
height={360}
loading='lazy'
decoding='async'
/>
) : null}
<div className='ocd2-pricing'>
<p className='ocd2-price'>
{priceParts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 ? <span className='ocd2-num'>{price}</span> : null}
{part ? <span className='ocd2-price-text'>{part}</span> : null}
</React.Fragment>
))}
</p>
{priceNote ? <p className='ocd2-note'>{priceNote}</p> : null}
{valueText ? <p className='ocd2-value-line'>{valueText}</p> : null}
</div>
</div>
<div className='ocd2-action'>
{commitLabel ? (
<div className={commitInvalid ? 'ocd2-commit is-invalid' : 'ocd2-commit'}>
<span className='ocd2-box'>
<input
ref={boxRef}
id={commitId}
type='checkbox'
checked={committed}
disabled={isDisabled}
aria-invalid={commitInvalid || undefined}
aria-describedby={commitInvalid && commitError ? commitErrId : undefined}
onChange={(e) => {
setCommitted(e.target.checked)
if (e.target.checked) setCommitInvalid(false)
}}
/>
<Check className='ocd2-tick' size={18} strokeWidth={3} aria-hidden='true' />
</span>
<label htmlFor={commitId}>{commitLabel}</label>
</div>
) : null}
{commitInvalid && commitError ? (
<p className='ocd2-field-error' id={commitErrId} role='alert'>
<AlertCircle className='ocd2-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{commitError}
</p>
) : null}
{href ? (
<a
className={btnClass}
href={isDisabled ? undefined : href}
role={isDisabled ? 'link' : undefined}
aria-disabled={isDisabled || undefined}
aria-busy={loading || undefined}
aria-describedby={describedBy}
onClick={accept}
>
{inner}
</a>
) : (
<button
type='button'
className={btnClass}
disabled={isDisabled}
aria-busy={loading || undefined}
aria-describedby={describedBy}
onClick={accept}
>
{inner}
</button>
)}
{reassurance ? (
<p className='ocd2-reassure' id={reassureId}>
<Lock className='ocd2-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
{status === 'error' && errorMessage ? (
<p className='ocd2-error' id={errorId} role='alert'>
<AlertCircle className='ocd2-inline-icon' size={18} strokeWidth={2.5} aria-hidden='true' />
{errorMessage}
</p>
) : null}
{psText ? (
<p className='ocd2-ps'>
{psLabel ? <strong>{psLabel} </strong> : null}
{psText}
</p>
) : null}
{declineLabel ? (
<p className='ocd2-decline-wrap'>
<a className='ocd2-decline' href={declineHref || '#'} onClick={decline}>
{declineLabel}
</a>
</p>
) : null}
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default OneClickDownsell2
const R = '.cf-one-click-downsell-2'
const CSS = `
${R}{--ocd2-glyph:var(--badge-glyph,#fff);--ocd2-ok:oklch(from var(--success) min(l,0.52) c h);--ocd2-marker:color-mix(in oklch,var(--marker,#fae37c) 82%,transparent);--ocd2-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;isolation:isolate;overflow:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h1,h2,h3,p,ul,ol,li,figure,figcaption){margin:0;padding:0}
${R} .ocd2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
${R} .ocd2-notice{width:fit-content;max-width:100%;margin:0 auto clamp(24px,4vw,40px);padding:8px 16px;border-radius:999px;background:color-mix(in oklch,var(--ink) 5%,var(--surface));color:var(--ink);font-size:.9375rem;font-weight:600;line-height:1.4;text-align:center;text-wrap:pretty}
${R} .ocd2-badge{display:inline-grid;place-items:center;width:20px;height:20px;margin-inline-end:.5em;border-radius:999px;background:var(--ocd2-ok);color:var(--ocd2-glyph);vertical-align:-0.3em}
${R} .ocd2-grid{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(32px,5vw,72px);align-items:start}
${R} .ocd2-grid.is-solo{grid-template-columns:minmax(0,1fr);max-width:46rem;margin-inline:auto}
${R} .ocd2-presenter{position:sticky;top:24px;animation:ocd2-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .ocd2-stage{--ocd2-r:var(--card-radius,var(--radius,14px));position:relative}
${R} .ocd2-stage::before{content:'';position:absolute;inset:18% 0 0;border-radius:var(--ocd2-r);background:var(--band);box-shadow:inset 0 1px 0 oklch(from var(--band) calc(l + 0.1) c h / .6),var(--shadow-md,0 1px 2px oklch(from var(--ocd2-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--ocd2-shadow) l c h / .2))}
${R} .ocd2-person{position:relative;z-index:1;display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;object-position:50% 100%;clip-path:inset(-40% 0 0 0 round 0 0 var(--ocd2-r) var(--ocd2-r));filter:drop-shadow(0 2px 3px oklch(from var(--ocd2-shadow) l c h / .3))}
${R} .ocd2-caption{display:grid;gap:2px;margin-top:12px;text-align:center}
${R} .ocd2-name{color:var(--ink);font-family:var(--font-display);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.25}
${R} .ocd2-role{color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4}
${R} .ocd2-main{min-width:0}
${R} .ocd2-bubble{position:relative;padding:clamp(24px,3.4vw,40px);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));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(--ocd2-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--ocd2-shadow) l c h / .32)));animation:ocd2-rise .45s .07s cubic-bezier(.2,.7,.2,1) both}
${R}.has-presenter .ocd2-bubble::before{content:'';position:absolute;top:clamp(56px,7vw,96px);left:-12px;width:22px;height:22px;border-left:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-bottom:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-bottom-left-radius:4px;background:var(--card);transform:rotate(45deg)}
${R} .ocd2-title{margin-bottom:16px;color:var(--ink);font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);line-height:1.06;text-transform:var(--display-case,none);text-wrap:balance}
${R} .ocd2-mark{margin:0 -.08em;padding:0 .08em;border-radius:.18em;background:linear-gradient(transparent 50%,var(--ocd2-marker) 50%,var(--ocd2-marker) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .ocd2-lead{color:var(--muted);font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .ocd2-lead strong{color:var(--ink);font-weight:700}
${R} .ocd2-replies{display:flex;flex-wrap:wrap;gap:8px;margin:28px 0 20px}
${R} .ocd2-reply{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid transparent;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.2;cursor:pointer;transition:background .16s ease,border-color .16s ease}
${R} .ocd2-reply:hover{background:color-mix(in oklch,var(--ink) 10%,var(--card))}
${R} .ocd2-reply:active{background:color-mix(in oklch,var(--ink) 14%,var(--card))}
${R} .ocd2-reply[aria-selected=true]:hover{background:color-mix(in oklch,var(--accent) 16%,var(--card))}
${R} .ocd2-reply[aria-selected=true]{border-color:oklch(from var(--accent) l c h / .5);background:color-mix(in oklch,var(--accent) 12%,var(--card))}
${R} .ocd2-reply:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
${R} .ocd2-answers{display:grid}
${R} .ocd2-answer{grid-area:1/1;min-width:0;visibility:hidden}
${R} .ocd2-answer.is-on{visibility:visible;animation:ocd2-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .ocd2-answer:focus-visible{border-radius:8px;outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:4px}
${R} .ocd2-items{list-style:none}
${R} .ocd2-item{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:16px;align-items:start;padding:14px 0;border-top:1px solid oklch(from var(--ink) l c h / .1)}
${R} .ocd2-item:first-child{padding-top:0;border-top:0}
${R} .ocd2-item:last-child{padding-bottom:0}
${R} .ocd2-item.no-thumb{grid-template-columns:minmax(0,1fr) auto}
${R} .ocd2-thumb{display:block;width:56px;height:56px;border-radius:8px;object-fit:cover;object-position:50% 50%}
${R} .ocd2-item-text{min-width:0}
${R} .ocd2-item-name{display:block;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.25}
${R} .ocd2-item-detail{display:block;margin-top:4px;color:var(--muted);font-size:.9375rem;line-height:1.4;text-wrap:pretty}
${R} .ocd2-value{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap;font-variant-numeric:tabular-nums}
${R} .ocd2-risk{display:grid;grid-template-columns:40px minmax(0,1fr);gap:16px;align-items:start}
${R} .ocd2-disc{display:grid;place-items:center;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .ocd2-h3{color:var(--ink);font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);font-weight:800;letter-spacing:-.01em;line-height:1.15;text-wrap:balance}
${R} .ocd2-body{margin-top:8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${R} .ocd2-steps{display:grid;gap:14px;list-style:none}
${R} .ocd2-steps li{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;align-items:baseline;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${R} .ocd2-step-num{color:var(--accent);font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
${R} .ocd2-offer{margin-top:clamp(28px,4vw,40px);animation:ocd2-rise .45s .14s cubic-bezier(.2,.7,.2,1) both}
${R} .ocd2-deal{display:grid;grid-template-columns:minmax(0,180px) minmax(0,1fr);gap:clamp(16px,3vw,28px);align-items:center}
${R} .ocd2-deal.is-solo{grid-template-columns:minmax(0,1fr)}
${R} .ocd2-product{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--ocd2-shadow) l c h / .28)) drop-shadow(0 12px 14px oklch(from var(--ocd2-shadow) l c h / .22))}
${R} .ocd2-pricing{min-width:0}
${R} .ocd2-price{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.4em;row-gap:12px;color:var(--ink);font-family:var(--font-display)}
${R} .ocd2-num{font-size:clamp(2.5rem,4.2vw,3.75rem);font-weight:800;letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums}
${R} .ocd2-price-text{font-size:clamp(1.3125rem,1.8vw,1.625rem);font-weight:800;letter-spacing:-.01em;line-height:1.15}
${R} .ocd2-note{margin-top:12px;color:var(--ink);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${R} .ocd2-value-line{margin-top:4px;color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .ocd2-action{margin-top:28px;text-align:center}
${R} .ocd2-commit{display:grid;grid-template-columns:26px minmax(0,1fr);gap:12px;align-items:start;padding:14px 16px;border-radius:12px;background:color-mix(in oklch,var(--ink) 4%,var(--surface));text-align:start;transition:background .16s ease}
${R} .ocd2-commit.is-invalid{background:var(--danger-soft)}
${R} .ocd2-box{position:relative;display:block;width:26px;height:26px}
${R} .ocd2-box input{display:block;width:26px;height:26px;margin:0;border:2px solid oklch(from var(--ink) l c h / .45);border-radius:7px;background:var(--field);cursor:pointer;-webkit-appearance:none;appearance:none;transition:background .16s ease,border-color .16s ease}
${R} .ocd2-box input:checked{border-color:var(--ocd2-ok);background:var(--ocd2-ok)}
${R} .ocd2-box input[aria-invalid=true]{border-color:var(--danger)}
${R} .ocd2-box input:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
${R} .ocd2-box input:disabled{cursor:not-allowed}
${R} .ocd2-tick{position:absolute;inset:0;margin:auto;color:var(--ocd2-glyph);opacity:0;pointer-events:none;transition:opacity .16s ease}
${R} .ocd2-box input:checked + .ocd2-tick{opacity:1}
${R} .ocd2-commit label{padding-top:2px;color:var(--ink);font-size:1rem;font-weight:600;line-height:1.45;cursor:pointer;text-wrap:pretty}
${R} .ocd2-field-error{margin-top:8px;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-align:start;text-wrap:pretty}
${R} .ocd2-inline-icon{display:inline-block;margin-inline-end:.4em;vertical-align:-0.15em}
${R} .ocd2-btn{--ocd2-bg:var(--button-bg,var(--cta));--ocd2-bg2:var(--button-bg-2,var(--cta-2));display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:72px;margin-top:16px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ocd2-bg) calc(l + 0.04) c h),oklch(from var(--ocd2-bg2) calc(l - 0.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(--ocd2-bg) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--ocd2-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ocd2-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--ocd2-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .ocd2-btn.is-hover,${R} .ocd2-btn:not(:disabled):not([aria-disabled=true]):not(.is-loading):hover{background:linear-gradient(oklch(from var(--ocd2-bg) calc(l - 0.01) c h),oklch(from var(--ocd2-bg2) calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ocd2-bg) calc(l + 0.12) c h / .7),inset 0 -3px 0 oklch(from var(--ocd2-bg) calc(l - 0.18) c h),0 1px 2px oklch(from var(--ocd2-shadow) l c h / .32),0 10px 18px -6px oklch(from var(--ocd2-shadow) l c h / .52))}
${R} .ocd2-btn.is-active,${R} .ocd2-btn:not(:disabled):not([aria-disabled=true]):not(.is-loading):active{transform:translateY(1px);background:linear-gradient(oklch(from var(--ocd2-bg) calc(l - 0.05) c h),oklch(from var(--ocd2-bg2) calc(l - 0.08) c h));box-shadow:inset 0 2px 5px oklch(from var(--ocd2-bg) calc(l - 0.22) c h / .55),inset 0 -2px 0 oklch(from var(--ocd2-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ocd2-shadow) l c h / .3)}
${R} .ocd2-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .ocd2-btn.is-loading{cursor:progress}
${R} .ocd2-btn:disabled,${R} .ocd2-btn[aria-disabled=true]{transform:none;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed}
${R} .ocd2-spin{flex:none;animation:ocd2-spin .8s linear infinite}
${R} .ocd2-reassure{margin-top:12px;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${R} .ocd2-error{margin-top:12px;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-align:start;text-wrap:pretty}
${R} .ocd2-ps{max-width:34rem;margin:20px auto 0;color:var(--ink);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
${R} .ocd2-ps strong{font-weight:800}
${R} .ocd2-decline-wrap{margin-top:8px}
${R} .ocd2-decline{display:inline-flex;align-items:center;min-height:44px;padding:4px 8px;color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--muted) l c h / .55);text-underline-offset:.18em;text-wrap:pretty}
${R} .ocd2-decline:hover{color:var(--ink);text-decoration-color:currentColor}
${R} .ocd2-decline:focus-visible{border-radius:6px;outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
@keyframes ocd2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ocd2-spin{to{transform:rotate(360deg)}}
@media (max-width:760px){
${R} .ocd2-grid{grid-template-columns:minmax(0,1fr);gap:20px}
${R} .ocd2-presenter{position:relative;top:auto;display:flex;align-items:flex-end;gap:16px}
${R} .ocd2-stage{flex:none;width:132px}
${R} .ocd2-caption{margin:0 0 6px;text-align:start}
${R}.has-presenter .ocd2-bubble::before{top:-12px;left:55px;border-bottom:0;border-top:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-bottom-left-radius:0;border-top-left-radius:4px}
${R} .ocd2-bubble{padding:24px 20px}
${R} .ocd2-replies{margin:24px 0 20px}
${R} .ocd2-reply{flex:1 1 auto;justify-content:center;text-align:center}
}
@media (max-width:480px){
${R} .ocd2-deal{grid-template-columns:minmax(0,1fr);justify-items:center;gap:16px;text-align:center}
${R} .ocd2-product{width:min(200px,62%)}
${R} .ocd2-price{justify-content:center}
${R} .ocd2-pricing{width:100%}
${R} .ocd2-item{grid-template-columns:48px minmax(0,1fr);gap:12px}
${R} .ocd2-item.no-thumb{grid-template-columns:minmax(0,1fr)}
${R} .ocd2-thumb{width:48px;height:48px}
${R} .ocd2-value{grid-column:2;justify-self:start;margin-top:-4px}
${R} .ocd2-item.no-thumb .ocd2-value{grid-column:1}
${R} .ocd2-btn{padding:12px 20px}
}
@media (prefers-reduced-motion:reduce){
${R} .ocd2-presenter,${R} .ocd2-bubble,${R} .ocd2-offer,${R} .ocd2-answer.is-on,${R} .ocd2-spin{animation:none}
${R} .ocd2-btn,${R} .ocd2-reply,${R} .ocd2-box input,${R} .ocd2-tick,${R} .ocd2-commit{transition:none}
${R} .ocd2-btn.is-active,${R} .ocd2-btn:not(:disabled):not([aria-disabled=true]):not(.is-loading):active{transform:none}
}
`
pieces/checkout/one-click-downsell-2/specimen.tsx 42 lines
import __studioImage7acabba8 from "../assets/5e03908666b02f4b.webp";
import __studioImage2b64f281 from "../assets/31be50c23bb69d6e.webp";
import * as React from 'react'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { OneClickDownsell2 } from '../one-click-downsell-2'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error'
const presenterArt = __studioImage7acabba8
const productArt = __studioImage2b64f281
export default function OneClickDownsell2Specimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
const items = sample.items.map((item, i) => ({
name: item.name,
detail: item.detail,
value: item.value,
image: slot('item-' + (i + 1), item.image),
imageAlt: item.imageAlt,
}))
return (
<OneClickDownsell2
productName={sample.name}
price={sample.price}
regularPrice={sample.regularPrice}
items={items}
presenterImage={slot('presenter-cutout', presenterArt)}
presenterImageAlt=''
presenterName='Jordan Hale'
presenterRole='Creator of The Funnel Starter Kit'
productImage={slot('product', productArt)}
productImageAlt='The Funnel Starter Kit: planning guide, copy workbook and launch checklist'
state={state}
onAction={() => {}}
/>
)
}
| Name | Type | Details |
|---|---|---|
notice OptionalOneClickDownsell2 |
string |
Default 'Your order is saved. Nothing changes unless you say yes.'
|
headline OptionalOneClickDownsell2 |
string |
Default 'No problem. How about this instead?'
|
highlight OptionalOneClickDownsell2 |
string |
Default 'this instead?'
|
lead OptionalOneClickDownsell2 |
string |
Default 'Here’s a lighter way to start: {product}. The guide, workbook and checklist in one download, yours to keep.'
|
productName OptionalOneClickDownsell2 |
string |
Default 'The Funnel Starter Kit'
|
presenterImage OptionalOneClickDownsell2 |
string |
|
presenterImageAlt OptionalOneClickDownsell2 |
string |
Default ''
|
presenterName OptionalOneClickDownsell2 |
string |
Default ''
|
presenterRole OptionalOneClickDownsell2 |
string |
Default ''
|
repliesLabel OptionalOneClickDownsell2 |
string |
Default 'Ask about the kit'
|
insideLabel OptionalOneClickDownsell2 |
string |
Default 'What’s inside?'
|
riskLabel OptionalOneClickDownsell2 |
string |
Default 'What if it’s not for me?'
|
howLabel OptionalOneClickDownsell2 |
string |
Default 'How do I get it?'
|
defaultReply OptionalOneClickDownsell2 |
OneClickDownsell2Reply |
Default 'inside'
|
items OptionalOneClickDownsell2 |
OneClickDownsell2Item[] |
Default DEFAULT_ITEMS
|
valueLabel OptionalOneClickDownsell2 |
string |
Default '{value} value'
|
guaranteeTitle OptionalOneClickDownsell2 |
string |
Default 'Try it for 30 days, risk free.'
|
guaranteeText OptionalOneClickDownsell2 |
string |
Default 'You’re covered by our 30-day money-back guarantee. If the kit isn’t right for you, just ask and you get your money back.'
|
steps OptionalOneClickDownsell2 |
string[] |
Default DEFAULT_STEPS
|
productImage OptionalOneClickDownsell2 |
string |
|
productImageAlt OptionalOneClickDownsell2 |
string |
Default ''
|
price OptionalOneClickDownsell2 |
string |
Default '$47'
|
priceLine OptionalOneClickDownsell2 |
string |
Default '{price} today. That’s it.'
|
priceNote OptionalOneClickDownsell2 |
string |
Default 'One payment, no subscription. Lifetime access.'
|
regularPrice OptionalOneClickDownsell2 |
string |
Default '$97'
|
valueLine OptionalOneClickDownsell2 |
string |
Default 'The guide, workbook and checklist add up to {value}.'
|
commitLabel OptionalOneClickDownsell2 |
string |
Default 'I understand I’m covered by the 30-day money-back guarantee.'
|
commitError OptionalOneClickDownsell2 |
string |
Default 'Tick the box to confirm, then add the kit.'
|
requireCommit OptionalOneClickDownsell2 |
boolean |
Default true
|
ctaLabel OptionalOneClickDownsell2 |
string |
Default 'Yes! Add the Kit for $47'
|
loadingLabel OptionalOneClickDownsell2 |
string |
Default 'Adding the kit to your order…'
|
reassurance OptionalOneClickDownsell2 |
string |
Default 'One click · Instant digital access'
|
errorMessage OptionalOneClickDownsell2 |
string |
Default 'We couldn’t add the kit to your order. Please try again.'
|
psLabel OptionalOneClickDownsell2 |
string |
Default 'P.S.'
|
psText OptionalOneClickDownsell2 |
string |
Default 'You have a full 30 days to try the kit. If it isn’t right for you, just ask for your money back.'
|
declineLabel OptionalOneClickDownsell2 |
string |
Default 'No thanks, I’ll continue without the kit'
|
declineHref OptionalOneClickDownsell2 |
string |
Default '#decline'
|
href OptionalOneClickDownsell2 |
string |
|
onAction OptionalOneClickDownsell2 |
() => void | Promise<void> |
|
onDecline OptionalOneClickDownsell2 |
() => void |
|
headingAs OptionalOneClickDownsell2 |
'h1' | 'h2' |
Default 'h2'
|
disabled OptionalOneClickDownsell2 |
boolean |
Default false
|
state OptionalOneClickDownsell2 |
OneClickDownsell2State |
Default 'default'
|
className OptionalOneClickDownsell2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-focus- 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.
presenter-cutout- The presenter on a transparent background.
product- The main product shot or cover (ebook, kit, bottle).
-
31be50c23bb69d6e.webp
image/webp · 156 KB
-
5e03908666b02f4b.webp
image/webp · 186 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB