One Click Downsell 4
Downsell after a declined upgrade, run as a short honest interview: the visitor taps what held them back,
Use it in a prompt
Use checkout/one-click-downsell-4 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/checkout/one-click-downsell-4.tsx. - Import it and pass your copy and images (Props tab):
import { OneClickDownsell4 } from "@/components/funneldna/checkout/one-click-downsell-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-click-downsell-4/component.tsx 533 lines
// layout: interview-qa
// Downsell after a declined upgrade, run as a short honest interview: the visitor taps what held them back,
// the answer swaps in the matching lighter option with a value reveal, and the one-click yes is the last answer.
'use client'
import * as React from 'react'
import { AlertCircle, CalendarClock, Layers, Loader2, Lock, ShieldCheck, Wallet } from 'lucide-react'
import { FX_HOST, Pattern } from '../fx/fx'
export type OneClickDownsell4Option = {
/** Passed to onAction so the builder knows which offer was accepted. */
id: string
name: string
/** One short line under the name. */
detail?: string
/** Label over the first, big figure, e.g. 'Shiftly Pro, billed yearly'. */
compareLabel?: string
/** The figure revealed first; the reveal starts at the price when empty. */
compareValue?: string
/** Line between the two figures; falls back to the block's butLine. */
butLine?: string
price: string
/** Shown after the price, e.g. '/month'. */
priceUnit?: string
priceNote?: string
ctaLabel: string
/** One short line under the button. */
ctaNote?: string
/** When set the button renders as a link to it. */
href?: string
}
export type OneClickDownsell4Reason = {
id: string
/** Chip label; keep it short so three chips fit two rows on a phone. */
label: string
icon?: 'price' | 'size' | 'timing'
/** Bold lead-in of the answer. */
lead: string
answer: string
/** The lighter option this reason swaps in. */
option: OneClickDownsell4Option
}
export type OneClickDownsell4Choice = { optionId: string; reasonId?: string }
export type OneClickDownsell4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneClickDownsell4Props = {
/** The honest question, set as the block headline. */
headline?: string
/** Phrase inside the headline that carries one marker stroke. */
highlight?: string
lead?: string
/** Accessible name for the reason chips. */
reasonsLabel?: string
reasons?: OneClickDownsell4Reason[]
/** Index of a reason picked on first render; null shows the default answer. */
defaultReason?: number | null
/** Answer shown before a reason is picked. */
defaultAnswer?: { lead: string; text: string }
/** Offer shown before a reason is picked; falls back to the first reason's option. */
fallbackOption?: OneClickDownsell4Option
offerQuestion?: string
actionQuestion?: string
/** The answer that introduces the button. */
actionAnswer?: { lead: string; text: string }
/** Small marks beside each question and answer. */
questionTag?: string
answerTag?: string
/** Default line between the two figures of the value reveal. */
butLine?: string
/** Slot 'product': the app on a phone, transparent background. Hidden on phones. */
phoneImage?: string
phoneImageAlt?: string
/** Caption under the phone; '{option}' is replaced with the option name. */
caption?: string
/** Guarantee line under the button; hidden when empty. */
guarantee?: string
/** Button text while a returned onAction promise is pending. */
loadingLabel?: 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 for every option without its own href. */
href?: string
/** Accept action with the shown option. A returned promise shows loadingLabel; a rejection shows errorMessage. */
onAction?: (choice: OneClickDownsell4Choice) => void | Promise<void>
/** Decline action; when set it replaces declineHref navigation. */
onDecline?: () => void
/** Called when a chip is picked; the piece itself never stores or shows reasons as claims. */
onReasonChange?: (reasonId: string) => void
headingAs?: 'h1' | 'h2'
disabled?: boolean
state?: OneClickDownsell4State
className?: string
}
const DEFAULT_REASONS: OneClickDownsell4Reason[] = [
{
id: 'price',
label: 'The price',
icon: 'price',
lead: 'Fair. Pro is a lot to start with.',
answer: 'Starter runs the same weekly schedule for a smaller team, for less than half the monthly price.',
option: {
id: 'starter',
name: 'Shiftly Starter',
detail: 'Drag-and-drop schedule, shift swaps and reminders for up to 15 staff.',
compareLabel: 'Shiftly Pro, billed yearly',
compareValue: '$49/mo',
price: '$19',
priceUnit: '/month',
priceNote: 'Billed monthly · Cancel anytime',
ctaLabel: 'Send My Starter Login',
ctaNote: 'One click · Same card on file',
},
},
{
id: 'size',
label: 'Too much at once',
icon: 'size',
lead: 'Got it. A full year up front is a big bill.',
answer: 'Keep every Pro feature and split the year into three monthly payments instead.',
option: {
id: 'pro-3-pay',
name: 'Shiftly Pro in 3 payments',
detail: 'Every Pro feature from day one. Two more payments follow, 30 days apart.',
compareLabel: 'Pro, one year up front',
compareValue: '$588',
butLine: 'You won’t pay it all today.',
price: '$196',
priceUnit: 'today',
priceNote: 'Then 2 more payments of $196',
ctaLabel: 'Send My Pro Login',
ctaNote: 'First of 3 payments · Same card on file',
},
},
{
id: 'timing',
label: 'Bad timing',
icon: 'timing',
lead: 'Makes sense. Now isn’t the moment for a year.',
answer: 'Go month to month instead. Run this season’s schedule and stop whenever you like.',
option: {
id: 'pro-monthly',
name: 'Shiftly Pro, monthly',
detail: 'Every Pro feature, no yearly contract.',
compareLabel: 'Pro, one year up front',
compareValue: '$588',
butLine: 'You won’t pay that up front.',
price: '$59',
priceUnit: '/month',
priceNote: 'No contract · Cancel anytime',
ctaLabel: 'Send My Monthly Login',
ctaNote: 'One click · Same card on file',
},
},
]
const ICONS = { price: Wallet, size: Layers, timing: CalendarClock } as const
export function OneClickDownsell4(props: OneClickDownsell4Props) {
const {
headline = 'Honest question: what held you back?',
highlight = 'held you back',
lead = 'No problem, Pro wasn’t a yes. Tap your reason and I’ll show you a lighter way in.',
reasonsLabel = 'What held you back?',
reasons = DEFAULT_REASONS,
defaultReason = null,
defaultAnswer = {
lead: 'No wrong answer.',
text: 'Tap the reason that fits and I’ll match you to a lighter plan. Until then, here’s the smallest way in.',
},
fallbackOption,
offerQuestion = 'So what’s the lighter way in?',
actionQuestion = 'How fast can my team start?',
actionAnswer = {
lead: 'Right now.',
text: 'One click adds it with the card you just used. Your login lands in your inbox.',
},
questionTag = 'Q.',
answerTag = 'A.',
butLine = 'But you won’t pay that.',
phoneImage,
phoneImageAlt = '',
caption = '{option}, on every phone on your team',
guarantee = '',
loadingLabel = 'Sending your login…',
errorMessage = 'We couldn’t add this to your order. Please try again.',
declineLabel = 'No thanks, I’ll keep my order as it is',
declineHref = '#decline',
href,
onAction,
onDecline,
onReasonChange,
headingAs = 'h2',
disabled = false,
state = 'default',
className,
} = props
const headingId = React.useId()
const answerId = React.useId()
const errorId = React.useId()
const start = defaultReason !== null && defaultReason !== undefined && reasons[defaultReason] ? defaultReason : null
const [picked, setPicked] = React.useState<number | null>(start)
const forcedError = state === 'error'
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>(forcedError ? 'error' : 'idle')
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setStatus(forcedError ? 'error' : 'idle')
}, [forcedError])
const reason = picked !== null ? reasons[picked] ?? null : null
const option = reason?.option ?? fallbackOption ?? reasons[0]?.option
const answer = reason ? { lead: reason.lead, text: reason.answer } : defaultAnswer
const swapKey = reason ? reason.id : 'none'
const isDisabled = disabled || state === 'disabled'
const loading = status === 'loading'
const blocked = isDisabled || loading || !option
const destination = option?.href ?? href
const Heading = headingAs
function pick(i: number) {
setPicked(i)
if (!forcedError) setStatus((s) => (s === 'error' ? 'idle' : s))
const r = reasons[i]
if (r && onReasonChange) onReasonChange(r.id)
}
async function run() {
if (!onAction || !option) return
try {
const result: unknown = onAction({ optionId: option.id, reasonId: reason?.id })
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
}
void run()
}
function decline(e: React.MouseEvent<HTMLAnchorElement>) {
if (onDecline) {
e.preventDefault()
onDecline()
return
}
if (!declineHref || declineHref.startsWith('#')) e.preventDefault()
}
const ctaClass = ['ocd4-cta', state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : '']
.filter(Boolean)
.join(' ')
const ctaInner = loading ? (
<>
<Loader2 className='ocd4-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{option?.ctaLabel}</span>
)
return (
<section
className={['cf-one-click-downsell-4', className].filter(Boolean).join(' ')}
aria-labelledby={headingId}
style={FX_HOST}
>
<style>{CSS}</style>
<Pattern name='grid' fade='corner' />
<div className={['ocd4-wrap', phoneImage ? 'has-art' : ''].filter(Boolean).join(' ')}>
<div className='ocd4-talk'>
<div className='ocd4-pair'>
<span className='ocd4-tag ocd4-tag-q' aria-hidden='true'>{questionTag}</span>
<div className='ocd4-cell'>
<Heading id={headingId} className='ocd4-title'>
{marked(headline, highlight)}
</Heading>
{lead ? <p className='ocd4-lead'>{lead}</p> : null}
</div>
<div className='ocd4-chips' role='group' aria-label={reasonsLabel}>
{reasons.map((r, i) => {
const Icon = r.icon ? ICONS[r.icon] : null
return (
<button
key={r.id}
type='button'
className='ocd4-chip'
aria-pressed={picked === i}
aria-controls={answerId}
onClick={() => pick(i)}
>
{Icon ? <Icon size={18} strokeWidth={2.5} aria-hidden='true' /> : null}
<span>{r.label}</span>
</button>
)
})}
</div>
<span className='ocd4-tag ocd4-tag-a' aria-hidden='true'>{answerTag}</span>
<div className='ocd4-cell' id={answerId} aria-live='polite' aria-atomic='true'>
<p key={swapKey} className='ocd4-answer ocd4-in'>
<strong>{answer.lead}</strong> {answer.text}
</p>
</div>
</div>
{option ? (
<div className='ocd4-pair'>
<span className='ocd4-tag ocd4-tag-q' aria-hidden='true'>{questionTag}</span>
<h3 className='ocd4-cell ocd4-q'>{offerQuestion}</h3>
<span className='ocd4-tag ocd4-tag-a' aria-hidden='true'>{answerTag}</span>
<div key={'card-' + swapKey} className='ocd4-cell ocd4-card ocd4-in'>
<div className='ocd4-opt'>
<p className='ocd4-opt-name'>{option.name}</p>
{option.detail ? <p className='ocd4-opt-detail'>{option.detail}</p> : null}
</div>
<div className={['ocd4-reveal', option.compareValue ? 'has-compare' : ''].filter(Boolean).join(' ')}>
{option.compareValue ? (
<div className='ocd4-then'>
{option.compareLabel ? <p className='ocd4-was-label'>{option.compareLabel}</p> : null}
<p className='ocd4-was'>
<s>{option.compareValue}</s>
</p>
<p className='ocd4-but'>{option.butLine ?? butLine}</p>
</div>
) : null}
<div className='ocd4-today'>
<p className='ocd4-now'>
<span className='ocd4-now-num'>{option.price}</span>
{option.priceUnit ? <span className='ocd4-unit'>{option.priceUnit}</span> : null}
</p>
{option.priceNote ? <p className='ocd4-note'>{option.priceNote}</p> : null}
</div>
</div>
</div>
</div>
) : null}
{option ? (
<div className='ocd4-pair'>
<span className='ocd4-tag ocd4-tag-q' aria-hidden='true'>{questionTag}</span>
<h3 className='ocd4-cell ocd4-q'>{actionQuestion}</h3>
<span className='ocd4-tag ocd4-tag-a' aria-hidden='true'>{answerTag}</span>
<p className='ocd4-cell ocd4-answer'>
<strong>{actionAnswer.lead}</strong> {actionAnswer.text}
</p>
<div className='ocd4-act'>
{destination ? (
<a
className={ctaClass}
href={destination}
onClick={accept}
aria-disabled={isDisabled || loading || undefined}
aria-busy={loading || undefined}
aria-describedby={status === 'error' ? errorId : undefined}
>
{ctaInner}
</a>
) : (
<button
type='button'
className={ctaClass}
onClick={accept}
disabled={isDisabled}
aria-busy={loading || undefined}
aria-describedby={status === 'error' ? errorId : undefined}
>
{ctaInner}
</button>
)}
{option.ctaNote ? (
<p className='ocd4-small'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{option.ctaNote}
</p>
) : null}
{guarantee ? (
<p className='ocd4-small ocd4-guar'>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden='true' />
{guarantee}
</p>
) : null}
{status === 'error' ? (
<p className='ocd4-error' id={errorId} role='alert'>
<AlertCircle size={18} strokeWidth={2.5} aria-hidden='true' />
{errorMessage}
</p>
) : null}
{declineLabel ? (
<a className='ocd4-decline' href={declineHref || '#'} onClick={decline}>
{declineLabel}
</a>
) : null}
</div>
</div>
) : null}
</div>
{phoneImage ? (
<figure className='ocd4-art'>
<img src={phoneImage} alt={phoneImageAlt} width={640} height={640} loading='lazy' decoding='async' />
{caption && option ? (
<figcaption key={'cap-' + swapKey} className='ocd4-in'>
{caption.split('{option}').join(option.name)}
</figcaption>
) : null}
</figure>
) : null}
</div>
</section>
)
}
export default OneClickDownsell4
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='ocd4-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
const CSS = `
.cf-one-click-downsell-4{position:relative;isolation:isolate;overflow:hidden;background:var(--surface,#ffffff);color:var(--ink,#101828);font-family:var(--font-body,system-ui,sans-serif);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-one-click-downsell-4 *{box-sizing:border-box}
.cf-one-click-downsell-4 :where(h1,h2,h3,p,figure){margin:0}
.ocd4-wrap{position:relative;z-index:1;max-width:46rem;margin:0 auto}
.ocd4-wrap.has-art{max-width:1120px;display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,400px);gap:clamp(32px,5vw,72px);align-items:start}
.ocd4-talk{display:grid;gap:clamp(36px,4vw,48px);min-width:0;container-type:inline-size}
.ocd4-pair{display:grid;grid-template-columns:2.75rem minmax(0,1fr);column-gap:16px;row-gap:20px;align-items:first baseline}
.ocd4-tag{grid-column:1;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em}
.ocd4-tag-q{color:var(--accent,#2563eb)}
.ocd4-tag-a{color:var(--muted,#475467)}
.ocd4-cell{grid-column:2;min-width:0}
.ocd4-title{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink,#101828)}
.ocd4-mark{color:var(--field-ink,#101828);padding:0 .1em;border-radius:.12em;background:linear-gradient(transparent 12%,color-mix(in oklch,var(--marker,#fae37c) 88%,transparent) 12%,color-mix(in oklch,var(--marker,#fae37c) 88%,transparent) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.ocd4-lead{margin-top:16px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.ocd4-chips{grid-column:2;display:flex;flex-wrap:wrap;gap:10px;margin-top:8px;align-self:start}
.ocd4-chip{appearance:none;display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 18px;border-radius:999px;border:1.5px solid oklch(from var(--ink,#101828) l c h / .16);background:var(--card,#ffffff);color:var(--ink,#101828);font-family:var(--font-body,inherit);font-size:1rem;font-weight:700;line-height:1.2;cursor:pointer;box-shadow:var(--shadow-sm,0 1px 2px oklch(.22 .03 260 / .18));transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease,transform .16s ease}
.ocd4-chip svg{flex:none;color:var(--accent,#2563eb)}
.ocd4-chip:hover{background:color-mix(in oklch,var(--ink,#101828) 5%,var(--card,#ffffff));border-color:oklch(from var(--ink,#101828) l c h / .3);transform:translateY(-1px)}
.ocd4-chip:active{transform:translateY(0) scale(.97)}
.ocd4-chip[aria-pressed='true']{background:color-mix(in oklch,var(--accent,#2563eb) 12%,var(--card,#ffffff));border-color:var(--accent,#2563eb);box-shadow:inset 0 0 0 1px var(--accent,#2563eb),var(--shadow-md,0 1px 2px oklch(.22 .03 260 / .22))}
.ocd4-chip[aria-pressed='true'] svg{animation:ocd4-pop .3s cubic-bezier(.2,.7,.2,1) both}
.ocd4-chip:focus-visible{outline:3px solid oklch(from var(--accent,#2563eb) l c h / .5);outline-offset:3px}
.ocd4-answer{max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.45;font-weight:500;color:var(--ink,#101828);text-wrap:pretty}
.ocd4-answer strong{font-weight:800}
.ocd4-q{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance;color:var(--ink,#101828)}
.ocd4-card{display:grid;gap:20px;align-items:start;padding:clamp(20px,3vw,32px);background:var(--card,#ffffff);color:var(--ink,#101828);border:1px solid oklch(from var(--accent,#2563eb) l c h / .45);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(.22 .03 260 / .22),0 12px 24px -8px oklch(.22 .03 260 / .32)))}
.ocd4-opt{min-width:0}
.ocd4-opt-name{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
.ocd4-opt-detail{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted,#475467);text-wrap:pretty}
.ocd4-reveal{display:grid;gap:16px 24px;align-items:end;min-width:0;padding:clamp(16px,2vw,24px);border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#ffffff))}
.ocd4-then,.ocd4-today{min-width:0}
@container (min-width:620px){.ocd4-reveal.has-compare{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.ocd4-was-label{font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#475467);text-wrap:pretty}
.ocd4-was{margin-top:12px;font-family:var(--font-display,inherit);font-weight:800;font-size:clamp(1.875rem,2.8vw,2.5rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--muted,#475467)}
.ocd4-was s{position:relative;display:inline-block;text-decoration:none}
.ocd4-was s::after{content:'';position:absolute;left:-.04em;right:-.04em;top:50%;height:.08em;min-height:3px;border-radius:2px;background:var(--danger,#c0392b);transform-origin:left center}
.ocd4-in .ocd4-was s::after{animation:ocd4-strike .4s .2s cubic-bezier(.2,.7,.2,1) both}
.ocd4-but{margin-top:12px;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.4;color:var(--ink,#101828);text-wrap:pretty}
.ocd4-now{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px}
.ocd4-now-num{font-family:var(--font-display,inherit);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--accent,#2563eb)}
.ocd4-unit{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;color:var(--muted,#475467)}
.ocd4-note{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#475467);text-wrap:pretty}
.ocd4-in{animation:ocd4-rise .45s cubic-bezier(.2,.7,.2,1) both}
.ocd4-in .ocd4-reveal :is(.ocd4-then,.ocd4-today)>*{animation:ocd4-rise .45s cubic-bezier(.2,.7,.2,1) both}
.ocd4-in .ocd4-then>:nth-child(2){animation-delay:.07s}
.ocd4-in .ocd4-then>:nth-child(3){animation-delay:.14s}
.ocd4-in .ocd4-today>:nth-child(1){animation-delay:.21s}
.ocd4-in .ocd4-today>:nth-child(n+2){animation-delay:.28s}
.ocd4-act{grid-column:2;display:grid;justify-items:stretch;text-align:center;margin-top:4px;min-width:0}
.ocd4-act .ocd4-cta{margin-top:0;max-width:none}
.ocd4-act .ocd4-decline{justify-self:center}
.ocd4-cta{--ocd4-bg:var(--button-bg,var(--cta,#d9342b));--ocd4-bg2:var(--button-bg-2,var(--cta-2,#b32820));--ocd4-sh:var(--shadow,oklch(.22 .03 260));appearance:none;margin-top:24px;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;max-width:30rem;min-height:72px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ocd4-bg) calc(l + .04) c h),oklch(from var(--ocd4-bg2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#ffffff));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-transform:var(--button-case,none);text-align:center;text-wrap:balance;text-decoration:none;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ocd4-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ocd4-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--ocd4-sh) l c h / .3),0 8px 16px -6px oklch(from var(--ocd4-sh) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.ocd4-cta:hover,.ocd4-cta.is-hover{background:linear-gradient(oklch(from var(--ocd4-bg) calc(l - .01) c h),oklch(from var(--ocd4-bg2) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ocd4-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--ocd4-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--ocd4-sh) l c h / .32),0 12px 20px -6px oklch(from var(--ocd4-sh) l c h / .5))}
.ocd4-cta:active,.ocd4-cta.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--ocd4-bg) calc(l - .04) c h),oklch(from var(--ocd4-bg2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--ocd4-bg) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--ocd4-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--ocd4-sh) l c h / .3)}
.ocd4-cta:focus-visible{outline:3px solid oklch(from var(--ocd4-bg) l c h / .5);outline-offset:3px}
.ocd4-cta:disabled,.ocd4-cta[aria-disabled='true']{cursor:not-allowed;transform:none;background:var(--button-2-bg,var(--secondary,#e8ebf0));color:var(--button-2-ink,var(--secondary-ink,#101828));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(.22 .03 260 / .18)))}
.ocd4-cta[aria-busy='true']{cursor:progress}
.ocd4-spin{flex:none;animation:ocd4-spin .8s linear infinite}
.ocd4-small{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#475467);text-wrap:pretty}
.ocd4-small svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.ocd4-guar{margin-top:6px}
.ocd4-guar svg{color:var(--success,#1e7b45)}
.ocd4-error{margin-top:16px;padding:12px 16px;border-radius:10px;background:var(--danger-soft,#fbeaea);color:var(--danger,#b42318);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.ocd4-error svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em}
.ocd4-decline{margin-top:12px;display:inline-flex;align-items:center;min-height:44px;color:var(--muted,#475467);font-size:.9375rem;font-weight:500;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--muted,#475467) l c h / .5);text-underline-offset:.18em;text-wrap:pretty}
.ocd4-decline:hover{color:var(--ink,#101828);text-decoration-color:currentColor}
.ocd4-decline:focus-visible{outline:3px solid oklch(from var(--accent,#2563eb) l c h / .5);outline-offset:2px;border-radius:4px}
.ocd4-art{position:sticky;top:32px;display:grid;justify-items:center;gap:16px;text-align:center}
.ocd4-art img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3)) drop-shadow(0 18px 22px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .22))}
.ocd4-art figcaption{max-width:30ch;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted,#475467);text-wrap:balance}
@keyframes ocd4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ocd4-strike{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes ocd4-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes ocd4-spin{to{transform:rotate(360deg)}}
@media (max-width:860px){.ocd4-wrap.has-art{grid-template-columns:1fr;max-width:46rem}.ocd4-art{display:none}}
@media (max-width:600px){.ocd4-pair{grid-template-columns:1.75rem minmax(0,1fr);column-gap:10px;row-gap:16px}.ocd4-chips{grid-column:1 / -1;gap:8px}.ocd4-chip{flex:1 1 auto;padding:0 16px}.ocd4-act{grid-column:1 / -1;margin-top:4px}}
@media (prefers-reduced-motion:reduce){.cf-one-click-downsell-4 *,.cf-one-click-downsell-4 *::after{animation:none !important;transition:none !important}.ocd4-chip:hover,.ocd4-cta:hover,.ocd4-cta.is-hover,.ocd4-cta:active,.ocd4-cta.is-active{transform:none}}
`
pieces/checkout/one-click-downsell-4/specimen.tsx 20 lines
import __studioImagedc6e4269 from "../assets/7d24968588c074e8.webp";
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { OneClickDownsell4, type OneClickDownsell4State } from '../one-click-downsell-4'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function OneClickDownsell4Specimen({ state = 'default' }: { state?: OneClickDownsell4State }) {
return (
<OneClickDownsell4
state={state}
guarantee={defaults.sample.guarantee}
phoneImage={slot(
'product',
__studioImagedc6e4269
)}
phoneImageAlt='Shiftly’s weekly staff schedule open on a phone'
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalOneClickDownsell4 |
string |
|
highlight OptionalOneClickDownsell4 |
string |
|
lead OptionalOneClickDownsell4 |
string |
|
reasonsLabel OptionalOneClickDownsell4 |
string |
|
reasons OptionalOneClickDownsell4 |
OneClickDownsell4Reason[] |
|
defaultReason OptionalOneClickDownsell4 |
number | null |
|
defaultAnswer OptionalOneClickDownsell4 |
{ lead: string; text: string } |
|
fallbackOption OptionalOneClickDownsell4 |
OneClickDownsell4Option |
|
offerQuestion OptionalOneClickDownsell4 |
string |
|
actionQuestion OptionalOneClickDownsell4 |
string |
|
actionAnswer OptionalOneClickDownsell4 |
{ lead: string; text: string } |
|
questionTag OptionalOneClickDownsell4 |
string |
|
answerTag OptionalOneClickDownsell4 |
string |
|
butLine OptionalOneClickDownsell4 |
string |
|
phoneImage OptionalOneClickDownsell4 |
string |
|
phoneImageAlt OptionalOneClickDownsell4 |
string |
|
caption OptionalOneClickDownsell4 |
string |
|
guarantee OptionalOneClickDownsell4 |
string |
|
loadingLabel OptionalOneClickDownsell4 |
string |
|
errorMessage OptionalOneClickDownsell4 |
string |
|
declineLabel OptionalOneClickDownsell4 |
string |
|
declineHref OptionalOneClickDownsell4 |
string |
|
href OptionalOneClickDownsell4 |
string |
|
onAction OptionalOneClickDownsell4 |
(choice: OneClickDownsell4Choice) => void | Promise<void> |
|
onDecline OptionalOneClickDownsell4 |
() => void |
|
onReasonChange OptionalOneClickDownsell4 |
(reasonId: string) => void |
|
headingAs OptionalOneClickDownsell4 |
'h1' | 'h2' |
|
disabled OptionalOneClickDownsell4 |
boolean |
|
state OptionalOneClickDownsell4 |
OneClickDownsell4State |
|
className OptionalOneClickDownsell4 |
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-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--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.
product- The main product shot or cover (ebook, kit, bottle).
-
7d24968588c074e8.webp
image/webp · 34.7 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB