One Step Order 4
Closes a low-ticket sale inside the letter itself: hook, turn and offer read down one column, then the order form flows straight in with an Add To Cart button that counts the fields left and lights up when the order is ready.
Use it in a prompt
Use checkout/one-step-order-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-step-order-4.tsx. - Import it and pass your copy and images (Props tab):
import { OneStepOrder4 } from "@/components/funneldna/checkout/one-step-order-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-step-order-4/component.tsx 642 lines
// layout: scroll-panels
// Closes a low-ticket sale inside the letter itself: hook, turn and offer read down one column, then the order form flows straight in with an Add To Cart button that counts the fields left and lights up when the order is ready.
'use client'
import * as React from 'react'
import { AlertCircle, Check, Loader2, Lock, ShieldCheck, ShoppingCart } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
export type OneStepOrder4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneStepOrder4Paragraph = {
/** Mid-copy subhead set in the letter's subhead colour, like a printed sales letter. */
subhead?: React.ReactNode
/** Bold opening words of the paragraph. */
leadIn: React.ReactNode
body: React.ReactNode
}
export type OneStepOrder4Bump = {
title: string
price: string
body: string
/** Short name for the order line when the add-on is ticked. */
summaryName?: string
}
export type OneStepOrder4Network = 'visa' | 'mastercard' | 'amex' | 'discover'
export type OneStepOrder4Values = { name: string; email: string; card: string; exp: string; cvc: string }
type Field = keyof OneStepOrder4Values
type Errors = Partial<Record<Field, string>>
type Banner = 'invalid' | 'failed' | null
const ORDER_COPY = {
contactTitle: 'Where should we send it?',
paymentTitle: 'Pay securely by card',
nameLabel: 'Full name',
namePlaceholder: 'Jane Smith',
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
cardLabel: 'Card number',
cardPlaceholder: '1234 1234 1234 1234',
expLabel: 'Expiry',
expPlaceholder: 'MM / YY',
cvcLabel: 'Security code',
cvcPlaceholder: '123',
nameError: 'Enter your full name.',
emailError: 'Enter a valid email address, like you@example.com.',
cardError: 'Check your card number.',
expError: 'Enter a future expiry date as MM / YY.',
cvcError: 'Enter the {digits}-digit code on your card.',
networksLabel: 'Cards accepted',
bumpTag: 'One-time offer: ',
bumpPrice: 'Add {price}',
bumpAdded: '+ {bump}',
priceNote: 'one-time payment',
totalAria: 'Total today: {total}',
fieldsLeftOne: '1 field to go',
fieldsLeftMany: '{count} fields to go',
readyAnnounce: 'All fields complete. Your order is ready.',
loadingLabel: 'Processing…',
failMessage: 'We couldn’t complete your order. Please try again.',
}
export type OneStepOrder4Copy = typeof ORDER_COPY
export type OneStepOrder4Props = {
/** Supporting labels, placeholders and validation copy. Templates replace {price}, {bump}, {total}, {count} and {digits} as text. */
copy?: Partial<OneStepOrder4Copy>
/** Receives validated local values and the add-on choice. The block never sends or charges anything. A returned promise shows the processing label; a rejection shows copy.failMessage. */
onSubmit?: (values: Readonly<OneStepOrder4Values>, bumpSelected: boolean) => void | Promise<void>
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke. */
highlight?: string
/** Slot scene: the after-state photo under the headline. */
sceneImage?: string
sceneImageAlt?: string
/** Plain caption under the photo. */
caption?: string
salutation?: string
/** The letter: hook, the turn, the offer. */
paragraphs?: OneStepOrder4Paragraph[]
productName?: string
/** Slot product: transparent product shot, shown after the offer paragraph and in the order line. */
productImage?: string
productImageAlt?: string
/** Caption under the product shot. */
productCaption?: string
closing?: string
/** The owner's printed name under the letter. */
authorName?: string
authorRole?: string
/** Slot presenter: the author's portrait beside the printed name. */
presenterImage?: string
presenterImageAlt?: string
formTitle?: string
formLead?: string
price?: string
/** Optional, unticked add-on above the button; its price joins the total only when ticked. */
bump?: OneStepOrder4Bump | null
/** Only list the networks the real processor accepts. */
networks?: OneStepOrder4Network[]
/** Button label; the live total sits beside it. */
label?: string
/** Reassurance line shown under the label once every field is valid. */
sublabel?: string
guarantee?: string
/** Shown above the button after an order attempt with invalid fields. */
errorMessage?: string
/** Shown in the button when checkout is unavailable. */
disabledMessage?: string
state?: OneStepOrder4State
disabled?: boolean
className?: string
}
const NETS = {
visa: { name: 'Visa', Icon: Visa },
mastercard: { name: 'Mastercard', Icon: Mastercard },
amex: { name: 'American Express', Icon: AmericanExpress },
discover: { name: 'Discover', Icon: Discover },
}
const FIELDS: Field[] = ['name', 'email', 'card', 'exp', 'cvc']
const EMPTY: OneStepOrder4Values = { name: '', email: '', card: '', exp: '', cvc: '' }
const VALID_PREFILL: OneStepOrder4Values = { name: 'Jordan Lee', email: 'jordan@example.com', card: '4242 4242 4242 4242', exp: '08 / 30', cvc: '123' }
const ERROR_PREFILL: OneStepOrder4Values = { name: 'Jordan Lee', email: 'jordan@example', card: '4242 4242 4242 4241', exp: '13 / 24', cvc: '12' }
const DEFAULT_PARAGRAPHS: OneStepOrder4Paragraph[] = [
{
subhead: 'Your funnel doesn’t need more tools',
leadIn: 'If you’ve started a funnel and stalled,',
body: 'it’s rarely the software. It’s the blank page: which pages you need, what each one says, and what happens next.',
},
{
subhead: 'Plan first, then build',
leadIn: 'Here’s the turn:',
body: 'when the plan comes before the pages, every page has one job and the copy is far easier to write.',
},
{
subhead: 'Everything you need in one download',
leadIn: 'That’s why we put together The Funnel Starter Kit.',
body: 'The guide, the workbook and the checklist take you from a blank page to a funnel you can check line by line before launch.',
},
]
export function OneStepOrder4({
copy: copyOverrides,
onSubmit,
headline = 'Build your first funnel with a clear plan',
highlight = 'clear plan',
sceneImage,
sceneImageAlt = '',
caption,
salutation = 'Dear friend,',
paragraphs = DEFAULT_PARAGRAPHS,
productName = 'The Funnel Starter Kit',
productImage,
productImageAlt = '',
productCaption,
closing = 'To your first launch,',
authorName,
authorRole,
presenterImage,
presenterImageAlt = '',
formTitle = 'Start building your funnel today',
formLead = 'Fill in the five fields below. Your button lights up the moment your order is ready.',
price = '$47',
bump = null,
networks = ['visa', 'mastercard', 'amex', 'discover'],
label = 'Add To Cart',
sublabel = 'Secure checkout · Instant access',
guarantee = '30-day money-back guarantee',
errorMessage = 'Please fix the highlighted fields to finish your order.',
disabledMessage = 'Checkout is unavailable right now.',
state = 'default',
disabled = false,
className,
}: OneStepOrder4Props) {
const copy = { ...ORDER_COPY, ...Object.fromEntries(Object.entries(copyOverrides ?? {}).filter(([, v]) => v !== undefined)) } as OneStepOrder4Copy
const uid = 'os4' + React.useId().replace(/[^a-zA-Z0-9]/g, '')
const [values, setValues] = React.useState<OneStepOrder4Values>(() => prefillFor(state))
const [touched, setTouched] = React.useState<Partial<Record<Field, boolean>>>({})
const [showAll, setShowAll] = React.useState(state === 'error')
const [banner, setBanner] = React.useState<Banner>(state === 'error' ? 'invalid' : null)
const [busy, setBusy] = React.useState(false)
const [bumpOn, setBumpOn] = React.useState(false)
const request = React.useRef(0)
const refs = React.useRef<Partial<Record<Field, HTMLInputElement | null>>>({})
React.useEffect(() => {
request.current++
setValues(prefillFor(state))
setTouched({})
setShowAll(state === 'error')
setBanner(state === 'error' ? 'invalid' : null)
setBusy(false)
setBumpOn(false)
}, [state])
React.useEffect(() => () => { request.current++ }, [])
const isDisabled = disabled || state === 'disabled'
const live = validate(values, copy)
const left = FIELDS.filter((f) => live[f]).length
const ready = left === 0
const brand = detectBrand(digitsOf(values.card))
const sym = symbolOf(price)
const base = parseMoney(price)
const bumpAmount = bump ? parseMoney(bump.price) : null
const total = base === null ? null : base + (bump && bumpOn && bumpAmount !== null ? bumpAmount : 0)
const totalText = total === null ? price : sym + amountOf(total)
const countText = left === 1 ? copy.fieldsLeftOne : fill(copy.fieldsLeftMany, { count: String(left) })
const forced = state === 'hover' ? 'is-hover' : state === 'active' ? 'is-press' : null
const errorOf = (f: Field) => (showAll || (touched[f] && values[f]) ? live[f] : undefined)
const last = paragraphs.length - 1
function update(f: Field, raw: string) {
const v = f === 'card' ? formatCard(raw) : f === 'exp' ? formatExp(raw) : f === 'cvc' ? digitsOf(raw).slice(0, 4) : raw
setValues((p) => ({ ...p, [f]: v }))
if (banner === 'failed') setBanner(null)
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || busy) return
const first = FIELDS.find((f) => live[f])
if (first) {
setShowAll(true)
setBanner('invalid')
refs.current[first]?.focus()
return
}
setBanner(null)
if (!onSubmit) return
const req = ++request.current
try {
const result = onSubmit({ ...values }, bumpOn)
if (!result) return
setBusy(true)
await result
if (req === request.current) setBusy(false)
} catch {
if (req === request.current) {
setBanner('failed')
setBusy(false)
}
}
}
const field = (f: Field, o: { label: string; placeholder: string; autoComplete: string; type?: string; inputMode?: 'text' | 'email' | 'numeric'; className?: string }) => {
const id = `${uid}-${f}`
const err = errorOf(f)
const ok = !live[f] && Boolean(values[f])
return (
<div className={cx('os4-field', o.className)}>
<label className='os4-label' htmlFor={id}>{o.label}</label>
<div className='os4-control'>
<input
ref={(el) => { refs.current[f] = el }}
id={id}
name={f}
type={o.type ?? 'text'}
autoComplete={o.autoComplete}
inputMode={o.inputMode}
placeholder={o.placeholder}
value={values[f]}
disabled={isDisabled}
aria-required='true'
aria-invalid={err ? true : undefined}
aria-describedby={err ? `${id}-err` : undefined}
className={cx('os4-input', err && 'is-invalid')}
onChange={(e) => update(f, e.target.value)}
onBlur={() => setTouched((p) => (p[f] ? p : { ...p, [f]: true }))}
/>
{ok ? <span className='os4-ok' aria-hidden='true'><Check strokeWidth={3} /></span> : null}
</div>
{err ? <p className='os4-err' id={`${id}-err`}><AlertCircle aria-hidden='true' strokeWidth={2.5} />{err}</p> : null}
</div>
)
}
return (
<section className={cx('cf-one-step-order-4', className)} aria-labelledby={`${uid}-h`}>
<style>{CSS}</style>
<div className='os4-col'>
<h2 className='os4-h os4-rise' id={`${uid}-h`}>{marked(headline, highlight)}</h2>
{sceneImage ? (
<figure className='os4-scene os4-rise' style={rise(1)}>
<img src={sceneImage} alt={sceneImageAlt} width={1536} height={1024} loading='lazy' />
{caption ? <figcaption>{caption}</figcaption> : null}
</figure>
) : null}
<div className='os4-letter'>
<p className='os4-salute os4-rise' style={rise(2)}>{salutation}</p>
{paragraphs.map((p, i) => (
<div className='os4-panel os4-rise' style={rise(3 + i)} key={i}>
{p.subhead ? <h3 className='os4-sub'>{p.subhead}</h3> : null}
<p className='os4-p'><strong>{p.leadIn}</strong> {p.body}</p>
{i === last && productImage ? (
<figure className='os4-product'>
<img src={productImage} alt={productImageAlt} width={512} height={512} loading='lazy' />
{productCaption ? <figcaption>{productCaption}</figcaption> : null}
</figure>
) : null}
</div>
))}
<div className='os4-sign'>
<p className='os4-p'>{closing}</p>
{authorName ? (
<div className='os4-author'>
{presenterImage ? <img src={presenterImage} alt={presenterImageAlt} width={128} height={128} loading='lazy' /> : null}
<div>
<p className='os4-name'>{authorName}</p>
{authorRole ? <p className='os4-role'>{authorRole}</p> : null}
</div>
</div>
) : null}
</div>
</div>
<form className='os4-well' noValidate onSubmit={handleSubmit} aria-labelledby={`${uid}-ft`} aria-busy={busy || undefined}>
<h3 className='os4-sub' id={`${uid}-ft`}>{formTitle}</h3>
{formLead ? <p className='os4-lead'>{formLead}</p> : null}
<div className='os4-group' role='group' aria-labelledby={`${uid}-g1`}>
<p className='os4-legend' id={`${uid}-g1`}>{copy.contactTitle}</p>
<div className='os4-grid os4-grid-contact'>
{field('name', { label: copy.nameLabel, placeholder: copy.namePlaceholder, autoComplete: 'name' })}
{field('email', { label: copy.emailLabel, placeholder: copy.emailPlaceholder, autoComplete: 'email', type: 'email', inputMode: 'email' })}
</div>
</div>
<div className='os4-group' role='group' aria-labelledby={`${uid}-g2`}>
<div className='os4-legend-row'>
<p className='os4-legend' id={`${uid}-g2`}><Lock aria-hidden='true' strokeWidth={2.5} />{copy.paymentTitle}</p>
<ul className='os4-nets' aria-label={copy.networksLabel}>
{networks.map((n) => {
const Net = NETS[n]
return (
<li key={n} className={cx(brand && brand !== n && 'is-dim')}>
<Net.Icon aria-hidden='true' />
<span className='os4-sr'>{Net.name}</span>
</li>
)
})}
</ul>
</div>
<div className='os4-grid'>
{field('card', { label: copy.cardLabel, placeholder: copy.cardPlaceholder, autoComplete: 'cc-number', inputMode: 'numeric', className: 'os4-span' })}
{field('exp', { label: copy.expLabel, placeholder: copy.expPlaceholder, autoComplete: 'cc-exp', inputMode: 'numeric' })}
{field('cvc', { label: copy.cvcLabel, placeholder: copy.cvcPlaceholder, autoComplete: 'cc-csc', inputMode: 'numeric' })}
</div>
</div>
{bump ? (
<div className={cx('os4-bump', bumpOn && 'is-on', isDisabled && 'is-disabled')}>
<label className='os4-bump-strip' htmlFor={`${uid}-bump`}>
<span className='os4-box'>
<input
id={`${uid}-bump`}
type='checkbox'
name='bump'
checked={bumpOn}
disabled={isDisabled}
aria-describedby={`${uid}-bump-body`}
onChange={(e) => setBumpOn(e.target.checked)}
/>
<Check aria-hidden='true' strokeWidth={3} />
</span>
<span className='os4-bump-title'>{bump.title}</span>
<span className='os4-bump-price'>{fill(copy.bumpPrice, { price: bump.price })}</span>
</label>
<p className='os4-bump-body' id={`${uid}-bump-body`}><strong>{copy.bumpTag}</strong>{bump.body}</p>
</div>
) : null}
<div className='os4-total'>
{productImage ? <img className='os4-thumb' src={productImage} alt='' width={128} height={128} loading='lazy' /> : null}
<div className='os4-total-name'>
<p className='os4-item'>{productName}</p>
{bump && bumpOn ? <p className='os4-item-add'>{fill(copy.bumpAdded, { bump: bump.summaryName ?? bump.title })}</p> : null}
</div>
<div className='os4-figure' aria-live='polite'>
<p className='os4-price'>
<span className='os4-sr'>{fill(copy.totalAria, { total: totalText })}</span>
<span aria-hidden='true'>{total === null ? price : <><sup>{sym}</sup>{amountOf(total)}</>}</span>
</p>
<p className='os4-note'>{copy.priceNote}</p>
</div>
</div>
{(banner === 'invalid' && !ready) || banner === 'failed' ? (
<p className='os4-alert' role='alert'><AlertCircle aria-hidden='true' strokeWidth={2.5} />{banner === 'failed' ? copy.failMessage : errorMessage}</p>
) : null}
<div className='os4-action'>
<button
type='submit'
className={cx('os4-btn', !ready && !isDisabled && 'is-waiting', ready && !isDisabled && 'is-ready', busy && 'is-busy', forced)}
disabled={isDisabled || busy}
aria-disabled={!ready && !isDisabled ? true : undefined}
>
<span className='os4-main'>
{busy ? <Loader2 className='os4-spin' aria-hidden='true' strokeWidth={2.5} /> : <ShoppingCart aria-hidden='true' strokeWidth={2.5} />}
<span>{busy ? copy.loadingLabel : label}</span>
{busy ? null : <span className='os4-tag'>{totalText}</span>}
</span>
<span className='os4-subline'>
{isDisabled ? disabledMessage : ready ? sublabel : (
<>
<span className='os4-dots' aria-hidden='true'>{FIELDS.map((f) => <i key={f} className={live[f] ? undefined : 'is-done'} />)}</span>
{countText}
</>
)}
</span>
</button>
{guarantee ? <p className='os4-guarantee'><ShieldCheck aria-hidden='true' strokeWidth={2.5} />{guarantee}</p> : null}
</div>
<p className='os4-sr' aria-live='polite'>{isDisabled ? '' : ready ? copy.readyAnnounce : countText}</p>
</form>
</div>
</section>
)
}
export default OneStepOrder4
function prefillFor(state: OneStepOrder4State): OneStepOrder4Values {
if (state === 'hover' || state === 'active') return { ...VALID_PREFILL }
if (state === 'error') return { ...ERROR_PREFILL }
return { ...EMPTY }
}
function rise(i: number) {
return { ['--d' as string]: `${Math.min(i * 0.07, 0.28).toFixed(2)}s` } as React.CSSProperties
}
function marked(text: string, phrase?: string) {
if (!phrase) return text
const i = text.indexOf(phrase)
if (i < 0) return text
return <>{text.slice(0, i)}<span className='os4-mark'>{phrase}</span>{text.slice(i + phrase.length)}</>
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ')
}
function fill(template: string, vals: Record<string, string>) {
return template.replace(/[{]([a-z]+)[}]/gi, (m: string, k: string) => vals[k] ?? m)
}
function digitsOf(s: string) {
return s.replace(/[^0-9]/g, '')
}
function parseMoney(s?: string) {
if (!s || !/[0-9]/.test(s)) return null
const n = Number(s.replace(/[^0-9.]/g, ''))
return Number.isFinite(n) ? n : null
}
function symbolOf(price: string) {
return price.trim().match(/^[^0-9 .,]+/)?.[0] ?? ''
}
function amountOf(n: number) {
return Number.isInteger(n) ? String(n) : n.toFixed(2)
}
function detectBrand(n: string): OneStepOrder4Network | null {
if (/^4/.test(n)) return 'visa'
if (/^(5[1-5]|2[2-7])/.test(n)) return 'mastercard'
if (/^3[47]/.test(n)) return 'amex'
if (/^(6011|65|64[4-9])/.test(n)) return 'discover'
return null
}
function formatCard(raw: string) {
const d = digitsOf(raw).slice(0, 19)
if (detectBrand(d) === 'amex') return [d.slice(0, 4), d.slice(4, 10), d.slice(10, 15)].filter(Boolean).join(' ')
return (d.match(/.{1,4}/g) ?? []).join(' ')
}
function formatExp(raw: string) {
const d = digitsOf(raw).slice(0, 4)
return d.length > 2 ? d.slice(0, 2) + ' / ' + d.slice(2) : d
}
function luhn(n: string) {
let sum = 0
for (let i = 0; i < n.length; i++) {
let d = Number(n[n.length - 1 - i])
if (i % 2 === 1) {
d *= 2
if (d > 9) d -= 9
}
sum += d
}
return sum % 10 === 0
}
function validExp(exp: string) {
const d = digitsOf(exp)
if (d.length !== 4) return false
const m = Number(d.slice(0, 2))
const y = 2000 + Number(d.slice(2))
if (m < 1 || m > 12) return false
const now = new Date()
const cy = now.getFullYear()
const cm = now.getMonth() + 1
return (y > cy || (y === cy && m >= cm)) && y <= cy + 20
}
function validate(v: OneStepOrder4Values, copy: OneStepOrder4Copy): Errors {
const e: Errors = {}
if (v.name.trim().length < 2) e.name = copy.nameError
if (!/^[^ @]+@[^ @]+[.][^ @.]{2,}$/.test(v.email.trim())) e.email = copy.emailError
const card = digitsOf(v.card)
if (card.length < 13 || card.length > 19 || !luhn(card)) e.card = copy.cardError
if (!validExp(v.exp)) e.exp = copy.expError
const need = detectBrand(card) === 'amex' ? 4 : 3
if (v.cvc.length !== need) e.cvc = fill(copy.cvcError, { digits: String(need) })
return e
}
const CSS = `
.cf-one-step-order-4{--os4-sub:var(--letter-subhead-ink,var(--accent));--os4-marker:var(--marker,#fae37c);--os4-well:color-mix(in oklch,var(--ink) 4%,var(--surface));--os4-btn:var(--button-bg,var(--cta));--os4-btn-2:var(--button-bg-2,var(--cta-2));--os4-btn-ink:var(--button-ink,var(--cta-ink));--os4-sh:var(--shadow,oklch(0.22 0.03 260));--os4-focus:var(--field-focus,var(--accent));--os4-glyph:var(--status-glyph,#fff);position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(18px,5vw,48px) clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-one-step-order-4 *,.cf-one-step-order-4 *::before,.cf-one-step-order-4 *::after{box-sizing:border-box}
.cf-one-step-order-4 :where(h2,h3,p,figure,ul){margin:0}
.cf-one-step-order-4 .os4-col{max-width:46rem;margin-inline:auto}
.cf-one-step-order-4 .os4-h{font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
.cf-one-step-order-4 .os4-mark{background-image:linear-gradient(color-mix(in oklch,var(--os4-marker) 88%,transparent),color-mix(in oklch,var(--os4-marker) 88%,transparent));background-repeat:no-repeat;background-size:100% .48em;background-position:0 86%;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .06em;border-radius:.1em .22em .12em .2em}
.cf-one-step-order-4 .os4-scene{margin-top:32px}
.cf-one-step-order-4 .os4-scene img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;object-position:center 40%;border-radius:12px}
.cf-one-step-order-4 figcaption{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-one-step-order-4 .os4-letter{margin-top:clamp(32px,4vw,48px)}
.cf-one-step-order-4 .os4-salute{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.5}
.cf-one-step-order-4 .os4-panel{margin-top:clamp(28px,3.5vw,40px)}
.cf-one-step-order-4 .os4-salute+.os4-panel{margin-top:20px}
.cf-one-step-order-4 .os4-sub{font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-.01em;text-transform:var(--display-case,none);color:var(--os4-sub);text-wrap:balance;margin-bottom:10px}
.cf-one-step-order-4 .os4-p{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.6;max-width:64ch;text-wrap:pretty}
.cf-one-step-order-4 .os4-p strong{font-weight:800}
.cf-one-step-order-4 .os4-product{margin-top:28px;text-align:center}
.cf-one-step-order-4 .os4-product img{display:block;width:min(100%,320px);height:auto;aspect-ratio:1;object-fit:contain;margin-inline:auto;filter:drop-shadow(0 2px 3px oklch(from var(--os4-sh) l c h / .28)) drop-shadow(0 14px 18px oklch(from var(--os4-sh) l c h / .18))}
.cf-one-step-order-4 .os4-sign{margin-top:clamp(28px,3.5vw,40px)}
.cf-one-step-order-4 .os4-author{display:flex;align-items:center;gap:16px;margin-top:16px}
.cf-one-step-order-4 .os4-author img{width:64px;height:64px;flex:none;border-radius:50%;object-fit:cover;object-position:center 30%}
.cf-one-step-order-4 .os4-name{font-family:var(--font-display);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:var(--display-weight,800);line-height:1.3}
.cf-one-step-order-4 .os4-role{margin-top:2px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-one-step-order-4 .os4-well{margin-top:clamp(40px,6vw,64px);background:var(--os4-well);border:1px solid oklch(from var(--ink) l c h / .08);border-radius:var(--card-radius,var(--radius,14px));padding:clamp(20px,3.5vw,40px)}
.cf-one-step-order-4 .os4-well .os4-sub{color:var(--ink)}
.cf-one-step-order-4 .os4-lead{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-one-step-order-4 .os4-group{margin-top:28px}
.cf-one-step-order-4 .os4-legend{font-size:1rem;font-weight:800;line-height:1.3;color:var(--ink)}
.cf-one-step-order-4 .os4-group>.os4-legend,.cf-one-step-order-4 .os4-legend-row{margin-bottom:16px}
.cf-one-step-order-4 .os4-legend-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px}
.cf-one-step-order-4 .os4-legend svg,.cf-one-step-order-4 .os4-err svg,.cf-one-step-order-4 .os4-alert svg,.cf-one-step-order-4 .os4-guarantee svg{display:inline-block;width:16px;height:16px;vertical-align:-.15em;margin-inline-end:.4em}
.cf-one-step-order-4 .os4-nets{display:flex;gap:6px;list-style:none;padding:0}
.cf-one-step-order-4 .os4-nets li{display:flex;transition:opacity .16s ease}
.cf-one-step-order-4 .os4-nets svg{display:block;width:36px;height:auto}
.cf-one-step-order-4 .os4-nets .is-dim{opacity:.3}
.cf-one-step-order-4 .os4-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cf-one-step-order-4 .os4-span{grid-column:1/-1}
.cf-one-step-order-4 .os4-field{min-width:0}
.cf-one-step-order-4 .os4-label{display:block;margin-bottom:8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
.cf-one-step-order-4 .os4-control{position:relative}
.cf-one-step-order-4 .os4-input{display:block;width:100%;height:56px;margin:0;padding:0 48px 0 16px;font-family:var(--font-body);font-size:1.0625rem;font-variant-numeric:tabular-nums;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--os4-sh) l c h / .06);outline:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-one-step-order-4 .os4-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-one-step-order-4 .os4-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 45%,transparent)}
.cf-one-step-order-4 .os4-input:focus{border-color:var(--os4-focus);box-shadow:0 0 0 3px oklch(from var(--os4-focus) l c h / .35)}
.cf-one-step-order-4 .os4-input.is-invalid{border-color:var(--danger)}
.cf-one-step-order-4 .os4-input.is-invalid:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-one-step-order-4 .os4-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 6%,var(--field))}
.cf-one-step-order-4 .os4-ok{position:absolute;right:16px;top:50%;width:22px;height:22px;margin-top:-11px;border-radius:50%;background:var(--success);color:var(--os4-glyph);display:grid;place-items:center;pointer-events:none}
.cf-one-step-order-4 .os4-ok svg{width:14px;height:14px}
.cf-one-step-order-4 .os4-err{margin-top:8px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
.cf-one-step-order-4 .os4-bump{margin-top:28px;background:var(--bump);color:var(--bump-ink);border:2px solid oklch(from var(--bump-strip) calc(l - .2) c h);border-radius:var(--radius,12px);overflow:hidden;transition:box-shadow .16s ease}
.cf-one-step-order-4 .os4-bump.is-on{box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--os4-sh) l c h / .22),0 4px 10px -2px oklch(from var(--os4-sh) l c h / .2))}
.cf-one-step-order-4 .os4-bump-strip{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;padding:14px 16px;background:var(--bump-strip);color:var(--bump-ink);cursor:pointer;transition:background .16s ease}
.cf-one-step-order-4 .os4-bump-strip:hover{background:oklch(from var(--bump-strip) calc(l - .03) c h)}
.cf-one-step-order-4 .os4-bump.is-on .os4-bump-strip{background:oklch(from var(--bump-strip) calc(l - .05) c h)}
.cf-one-step-order-4 .os4-bump.is-disabled .os4-bump-strip{cursor:not-allowed}
.cf-one-step-order-4 .os4-box{position:relative;flex:none;width:26px;height:26px;border-radius:7px;background:var(--os4-tick,var(--field));border:2px solid var(--os4-tick,oklch(from var(--bump-ink) l c h / .6));display:grid;place-items:center;color:var(--os4-glyph);transition:background .16s ease,border-color .16s ease}
.cf-one-step-order-4 .os4-box input{position:absolute;inset:-2px;width:calc(100% + 4px);height:calc(100% + 4px);margin:0;opacity:0;cursor:inherit}
.cf-one-step-order-4 .os4-box svg{width:16px;height:16px;opacity:0;transition:opacity .16s ease}
.cf-one-step-order-4 .os4-bump.is-on{--os4-tick:var(--success)}
.cf-one-step-order-4 .os4-bump.is-on .os4-box svg{opacity:1}
.cf-one-step-order-4 .os4-bump-strip:has(input:focus-visible) .os4-box{outline:3px solid var(--os4-focus);outline-offset:2px}
.cf-one-step-order-4 .os4-bump-title{flex:1 1 12rem;font-family:var(--font-display);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:var(--display-weight,800);line-height:1.3;text-wrap:pretty}
.cf-one-step-order-4 .os4-bump-price{flex:none;padding:4px 12px;border-radius:999px;background:var(--bump);color:var(--bump-ink);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap}
.cf-one-step-order-4 .os4-bump-body{padding:14px 16px 16px;font-size:1rem;line-height:1.5;text-wrap:pretty}
.cf-one-step-order-4 .os4-bump-body strong{font-size:.875rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase}
.cf-one-step-order-4 .os4-total{display:flex;align-items:center;gap:16px;margin-top:28px}
.cf-one-step-order-4 .os4-thumb{width:64px;height:64px;flex:none;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--os4-sh) l c h / .25)) drop-shadow(0 8px 10px oklch(from var(--os4-sh) l c h / .12))}
.cf-one-step-order-4 .os4-total-name{flex:1;min-width:0}
.cf-one-step-order-4 .os4-item{font-family:var(--font-display);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:var(--display-weight,800);line-height:1.3;text-wrap:pretty}
.cf-one-step-order-4 .os4-item-add{margin-top:4px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-one-step-order-4 .os4-figure{flex:none;text-align:right}
.cf-one-step-order-4 .os4-price{font-family:var(--font-display);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:var(--display-weight,800);letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-one-step-order-4 .os4-price sup{position:relative;top:.14em;font-size:.46em;line-height:1;vertical-align:top;margin-right:.04em;letter-spacing:0}
.cf-one-step-order-4 .os4-note{margin-top:12px;font-size:.9375rem;font-weight:600;line-height:1.2;color:var(--muted)}
.cf-one-step-order-4 .os4-alert{margin-top:20px;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-one-step-order-4 .os4-action{margin-top:24px}
.cf-one-step-order-4 .os4-btn{appearance:none;margin:0;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:72px;min-width:min(100%,26rem);max-width:100%;padding:12px 28px;border:1px solid transparent;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display));color:var(--os4-btn-ink);background:linear-gradient(oklch(from var(--os4-btn) calc(l + .04) c h),oklch(from var(--os4-btn-2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--os4-btn) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--os4-btn) calc(l - .16) c h),0 1px 2px oklch(from var(--os4-sh) l c h / .3),0 8px 16px -6px oklch(from var(--os4-sh) l c h / .45));text-shadow:var(--button-text-shadow,none);cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-one-step-order-4 .os4-btn:not(:disabled):not(.is-waiting):hover,.cf-one-step-order-4 .os4-btn.is-hover:not(.is-waiting){background:linear-gradient(oklch(from var(--os4-btn) calc(l - .01) c h),oklch(from var(--os4-btn-2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--os4-btn) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--os4-btn) calc(l - .2) c h),0 1px 2px oklch(from var(--os4-sh) l c h / .34),0 10px 18px -6px oklch(from var(--os4-sh) l c h / .55);transform:translateY(-1px)}
.cf-one-step-order-4 .os4-btn:not(:disabled):not(.is-waiting):active,.cf-one-step-order-4 .os4-btn.is-press:not(.is-waiting){transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--os4-btn) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--os4-btn) calc(l - .16) c h),0 1px 1px oklch(from var(--os4-sh) l c h / .3)}
.cf-one-step-order-4 .os4-btn:focus-visible{outline:3px solid var(--os4-focus);outline-offset:3px}
.cf-one-step-order-4 .os4-btn.is-waiting,.cf-one-step-order-4 .os4-btn:disabled:not(.is-busy){background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));border-color:var(--button-2-border,transparent);box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(from var(--os4-sh) l c h / .2)));text-shadow:none}
.cf-one-step-order-4 .os4-btn.is-waiting:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .025) c h)}
.cf-one-step-order-4 .os4-btn:disabled{cursor:not-allowed}
.cf-one-step-order-4 .os4-btn.is-busy{cursor:progress}
.cf-one-step-order-4 .os4-main{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 10px;font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);text-transform:var(--button-case,none);line-height:1.15;text-wrap:balance}
.cf-one-step-order-4 .os4-main svg{width:20px;height:20px;flex:none}
.cf-one-step-order-4 .os4-tag{padding:3px 10px;border-radius:999px;background:oklch(from var(--os4-btn-ink) l c h / .14);font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-one-step-order-4 .os4-btn.is-waiting .os4-tag,.cf-one-step-order-4 .os4-btn:disabled:not(.is-busy) .os4-tag{background:oklch(from var(--button-2-ink,var(--secondary-ink)) l c h / .1)}
.cf-one-step-order-4 .os4-subline{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:4px 8px;font-family:var(--font-body);font-size:.9375rem;font-weight:600;line-height:1.3;text-transform:none;text-wrap:pretty}
.cf-one-step-order-4 .os4-dots{display:inline-flex;gap:4px}
.cf-one-step-order-4 .os4-dots i{display:block;width:8px;height:8px;border-radius:50%;border:1.5px solid currentColor;opacity:.55}
.cf-one-step-order-4 .os4-dots i.is-done{background:currentColor;opacity:1}
.cf-one-step-order-4 .os4-guarantee{margin-top:16px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-one-step-order-4 .os4-guarantee svg{color:var(--success)}
.cf-one-step-order-4 .os4-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media (prefers-reduced-motion:no-preference){
.cf-one-step-order-4 .os4-rise{animation:os4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.cf-one-step-order-4 .os4-btn{transition:transform .16s ease,box-shadow .16s ease,background .16s ease,color .16s ease}
.cf-one-step-order-4 .os4-btn.is-ready{animation:os4-pop .3s cubic-bezier(.2,.7,.2,1)}
.cf-one-step-order-4 .os4-spin{animation:os4-spin .8s linear infinite}
}
@keyframes os4-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes os4-pop{from{transform:scale(.96)}}
@keyframes os4-spin{to{transform:rotate(360deg)}}
@media (max-width:560px){
.cf-one-step-order-4{padding-inline:18px}
.cf-one-step-order-4 .os4-grid-contact{grid-template-columns:minmax(0,1fr)}
.cf-one-step-order-4 .os4-scene img{aspect-ratio:4/3}
.cf-one-step-order-4 .os4-btn{display:flex;width:100%;min-width:0;padding-inline:20px}
.cf-one-step-order-4 .os4-bump-price{margin-left:38px}
.cf-one-step-order-4 .os4-thumb{width:52px;height:52px}
}
@media (forced-colors:active){
.cf-one-step-order-4 .os4-btn,.cf-one-step-order-4 .os4-bump,.cf-one-step-order-4 .os4-well{border:1px solid CanvasText}
}
`
pieces/checkout/one-step-order-4/specimen.tsx 62 lines
import __studioImage31979a4f from "../assets/64d473813d989232.webp";
import __studioImagef31ccefc from "../assets/33c697ebfc7cde87.webp";
import __studioImage9cb898f9 from "../assets/468365fbdee945ff.webp";
import * as React from 'react'
import { OneStepOrder4, type OneStepOrder4State } from '../one-step-order-4'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function OneStepOrder4Specimen({ state = 'default' }: { state?: OneStepOrder4State }) {
const sample = defaults.sample
return (
<OneStepOrder4
state={state}
headline='Reset your sleep in five short mornings'
highlight='five short mornings'
sceneImage={slot('scene', __studioImage31979a4f)}
sceneImageAlt='A woman stretching as she wakes in a sunlit bedroom'
caption='The goal for your mornings: up with the light, not dragged out of bed by an alarm.'
salutation='Dear friend,'
paragraphs={[
{
subhead: 'You’re not bad at sleeping',
leadIn: 'If you’re reading this at midnight,',
body: 'you already know the routine. Phone down, eyes shut, and your mind replays tomorrow’s to-do list until the clock says 2 a.m.',
},
{
subhead: 'The fix starts when you wake up',
leadIn: 'Here’s the turn:',
body: 'your body sets tonight’s sleep in the first hour after you get up, not the last hour before bed. Change the morning and the night gets easier.',
},
{
subhead: 'Five audios, twelve minutes each',
leadIn: 'That’s why I made the 5-Day Sleep Reset.',
body: 'Each morning you press play on one short guided audio while the kettle boils. By day five you have a simple routine that’s yours to keep.',
},
]}
productName='The 5-Day Sleep Reset'
productImage={slot('product', __studioImagef31ccefc)}
productImageAlt='The 5-Day Sleep Reset audio program on a phone beside headphones'
productCaption='Five guided morning audios, yours to keep.'
closing='To your first good night,'
authorName='Maya Collins'
authorRole='Sleep coach, creator of the 5-Day Sleep Reset'
presenterImage={slot('presenter', __studioImage9cb898f9)}
presenterImageAlt='Maya Collins'
formTitle='Start your reset tomorrow morning'
formLead='Fill in the five fields below. Your button lights up the moment your order is ready.'
price={sample.price}
bump={{
title: 'Yes! Add the Deep Sleep Soundscapes',
summaryName: 'Deep Sleep Soundscapes',
price: '$17',
body: 'Eight 30-minute soundscapes to play as you drift off, delivered with your reset.',
}}
label='Add To Cart'
sublabel={sample.sublabel}
guarantee={sample.guarantee}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalOneStepOrder4 |
Partial<OneStepOrder4Copy> |
|
onSubmit OptionalOneStepOrder4 |
(values: Readonly<OneStepOrder4Values>, bumpSelected: boolean) => void | Promise<void> |
|
headline OptionalOneStepOrder4 |
string |
Default 'Build your first funnel with a clear plan'
|
highlight OptionalOneStepOrder4 |
string |
Default 'clear plan'
|
sceneImage OptionalOneStepOrder4 |
string |
|
sceneImageAlt OptionalOneStepOrder4 |
string |
Default ''
|
caption OptionalOneStepOrder4 |
string |
|
salutation OptionalOneStepOrder4 |
string |
Default 'Dear friend,'
|
paragraphs OptionalOneStepOrder4 |
OneStepOrder4Paragraph[] |
Default DEFAULT_PARAGRAPHS
|
productName OptionalOneStepOrder4 |
string |
Default 'The Funnel Starter Kit'
|
productImage OptionalOneStepOrder4 |
string |
|
productImageAlt OptionalOneStepOrder4 |
string |
Default ''
|
productCaption OptionalOneStepOrder4 |
string |
|
closing OptionalOneStepOrder4 |
string |
Default 'To your first launch,'
|
authorName OptionalOneStepOrder4 |
string |
|
authorRole OptionalOneStepOrder4 |
string |
|
presenterImage OptionalOneStepOrder4 |
string |
|
presenterImageAlt OptionalOneStepOrder4 |
string |
Default ''
|
formTitle OptionalOneStepOrder4 |
string |
Default 'Start building your funnel today'
|
formLead OptionalOneStepOrder4 |
string |
Default 'Fill in the five fields below. Your button lights up the moment your order is ready.'
|
price OptionalOneStepOrder4 |
string |
Default '$47'
|
bump OptionalOneStepOrder4 |
OneStepOrder4Bump | null |
Default null
|
networks OptionalOneStepOrder4 |
OneStepOrder4Network[] |
Default ['visa', 'mastercard', 'amex', 'discover']
|
label OptionalOneStepOrder4 |
string |
Default 'Add To Cart'
|
sublabel OptionalOneStepOrder4 |
string |
Default 'Secure checkout · Instant access'
|
guarantee OptionalOneStepOrder4 |
string |
Default '30-day money-back guarantee'
|
errorMessage OptionalOneStepOrder4 |
string |
Default 'Please fix the highlighted fields to finish your order.'
|
disabledMessage OptionalOneStepOrder4 |
string |
Default 'Checkout is unavailable right now.'
|
state OptionalOneStepOrder4 |
OneStepOrder4State |
Default 'default'
|
disabled OptionalOneStepOrder4 |
boolean |
Default false
|
className OptionalOneStepOrder4 |
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-border--button-2-ink--button-2-shadow- Secondary button.
--card-radius- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- 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- A photo of the host, coach or founder.
product- The main product shot or cover (ebook, kit, bottle).
scene- A wide atmosphere photo behind or beside the copy.
-
33c697ebfc7cde87.webp
image/webp · 43.2 KB
-
468365fbdee945ff.webp
image/webp · 38.5 KB
-
64d473813d989232.webp
image/webp · 45.4 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB