Yes Order Box 4
Yes Order Box 4: the plain-billing yes. The dark band carries the buyer’s declaration and what they get. The light half
Use it in a prompt
Use offer/yes-order-box-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/offer/yes-order-box-4.tsx. - Import it and pass your copy and images (Props tab):
import { YesOrderBox4 } from "@/components/funneldna/offer/yes-order-box-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/yes-order-box-4/component.tsx 599 lines
// layout: split-contrast
// Yes Order Box 4: the plain-billing yes. The dark band carries the buyer’s declaration and what they get. The light half
// holds a monthly / annual toggle that rewrites the price and the exact charge sentence live, a guarantee commit line and the action.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, Receipt } from 'lucide-react'
import { FX_HOST, Pattern } from '../fx/fx'
export type YesOrderBox4Interval = 'month' | 'year' | 'once'
export type YesOrderBox4Plan = {
/** Stable key, returned by onSubmit and onPlanChange. */
id: string
/** Toggle label and {plan} in the button label, e.g. 'Annual'. */
name: string
/** Display price, e.g. '$290' or '$24.17'. */
price: string
/** How the plan bills; picks the billing sentence. */
interval: YesOrderBox4Interval
/** Small line under the price, e.g. 'per year, billed once a year'. */
term: string
/** Second line inside the toggle option, e.g. '$290 / year'. */
caption?: string
/** One extra plain fact after the term, e.g. 'works out to $24.17 a month'. */
detail?: string
/** Short flag on the toggle option, e.g. '2 months free'. */
flag?: string
/** Replaces the billing sentence for this plan. Placeholders: {amount} {date} {product}; wrap the key phrase in *…* to highlight it. */
sentence?: string
/** Replaces the computed renewal date, e.g. 'the 1st'. */
renewal?: string
/** Button label for this plan. */
label?: string
}
/** Plain-text templates; named placeholders are replaced as text. */
export type YesOrderBox4Copy = {
/** Placeholder: {product} */
declaration: string
/** Heading above the billing toggle. */
choose: string
/** Heading above the price when one plan is supplied. */
single: string
/** Billing sentences. Placeholders: {amount} {date} {product}; *…* marks the highlighted phrase. */
month: string
year: string
once: string
/** Monthly renewal date. Placeholder: {day} (an ordinal such as 21st). */
dayOfMonth: string
/** Shown until today’s date is known. */
dateFallbackMonth: string
dateFallbackYear: string
ordinals: { one: string; two: string; few: string; other: string }
/** Placeholder: {guarantee} */
commit: string
/** Commit line when no guarantee is supplied. */
commitPlain: string
commitError: string
/** Placeholders: {plan} {product} */
button: string
/** Placeholder: {product} */
buttonSingle: string
loading: string
failed: string
}
export type YesOrderBox4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type YesOrderBox4Props = {
/** Product name, used in the declaration and the button. */
product: string
/** Replaces the declaration built from copy.declaration. */
headline?: React.ReactNode
/** One short line under the declaration. */
lead?: React.ReactNode
/** Plain-words lines on what the buyer gets (three reads best). */
lines?: React.ReactNode[]
/** Honest-billing terms shown as chips on the dark half, e.g. 'No setup fee'. */
terms?: string[]
/** Slot product: product shot on a transparent background. */
productImage?: string
productAlt?: string
/** One plan shows a single price; two or more show the billing toggle. */
plans: YesOrderBox4Plan[]
/** id of the plan selected first. */
defaultPlan?: string
/** Guarantee named in the commit line, e.g. '30-day money-back guarantee'. */
guarantee?: string
/** Whether the commit box starts ticked. */
commitDefault?: boolean
/** One short reassurance line under the button. */
reassurance?: string
/** Locale for the renewal date and ordinals. */
locale?: string
copy?: Partial<YesOrderBox4Copy>
headingLevel?: 2 | 3
disabled?: boolean
state?: YesOrderBox4State
onPlanChange?: (planId: string) => void
/** Receives the chosen plan once the commit box is ticked. Nothing is sent or charged here; a pending promise shows copy.loading, a rejection shows copy.failed. */
onSubmit?: (order: { plan: string; acknowledged: true }) => void | Promise<void>
className?: string
style?: React.CSSProperties
}
const DEFAULT_COPY: YesOrderBox4Copy = {
declaration: 'Yes, I’m starting {product} today',
choose: 'Pick a plan and see exactly what you’ll pay',
single: 'Here’s exactly what you’ll pay',
month: 'I’ll be charged *{amount} today* and on {date} of every month until I cancel.',
year: 'I’ll be charged *{amount} today* and again on {date} each year until I cancel.',
once: 'I’ll be charged *{amount} once, today*. Nothing renews.',
dayOfMonth: 'the {day}',
dateFallbackMonth: 'this day',
dateFallbackYear: 'this date',
ordinals: { one: 'st', two: 'nd', few: 'rd', other: 'th' },
commit: 'I understand I’m covered by the {guarantee}.',
commitPlain: 'I’ve read exactly how I’ll be billed.',
commitError: 'Tick the box to confirm you’ve read how you’ll be billed.',
button: 'Yes, Start My {plan} Plan',
buttonSingle: 'Yes, Start {product} Today',
loading: 'Opening secure checkout…',
failed: 'We couldn’t open checkout. Please try again.',
}
export function YesOrderBox4({
product,
headline,
lead,
lines = [],
terms = [],
productImage,
productAlt = '',
plans,
defaultPlan,
guarantee,
commitDefault = true,
reassurance,
locale = 'en-US',
copy,
headingLevel = 2,
disabled = false,
state = 'default',
onPlanChange,
onSubmit,
className,
style,
}: YesOrderBox4Props) {
const text: YesOrderBox4Copy = {
...DEFAULT_COPY,
...copy,
ordinals: { ...DEFAULT_COPY.ordinals, ...copy?.ordinals },
}
const uid = React.useId()
const headingId = `${uid}-h`
const chooseId = `${uid}-c`
const commitErrId = `${uid}-ke`
const noteId = `${uid}-n`
const [selected, setSelected] = React.useState<string | undefined>(
() => (plans.find((p) => p.id === defaultPlan) ?? plans[0])?.id,
)
const [tick, setTick] = React.useState(0)
const [ack, setAck] = React.useState(commitDefault)
const [touched, setTouched] = React.useState(false)
const [ackErr, setAckErr] = React.useState(false)
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>('idle')
const [today, setToday] = React.useState<Date | null>(null)
const alive = React.useRef(true)
const ackRef = React.useRef<HTMLInputElement>(null)
React.useEffect(() => {
alive.current = true
setToday(new Date())
return () => {
alive.current = false
}
}, [])
const plan = plans.find((p) => p.id === selected) ?? plans[0]
const multi = plans.length > 1
const H = headingLevel === 3 ? 'h3' : 'h2'
const Sub = headingLevel === 3 ? 'h4' : 'h3'
const isDisabled = disabled || state === 'disabled'
const busy = status === 'loading'
const forcedErr = state === 'error' && !touched
const checked = forcedErr ? false : ack
const showAckErr = ackErr || forcedErr
const force = state === 'hover' || state === 'active' ? state : undefined
const pick = (id: string) => {
if (id === plan?.id) return
setSelected(id)
setTick((t) => t + 1)
setStatus('idle')
onPlanChange?.(id)
}
const submit = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (!plan || isDisabled || busy) return
if (!checked) {
setAckErr(true)
ackRef.current?.focus()
return
}
if (!onSubmit) return
setStatus('loading')
try {
await onSubmit({ plan: plan.id, acknowledged: true })
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
const parts = plan ? splitPrice(plan.price) : null
const sentence = plan
? marked(
plan.sentence ?? text[plan.interval],
{ amount: plan.price, date: plan.renewal ?? renewalOf(plan.interval, today, text, locale), product },
tick ? String(tick) : null,
)
: null
const label = plan
? plan.label ?? fillText(multi ? text.button : text.buttonSingle, { plan: plan.name, product })
: ''
return (
<section
className={['cf-yes-order-box-4', className].filter(Boolean).join(' ')}
style={style}
aria-labelledby={headingId}
>
<style>{css}</style>
<div className='yob4-grid'>
<div className='yob4-dark' style={FX_HOST}>
<Pattern name='grid' fade='corner' />
<div className='yob4-dark-in'>
<H id={headingId} className='yob4-h yob4-in'>
{headline ?? fillText(text.declaration, { product })}
</H>
{lead ? (
<p className='yob4-lead yob4-in' style={{ '--i': 1 } as React.CSSProperties}>
{lead}
</p>
) : null}
{lines.length ? (
<ul className='yob4-lines'>
{lines.map((line, i) => (
<li key={i} className='yob4-in' style={{ '--i': Math.min(i + 2, 4) } as React.CSSProperties}>
<span className='yob4-badge' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span className='yob4-line-text'>{line}</span>
</li>
))}
</ul>
) : null}
{terms.length ? (
<ul className='yob4-terms yob4-in' style={{ '--i': 4 } as React.CSSProperties}>
{terms.map((term) => (
<li key={term}>{term}</li>
))}
</ul>
) : null}
{productImage ? (
<img
className='yob4-product yob4-in'
style={{ '--i': 4 } as React.CSSProperties}
src={productImage}
alt={productAlt}
width={640}
height={640}
loading='lazy'
decoding='async'
/>
) : null}
</div>
</div>
{plan ? (
<form className='yob4-light' onSubmit={submit} noValidate aria-labelledby={chooseId}>
<div className='yob4-light-in yob4-in' style={{ '--i': 2 } as React.CSSProperties}>
<Sub id={chooseId} className='yob4-sub'>
{multi ? text.choose : text.single}
</Sub>
{multi ? (
<div
className='yob4-seg'
role='radiogroup'
aria-labelledby={chooseId}
style={{ '--n': plans.length } as React.CSSProperties}
>
{plans.map((p) => {
const on = p.id === plan.id
return (
<label
key={p.id}
className='yob4-opt'
data-on={on || undefined}
data-flag={p.flag ? '' : undefined}
>
<input
className='yob4-sr'
type='radio'
name={`${uid}-plan`}
value={p.id}
checked={on}
onChange={() => pick(p.id)}
/>
<span className='yob4-dot' aria-hidden='true' />
<span className='yob4-opt-name'>{p.name}</span>
{p.caption ? <span className='yob4-opt-sub'>{p.caption}</span> : null}
{p.flag ? <span className='yob4-flag'>{p.flag}</span> : null}
</label>
)
})}
</div>
) : null}
<div className='yob4-price'>
<p className={tick ? 'yob4-fig yob4-swap' : 'yob4-fig'} key={`fig-${tick}`}>
<span aria-hidden='true'>
{parts ? (
<>
{parts.sym ? <sup>{parts.sym}</sup> : null}
{parts.whole}
{parts.cents ? <sup className='yob4-cents'>{parts.cents}</sup> : null}
{parts.tail ? <span className='yob4-tail'>{parts.tail}</span> : null}
</>
) : (
plan.price
)}
</span>
<span className='yob4-sr'>{plan.price}</span>
</p>
<p className='yob4-term'>
{plan.term}
{plan.detail ? ` · ${plan.detail}` : ''}
</p>
</div>
<p className='yob4-well' aria-live='polite'>
<Receipt className='yob4-inline-icon yob4-well-icon' size={20} strokeWidth={2.5} aria-hidden='true' />
{sentence}
</p>
<div className='yob4-commit' data-error={showAckErr || undefined}>
<label className='yob4-check'>
<input
ref={ackRef}
className='yob4-sr'
type='checkbox'
checked={checked}
onChange={(e) => {
setTouched(true)
setAck(e.target.checked)
if (e.target.checked) setAckErr(false)
}}
aria-invalid={showAckErr || undefined}
aria-describedby={showAckErr ? commitErrId : undefined}
/>
<span className='yob4-box' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span className='yob4-check-text'>
{guarantee
? fill(text.commit, { guarantee: <strong>{keepWords(lowerFirst(guarantee))}</strong> })
: text.commitPlain}
</span>
</label>
{showAckErr ? (
<p className='yob4-field-err' id={commitErrId}>
<AlertCircle className='yob4-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{text.commitError}
</p>
) : null}
</div>
<button
type='submit'
className='yob4-btn'
data-force={force}
disabled={isDisabled}
aria-busy={busy || undefined}
aria-describedby={reassurance ? noteId : undefined}
>
{busy ? (
<>
<Loader2 className='yob4-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{text.loading}
</>
) : (
label
)}
</button>
{status === 'error' ? (
<p className='yob4-fail' role='alert'>
<AlertCircle className='yob4-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{text.failed}
</p>
) : null}
{reassurance ? (
<p className='yob4-note' id={noteId}>
<Lock className='yob4-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</div>
</form>
) : null}
</div>
</section>
)
}
export default YesOrderBox4
function fillText(template: string, vars: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? vars[key] : match))
}
function fill(template: string, vars: Record<string, React.ReactNode>) {
return template
.split(/(\{\w+\})/g)
.filter(Boolean)
.map((part, i) => {
const m = /^\{(\w+)\}$/.exec(part)
return <React.Fragment key={i}>{m && m[1] in vars ? vars[m[1]] : part}</React.Fragment>
})
}
/** Fills a sentence template; the *…* segment becomes the one marker-highlighted phrase, re-swiped when draw changes. */
function marked(template: string, vars: Record<string, string>, draw: string | null) {
return template.split('*').map((segment, i) => {
const value = fillText(segment, vars)
if (!value) return null
return i % 2 ? (
<span key={`${i}-${draw ?? ''}`} className={draw ? 'yob4-hl yob4-hl--draw' : 'yob4-hl'}>
{value}
</span>
) : (
<React.Fragment key={i}>{value}</React.Fragment>
)
})
}
function renewalOf(interval: YesOrderBox4Interval, today: Date | null, text: YesOrderBox4Copy, locale: string) {
if (interval === 'month') {
if (!today) return text.dateFallbackMonth
return fillText(text.dayOfMonth, { day: ordinal(today.getDate(), text.ordinals, locale) })
}
if (interval === 'year') {
if (!today) return text.dateFallbackYear
return new Intl.DateTimeFormat(locale, { month: 'long', day: 'numeric' }).format(today)
}
return ''
}
function ordinal(n: number, suffixes: YesOrderBox4Copy['ordinals'], locale: string) {
const rule = new Intl.PluralRules(locale, { type: 'ordinal' }).select(n)
const map = suffixes as Record<string, string>
return `${n}${map[rule] ?? suffixes.other}`
}
function splitPrice(price: string) {
const m = /^(\D*?)(\d[\d,]*)(?:[.,](\d{1,2}))?(.*)$/.exec(price.trim())
if (!m) return null
return { sym: m[1].trim(), whole: m[2], cents: m[3] ?? '', tail: m[4].trim() }
}
function lowerFirst(value: string) {
return value ? value.charAt(0).toLowerCase() + value.slice(1) : value
}
/** Keeps hyphenated words such as "money-back" whole; lines may still break between words. */
function keepWords(value: string) {
return value.split(/(\s+)/).map((part, i) =>
/^\s+$/.test(part) || !part ? (
part
) : (
<span key={i} className='yob4-nw'>
{part}
</span>
),
)
}
const R = '.cf-yes-order-box-4'
/* Colour notes: every colour is a theme token or an OKLCH recipe on one. Documented exceptions: the yellow marker default
(--marker, #fae37c), laid translucent under the theme's own --ink so the phrase reads on light and dark themes alike,
and the white status glyph, which sits on a success fill held at L ≤ 0.52 so the tick stays readable on dark themes. */
const css = `
${R}{--yob4-gut:clamp(16px,5vw,48px);--yob4-seam:clamp(32px,4.5vw,72px);--yob4-pt:clamp(56px,8vw,112px);--yob4-pb:clamp(64px,8.5vw,120px);--yob4-marker:var(--marker,#fae37c);--yob4-hl-fill:color-mix(in oklch,var(--yob4-marker) 72%,transparent);--yob4-ok:oklch(from var(--success) min(l,0.52) c h);--yob4-glyph:var(--badge-glyph,#fff);--yob4-shadow:var(--shadow,oklch(0.22 0.03 260));--yob4-focus:oklch(from var(--field-focus,var(--accent)) l c h / .5);--yob4-well:color-mix(in oklch,var(--ink) 5%,var(--surface));container:yob4/inline-size;position:relative;width:100%;background:var(--surface);color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;-webkit-font-smoothing:antialiased}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h2,h3,h4,p,ul,li){margin:0;padding:0}
${R} :where(ul){list-style:none}
${R} .yob4-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .yob4-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
${R} .yob4-dark{position:relative;isolation:isolate;overflow:hidden;display:flex;justify-content:flex-end;background:var(--band);color:var(--band-ink);padding:var(--yob4-pt) var(--yob4-seam) var(--yob4-pb) max(var(--yob4-gut),calc((100cqi - 1120px) / 2))}
${R} .yob4-dark-in{position:relative;z-index:1;width:100%;max-width:34rem}
${R} .yob4-h{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--band-ink)}
${R} .yob4-lead{margin-top:16px;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--band-ink) 86%,var(--band));text-wrap:pretty}
${R} .yob4-lines{display:grid;gap:16px;margin-top:32px}
${R} .yob4-lines li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;align-items:start;font-size:clamp(1.0625rem,1.4vw,1.25rem);line-height:1.35;font-weight:700;color:var(--band-ink);text-wrap:pretty}
${R} .yob4-line-text{padding-top:max(0px,calc((28px - 1.35em) / 2))}
${R} .yob4-badge{display:grid;place-items:center;width:28px;height:28px;margin-top:max(0px,calc((1.35em - 28px) / 2));border-radius:999px;background:var(--yob4-ok);color:var(--yob4-glyph)}
${R} .yob4-terms{display:flex;flex-wrap:wrap;gap:8px;margin-top:32px}
${R} .yob4-terms li{display:inline-flex;align-items:center;min-height:32px;padding:4px 12px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .12);font-size:.875rem;font-weight:800;line-height:1.2;color:var(--band-ink)}
${R} .yob4-product{display:block;width:min(100%,380px);height:auto;margin-top:24px;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--yob4-shadow) l c h / .45)) drop-shadow(0 16px 18px oklch(from var(--yob4-shadow) l c h / .4))}
${R} .yob4-dark:has(.yob4-product){padding-bottom:calc(var(--yob4-pb) - 40px)}
${R} .yob4-light{display:flex;justify-content:flex-start;padding:var(--yob4-pt) max(var(--yob4-gut),calc((100cqi - 1120px) / 2)) var(--yob4-pb) var(--yob4-seam);background:var(--surface);color:var(--ink)}
${R} .yob4-light-in{position:sticky;top:24px;align-self:flex-start;width:100%;max-width:32rem}
${R} .yob4-sub{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance;color:var(--ink)}
${R} .yob4-seg{display:grid;grid-template-columns:repeat(var(--n,2),minmax(0,1fr));gap:6px;margin-top:24px;padding:6px;border-radius:calc(var(--radius,12px) + 6px);background:var(--yob4-well)}
${R} .yob4-opt{position:relative;display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0;min-height:68px;padding:12px 14px 12px 46px;border-radius:var(--radius,12px);color:var(--ink);cursor:pointer;transition:background-color .16s ease,box-shadow .16s ease}
${R} .yob4-opt[data-flag]{padding-top:20px}
${R} .yob4-opt:not([data-on]):hover{background:color-mix(in oklch,var(--card) 72%,transparent)}
${R} .yob4-opt[data-on]{background:color-mix(in oklch,var(--accent) 9%,var(--card));box-shadow:inset 0 0 0 2px oklch(from var(--accent) l c h / .6),var(--shadow-sm,0 1px 2px oklch(from var(--yob4-shadow) l c h / .22))}
${R} .yob4-opt:has(input:focus-visible){outline:3px solid var(--yob4-focus);outline-offset:2px}
${R} .yob4-dot{position:absolute;left:16px;top:50%;width:20px;height:20px;margin-top:-10px;border-radius:999px;border:2px solid color-mix(in oklch,var(--ink) 42%,transparent);background:var(--field,var(--card));transition:background-color .16s ease,border-color .16s ease}
${R} .yob4-opt:not([data-on]):hover .yob4-dot{border-color:color-mix(in oklch,var(--ink) 62%,transparent)}
${R} .yob4-opt[data-on] .yob4-dot{border-color:var(--accent-fill,var(--accent));background:var(--accent-fill,var(--accent))}
${R} .yob4-opt[data-on] .yob4-dot::after{content:'';position:absolute;inset:4px;border-radius:999px;background:var(--accent-fill-ink,var(--card))}
${R} .yob4-opt-name{font-size:1.0625rem;font-weight:800;line-height:1.2;overflow-wrap:anywhere}
${R} .yob4-opt-sub{font-size:.9375rem;font-weight:500;line-height:1.3;overflow-wrap:anywhere}
${R} .yob4-flag{position:absolute;top:-13px;right:10px;max-width:calc(100% - 20px);min-height:26px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:4px 12px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-size:.875rem;font-weight:800;line-height:1.3;box-shadow:var(--shadow-sm,0 1px 2px oklch(from var(--yob4-shadow) l c h / .22))}
${R} .yob4-price{margin-top:32px}
${R} .yob4-fig{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${R} .yob4-fig sup{position:relative;top:.14em;margin-right:.04em;font-size:.42em;line-height:1;vertical-align:top;letter-spacing:0}
${R} .yob4-fig .yob4-cents{margin-left:.04em;margin-right:0}
${R} .yob4-fig .yob4-tail{margin-left:.15em;font-size:.32em;letter-spacing:0}
${R} .yob4-term{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .yob4-swap{animation:yob4-roll .38s cubic-bezier(.2,.7,.2,1) both}
${R} .yob4-well{margin-top:24px;padding:16px 18px;border-radius:10px;background:var(--yob4-well);font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.45;color:var(--ink);text-wrap:pretty}
${R} .yob4-inline-icon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
${R} .yob4-well-icon{color:var(--accent)}
${R} .yob4-hl{background:linear-gradient(var(--yob4-hl-fill),var(--yob4-hl-fill)) 0 90% / 100% 70% no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .14em;margin:0 -.06em;border-radius:.12em .3em .2em .34em;color:var(--ink);font-weight:800;white-space:nowrap}
${R} .yob4-hl--draw{animation:yob4-swipe .5s cubic-bezier(.2,.7,.2,1) both}
${R} .yob4-commit{margin-top:24px}
${R} .yob4-check{position:relative;display:grid;grid-template-columns:26px minmax(0,1fr);gap:12px;align-items:start;cursor:pointer;font-size:1.0625rem;font-weight:500;line-height:1.45;color:var(--ink);text-wrap:pretty}
${R} .yob4-check strong{font-weight:800}
${R} .yob4-nw{white-space:nowrap}
${R} .yob4-box{display:grid;place-items:center;width:26px;height:26px;margin-top:-1px;border-radius:7px;border:2px solid color-mix(in oklch,var(--ink) 45%,transparent);background:var(--field,var(--card));color:transparent;transition:background-color .16s ease,border-color .16s ease}
${R} .yob4-check:hover .yob4-box{border-color:color-mix(in oklch,var(--ink) 65%,transparent)}
${R} .yob4-check input:checked + .yob4-box{border-color:var(--yob4-ok);background:var(--yob4-ok);color:var(--yob4-glyph)}
${R} .yob4-check input:focus-visible + .yob4-box{outline:3px solid var(--yob4-focus);outline-offset:2px}
${R} .yob4-commit[data-error] .yob4-box{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .18)}
${R} .yob4-field-err{margin-top:10px;padding-left:38px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .yob4-btn{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:72px;margin-top:24px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) 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-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;letter-spacing:-.005em;text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--yob4-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--yob4-shadow) l c h / .42));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .yob4-btn:hover:not(:disabled),${R} .yob4-btn[data-force='hover']:not(:disabled){transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) 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(--button-bg,var(--cta)) calc(l + .12) c h / .65),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--yob4-shadow) l c h / .34),0 12px 20px -8px oklch(from var(--yob4-shadow) l c h / .5))}
${R} .yob4-btn:active:not(:disabled),${R} .yob4-btn[data-force='active']:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .03) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 5px oklch(from var(--button-bg,var(--cta)) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 1px oklch(from var(--yob4-shadow) l c h / .3)}
${R} .yob4-btn:focus-visible{outline:3px solid var(--yob4-focus);outline-offset:3px}
${R} .yob4-btn:disabled{cursor:not-allowed;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))}
${R} .yob4-btn[aria-busy]{cursor:progress}
${R} .yob4-spin{flex:0 0 auto;animation:yob4-spin .8s linear infinite}
${R} .yob4-note,${R} .yob4-fail{margin-top:12px;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${R} .yob4-note{color:var(--muted)}
${R} .yob4-fail{color:var(--danger)}
${R} .yob4-in{animation:yob4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
@keyframes yob4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes yob4-roll{from{opacity:.5;transform:translateY(.12em)}to{opacity:1;transform:none}}
@keyframes yob4-swipe{from{background-size:0% 70%}to{background-size:100% 70%}}
@keyframes yob4-spin{to{transform:rotate(360deg)}}
@container yob4 (max-width: 860px){
${R} .yob4-grid{grid-template-columns:minmax(0,1fr)}
${R} .yob4-dark{justify-content:center;padding:clamp(48px,12vw,72px) var(--yob4-gut) 48px}
${R} .yob4-dark-in{max-width:40rem}
${R} .yob4-dark:has(.yob4-product){padding-bottom:16px}
${R} .yob4-light{justify-content:center;padding:40px var(--yob4-gut) clamp(56px,14vw,88px)}
${R} .yob4-light-in{position:static;max-width:40rem}
${R} .yob4-product{width:min(100%,280px);margin-top:24px}
}
@container yob4 (max-width: 440px){
${R} .yob4-btn{padding:0 16px;font-size:1.0625rem;letter-spacing:-.01em}
${R} .yob4-hl{white-space:normal}
}
@media (prefers-reduced-motion: reduce){
${R} .yob4-in,${R} .yob4-swap,${R} .yob4-hl--draw{animation:none}
${R} .yob4-btn,${R} .yob4-opt,${R} .yob4-dot,${R} .yob4-box{transition:none}
${R} .yob4-btn:hover:not(:disabled),${R} .yob4-btn[data-force='hover']:not(:disabled),${R} .yob4-btn:active:not(:disabled),${R} .yob4-btn[data-force='active']:not(:disabled){transform:none}
${R} .yob4-spin{animation-duration:1.6s}
}
`
pieces/offer/yes-order-box-4/specimen.tsx 50 lines
import __studioImage87a81815 from "../assets/e2637910299f503b.webp";
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { YesOrderBox4, type YesOrderBox4State } from '../yes-order-box-4'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function YesOrderBox4Specimen({ state = 'default' }: { state?: YesOrderBox4State }) {
return (
<YesOrderBox4
product='Ledgerline Pro'
lead='Here’s exactly what you get and exactly what you’ll pay. Nothing hidden in small print.'
lines={[
'Every bank and card account in one ledger, synced daily',
'Receipts snapped on your phone and matched for you',
'Tax-time reports your accountant can open on day one',
]}
terms={['No setup fee', 'No contract', 'Switch or cancel in Settings']}
productImage={slot(
'product',
__studioImage87a81815,
)}
productAlt='Ledgerline Pro bookkeeping dashboard open on a laptop'
plans={[
{
id: 'monthly',
name: 'Monthly',
price: '$29',
interval: 'month',
term: 'per month, billed monthly',
caption: '$29 / month',
},
{
id: 'annual',
name: 'Annual',
price: '$290',
interval: 'year',
term: 'per year, billed once a year',
caption: '$290 / year',
detail: 'works out to $24.17 a month',
flag: '2 months free',
},
]}
defaultPlan='annual'
guarantee={defaults.sample.guarantee}
reassurance='Secure checkout · Encrypted card payment'
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
product RequiredYesOrderBox4 |
string |
|
headline OptionalYesOrderBox4 |
React.ReactNode |
|
lead OptionalYesOrderBox4 |
React.ReactNode |
|
lines OptionalYesOrderBox4 |
React.ReactNode[] |
Default []
|
terms OptionalYesOrderBox4 |
string[] |
Default []
|
productImage OptionalYesOrderBox4 |
string |
|
productAlt OptionalYesOrderBox4 |
string |
Default ''
|
plans RequiredYesOrderBox4 |
YesOrderBox4Plan[] |
|
defaultPlan OptionalYesOrderBox4 |
string |
|
guarantee OptionalYesOrderBox4 |
string |
|
commitDefault OptionalYesOrderBox4 |
boolean |
Default true
|
reassurance OptionalYesOrderBox4 |
string |
|
locale OptionalYesOrderBox4 |
string |
Default 'en-US'
|
copy OptionalYesOrderBox4 |
Partial<YesOrderBox4Copy> |
|
headingLevel OptionalYesOrderBox4 |
2 | 3 |
Default 2
|
disabled OptionalYesOrderBox4 |
boolean |
Default false
|
state OptionalYesOrderBox4 |
YesOrderBox4State |
Default 'default'
|
onPlanChange OptionalYesOrderBox4 |
(planId: string) => void |
|
onSubmit OptionalYesOrderBox4 |
(order: { plan: string; acknowledged: true }) => void | Promise<void> |
|
className OptionalYesOrderBox4 |
string |
|
style OptionalYesOrderBox4 |
React.CSSProperties |
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.
--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.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e2637910299f503b.webp
image/webp · 46.5 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB