One Step Order 3
Bento one-step checkout for an annual plan. One dominant order card sets today's price beside what the alternative costs, and the promise, app graphic, inclusions and guarantee tiles frame it.
Use it in a prompt
Use checkout/one-step-order-3 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-3.tsx. - Import it and pass your copy and images (Props tab):
import { OneStepOrder3 } from "@/components/funneldna/checkout/one-step-order-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/one-step-order-3/component.tsx 574 lines
// layout: split-contrast
// Bento one-step checkout for an annual plan. One dominant order card sets today's price beside what the alternative costs, and the promise, app graphic, inclusions and guarantee tiles frame it.
'use client'
import * as React from 'react'
import { AlertCircle, Check, CreditCard, Loader2, Lock } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
import { FX_HOST, Pattern, Spot } from '../fx/fx'
import chart from '../fx/spots/chart'
export type OneStepOrder3State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type OneStepOrder3Network = 'visa' | 'mastercard' | 'amex' | 'discover'
export type OneStepOrder3Values = { email: string; name: string; card: string; exp: string; cvc: string }
type Field = keyof OneStepOrder3Values
type Errors = Partial<Record<Field, string>>
type Touched = Partial<Record<Field, boolean>>
const ORDER_COPY = {
emailLabel: 'Email address',
emailPlaceholder: 'you@example.com',
nameLabel: 'Name on card',
namePlaceholder: 'Jane Smith',
cardLabel: 'Card number',
cardPlaceholder: '1234 1234 1234 1234',
expLabel: 'Expiry',
expPlaceholder: 'MM / YY',
cvcLabel: 'Security code',
cvcPlaceholder: '123',
emailError: 'Enter a valid email address.',
nameError: 'Enter the name on your card.',
cardError: 'Check your card number.',
unsupportedError: 'We can’t take this card type. Try another card.',
expError: 'Enter a valid expiry date.',
cvcError: 'Enter the {digits}-digit code on your card.',
networksLabel: 'Cards we accept',
detectedLabel: '{brand} card detected',
vsLabel: 'vs',
invalidHint: 'Complete the fields above to continue.',
loadingLabel: 'Starting your plan…',
}
export type OneStepOrder3Copy = typeof ORDER_COPY
export type OneStepOrder3Props = {
/** Supporting labels, placeholders and validation copy. {digits} and {brand} are replaced as text. */
copy?: Partial<OneStepOrder3Copy>
/** Receives the validated local values. The block never sends or charges anything. A returned promise shows the loading label; a rejection shows errorMessage. */
onSubmit?: (values: Readonly<OneStepOrder3Values>) => void | Promise<void>
/** Starting field values, for example a prefilled email. */
defaultValues?: Partial<OneStepOrder3Values>
/** The promise in one line. */
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke. */
highlight?: string
lead?: string
/** Used as the label over today's price when priceLabel is empty. */
productName?: string
/** Slot product: the app screen graphic, ideally on a transparent background. Hidden on phones. */
productImage?: string
productImageAlt?: string
/** Caption under the app graphic. */
productCaption?: string
/** Red subhead over what the plan includes. */
includesTitle?: string
/** Four short inclusions work best. */
includes?: string[]
/** The question the button answers. */
formQuestion?: string
/** Accessible name of the form fields group. */
formTitle?: string
/** The supplied alternative, for example a part-time bookkeeper. Leave alternativePrice empty to show today's price alone. */
alternativeLabel?: string
alternativePrice?: string
/** Unit after the alternative's price, for example a year. */
alternativeUnit?: string
/** Label over today's price, for example the plan name. */
priceLabel?: string
price?: string
/** Line under today's price. */
priceLine?: string
/** Small line under the comparison. Only true terms. */
priceNote?: string
/** Only list the networks the real processor accepts. */
networks?: OneStepOrder3Network[]
label?: string
/** Reassurance line under the button. */
sublabel?: string
/** Red subhead of the guarantee tile. */
guaranteeTitle?: string
guaranteeText?: string
/** Phrase inside guaranteeText set in bold. */
guaranteeEmphasis?: string
/** Slot seal-guarantee: transparent seal art. */
sealGuaranteeImage?: string
sealGuaranteeImageAlt?: string
errorMessage?: string
disabledMessage?: string
state?: OneStepOrder3State
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[] = ['email', 'name', 'card', 'exp', 'cvc']
const EMPTY: OneStepOrder3Values = { email: '', name: '', card: '', exp: '', cvc: '' }
const ERROR_PREFILL: OneStepOrder3Values = { email: 'dana@example', name: 'Dana Ruiz', card: '4242 4242 4242 4241', exp: '13 / 24', cvc: '12' }
const ALL_TOUCHED: Touched = { email: true, name: true, card: true, exp: true, cvc: true }
export function OneStepOrder3({
copy: copyOverrides,
onSubmit,
defaultValues,
headline = 'Get your whole year set up in one step',
highlight = 'in one step',
lead = 'Start today and have everything running in minutes.',
productName = 'Annual plan',
productImage,
productImageAlt = '',
productCaption,
includesTitle = 'Everything in your plan',
includes = [],
formQuestion = 'Ready to get started?',
formTitle = 'Your order details',
alternativeLabel,
alternativePrice,
alternativeUnit = 'a year',
priceLabel,
price = '$47',
priceLine = 'today. That’s it.',
priceNote,
networks = ['visa', 'mastercard', 'amex', 'discover'],
label = 'I’m Ready, Start My Plan',
sublabel = 'Secure checkout',
guaranteeTitle,
guaranteeText,
guaranteeEmphasis,
sealGuaranteeImage,
sealGuaranteeImageAlt = '',
errorMessage = 'We couldn’t start your plan. Please try again.',
disabledMessage = 'Checkout is unavailable right now.',
state = 'default',
disabled = false,
className,
}: OneStepOrder3Props) {
const copy = { ...ORDER_COPY, ...Object.fromEntries(Object.entries(copyOverrides ?? {}).filter(([, v]) => v !== undefined)) } as OneStepOrder3Copy
const uid = 'os3' + React.useId().replace(/[^a-zA-Z0-9]/g, '')
const startValues = (): OneStepOrder3Values => (state === 'error' ? { ...ERROR_PREFILL } : { ...EMPTY, ...defaultValues })
const [values, setValues] = React.useState<OneStepOrder3Values>(startValues)
const [touched, setTouched] = React.useState<Touched>(() => (state === 'error' ? { ...ALL_TOUCHED } : {}))
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const request = React.useRef(0)
const mounted = React.useRef(false)
const cardRef = React.useRef<HTMLInputElement | null>(null)
const caret = React.useRef<number | null>(null)
React.useEffect(() => {
if (!mounted.current) {
mounted.current = true
return
}
request.current++
setValues(startValues())
setTouched(state === 'error' ? { ...ALL_TOUCHED } : {})
setBusy(false)
setFailed(false)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
React.useEffect(() => () => { request.current++ }, [])
React.useLayoutEffect(() => {
const el = cardRef.current
const want = caret.current
caret.current = null
if (!el || want === null || document.activeElement !== el) return
let i = 0
let seen = 0
while (i < el.value.length && seen < want) {
if (el.value[i] >= '0' && el.value[i] <= '9') seen++
i++
}
el.setSelectionRange(i, i)
}, [values.card])
const isDisabled = disabled || state === 'disabled'
const live = validate(values, copy, networks)
const valid = FIELDS.every(f => !live[f])
const shown = (f: Field) => (touched[f] ? live[f] : undefined)
const anyShown = FIELDS.some(f => Boolean(shown(f)))
const detected = detectBrand(onlyDigits(values.card))
const brand = detected && networks.includes(detected) ? detected : null
const BrandIcon = brand ? NETS[brand].Icon : null
const canSubmit = valid && !isDisabled && !busy
const forced = state === 'hover' ? 'is-hover' : state === 'active' ? 'is-active' : null
const hasApp = Boolean(productImage)
const hasIncl = includes.length > 0
const hasSeal = Boolean(guaranteeTitle || guaranteeText)
const left = ['p p p p p p p', hasApp && hasIncl ? 'a a a i i i i' : hasApp ? 'a a a a a a a' : hasIncl ? 'i i i i i i i' : '', hasSeal ? 's s s s s s s' : ''].filter(Boolean)
const gridStyle = {
'--os3-areas-lg': left.map(r => quote(r + ' f f f f f')).join(' '),
'--os3-rows-lg': left.map((_, i) => (i === 0 ? '1fr' : 'auto')).join(' '),
'--os3-areas-md': ['p p', 'f f', hasApp && hasIncl ? 'a i' : hasApp ? 'a a' : hasIncl ? 'i i' : '', hasSeal ? 's s' : ''].filter(Boolean).map(quote).join(' '),
'--os3-areas-sm': ['p', 'f', hasIncl ? 'i' : '', hasApp ? 'a' : '', hasSeal ? 's' : ''].filter(Boolean).map(quote).join(' '),
} as React.CSSProperties
function update(f: Field, raw: string) {
let v = raw
if (f === 'card') v = formatCard(raw)
else if (f === 'exp') v = formatExp(raw)
else if (f === 'cvc') v = onlyDigits(raw).slice(0, 4)
setValues(p => ({ ...p, [f]: v }))
if (failed) setFailed(false)
}
function onCard(e: React.ChangeEvent<HTMLInputElement>) {
const el = e.target
const pos = el.selectionStart ?? el.value.length
caret.current = onlyDigits(el.value.slice(0, pos)).length
update('card', el.value)
}
function blur(f: Field) {
setTouched(p => (p[f] ? p : { ...p, [f]: true }))
}
async function handleSubmit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault()
if (!canSubmit) {
setTouched({ ...ALL_TOUCHED })
return
}
setFailed(false)
if (!onSubmit) return
const id = ++request.current
try {
const result = onSubmit({ ...values })
if (!result) return
setBusy(true)
await result
} catch {
if (id === request.current) setFailed(true)
} finally {
if (id === request.current) setBusy(false)
}
}
const field = (f: Field, o: { label: string; placeholder: string; autoComplete: string; type?: string; inputMode?: 'text' | 'email' | 'numeric'; extra?: React.ReactNode; trailing?: React.ReactNode; live?: React.ReactNode }) => {
const id = `${uid}-${f}`
const eid = `${id}-err`
const err = shown(f)
return (
<div className='os3-field'>
<div className='os3-label-row'>
<label className='os3-label' htmlFor={id}>{o.label}</label>
{o.extra}
</div>
<div className='os3-control'>
<input
id={id}
ref={f === 'card' ? cardRef : undefined}
className={cx('os3-input', o.trailing ? 'has-trail' : null, err ? 'is-invalid' : null)}
name={f}
type={o.type ?? 'text'}
autoComplete={o.autoComplete}
inputMode={o.inputMode}
placeholder={o.placeholder}
value={values[f]}
onChange={f === 'card' ? onCard : e => update(f, e.target.value)}
onBlur={() => blur(f)}
spellCheck={false}
aria-required='true'
aria-invalid={err ? true : undefined}
aria-describedby={err ? eid : undefined}
/>
{o.trailing}
</div>
{o.live}
{err ? <p id={eid} className='os3-err'><AlertCircle className='os3-inline' size={16} strokeWidth={2.5} aria-hidden='true' />{err}</p> : null}
</div>
)
}
const nets = (
<ul className='os3-nets' aria-label={copy.networksLabel}>
{networks.map(n => {
const { name, Icon } = NETS[n]
return <li key={n} className={cx('os3-net', brand && brand !== n ? 'is-dim' : null)}><Icon aria-hidden /><span className='os3-sr'>{name}</span></li>
})}
</ul>
)
const note = !valid && anyShown && !isDisabled
? copy.invalidHint
: sublabel ? <><Lock className='os3-inline' size={16} strokeWidth={2.5} aria-hidden='true' />{sublabel}</> : null
return (
<section className={cx('cf-one-step-order-3', className)} style={FX_HOST} aria-labelledby={`${uid}-title`}>
<style>{CSS}</style>
<Pattern name='grid' fade='edges' />
<div className='os3-wrap'>
<div className='os3-grid' style={gridStyle}>
<div className='os3-tile os3-promise' style={delay(0)}>
<h2 id={`${uid}-title`} className='os3-h2'>{withPhrase(headline, highlight, p => <span className='os3-mark'>{p}</span>)}</h2>
<div className='os3-foot'>
{lead ? <p className='os3-lead'>{lead}</p> : <span />}
<span className='os3-spot'><Spot src={chart} size={88} shade='band' light='band-ink' /></span>
</div>
</div>
<form className='os3-tile os3-form' style={delay(1)} onSubmit={handleSubmit} noValidate aria-labelledby={`${uid}-q`}>
<h3 id={`${uid}-q`} className='os3-q'>{formQuestion}</h3>
<div className={cx('os3-anchor', alternativePrice ? null : 'is-solo')}>
{alternativePrice ? (
<div className='os3-half os3-alt'>
{alternativeLabel ? <span className='os3-half-label'>{alternativeLabel}</span> : null}
<span className='os3-alt-price'>{alternativePrice}</span>
{alternativeUnit ? <span className='os3-half-unit'>{alternativeUnit}</span> : null}
</div>
) : null}
{alternativePrice ? <span className='os3-vs'>{copy.vsLabel}</span> : null}
<div className='os3-half os3-now'>
<span className='os3-half-label'>{priceLabel ?? productName}</span>
<span className='os3-now-price'>{price}</span>
{priceLine ? <span className='os3-half-unit is-strong'>{priceLine}</span> : null}
</div>
</div>
{priceNote ? <p className='os3-pnote'>{priceNote}</p> : null}
<fieldset className='os3-fields' disabled={isDisabled || busy}>
<legend className='os3-sr'>{formTitle}</legend>
{field('email', { label: copy.emailLabel, placeholder: copy.emailPlaceholder, autoComplete: 'email', type: 'email', inputMode: 'email' })}
{field('name', { label: copy.nameLabel, placeholder: copy.namePlaceholder, autoComplete: 'cc-name' })}
{field('card', {
label: copy.cardLabel,
placeholder: copy.cardPlaceholder,
autoComplete: 'cc-number',
inputMode: 'numeric',
extra: nets,
trailing: (
<span className='os3-brand' aria-hidden='true'>
{BrandIcon && brand
? <span key={brand} className='os3-pop'><BrandIcon aria-hidden /></span>
: <span key='none' className='os3-pop is-generic'><CreditCard size={20} strokeWidth={2.5} /></span>}
</span>
),
live: <span className='os3-sr' aria-live='polite'>{brand ? copy.detectedLabel.replace('{brand}', NETS[brand].name) : ''}</span>,
})}
<div className='os3-row'>
{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>
</fieldset>
{isDisabled ? <p className='os3-notice' role='status'><AlertCircle className='os3-inline' size={16} strokeWidth={2.5} aria-hidden='true' />{disabledMessage}</p> : null}
{failed ? <p className='os3-fail' role='alert'><AlertCircle className='os3-inline' size={16} strokeWidth={2.5} aria-hidden='true' />{errorMessage}</p> : null}
<button type='submit' className={cx('os3-btn', forced, busy ? 'is-busy' : null)} disabled={!canSubmit} aria-busy={busy || undefined} aria-describedby={note ? `${uid}-note` : undefined}>
{busy ? <><Loader2 className='os3-spin' size={20} strokeWidth={2.5} aria-hidden='true' />{copy.loadingLabel}</> : label}
</button>
{note ? <p id={`${uid}-note`} className='os3-note'>{note}</p> : null}
</form>
{hasApp ? (
<figure className='os3-tile os3-app' style={delay(2)}>
<div className='os3-shot'><img src={productImage} alt={productImageAlt} loading='lazy' decoding='async' /></div>
{productCaption ? <figcaption>{productCaption}</figcaption> : null}
</figure>
) : null}
{hasIncl ? (
<div className='os3-tile os3-card os3-incl' style={delay(3)}>
<h3 className='os3-subhead'>{includesTitle}</h3>
<ul className='os3-ticks'>
{includes.map((item, i) => (
<li key={i}><span className='os3-badge' aria-hidden='true'><Check size={14} strokeWidth={3} /></span><span>{item}</span></li>
))}
</ul>
</div>
) : null}
{hasSeal ? (
<div className={cx('os3-tile os3-card os3-seal', sealGuaranteeImage ? null : 'no-img')} style={delay(4)}>
{sealGuaranteeImage ? <img className='os3-seal-img' src={sealGuaranteeImage} alt={sealGuaranteeImageAlt} width={104} height={104} loading='lazy' decoding='async' /> : null}
{guaranteeTitle ? <h3 className='os3-subhead os3-seal-head'>{guaranteeTitle}</h3> : null}
{guaranteeText ? <p className='os3-seal-text'>{withPhrase(guaranteeText, guaranteeEmphasis, p => <strong>{p}</strong>)}</p> : null}
</div>
) : null}
</div>
</div>
</section>
)
}
export default OneStepOrder3
function cx(...parts: (string | false | null | undefined)[]) {
return parts.filter(Boolean).join(' ')
}
function quote(row: string) {
return '"' + row + '"'
}
function delay(i: number) {
return { '--i': Math.min(i, 4) } as React.CSSProperties
}
function withPhrase(text: string, phrase: string | undefined, render: (p: string) => React.ReactNode) {
const i = phrase ? text.indexOf(phrase) : -1
if (!phrase || i < 0) return text
return <>{text.slice(0, i)}{render(phrase)}{text.slice(i + phrase.length)}</>
}
function onlyDigits(s: string) {
return s.replace(/\D/g, '')
}
function detectBrand(d: string): OneStepOrder3Network | null {
if (/^4/.test(d)) return 'visa'
if (/^(5[1-5]|222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)/.test(d)) return 'mastercard'
if (/^3[47]/.test(d)) return 'amex'
if (/^(6011|65|64[4-9]|622)/.test(d)) return 'discover'
return null
}
function formatCard(raw: string) {
const all = onlyDigits(raw)
const brand = detectBrand(all)
const d = all.slice(0, brand === 'amex' ? 15 : 16)
const groups = brand === 'amex' ? [4, 6, 5] : [4, 4, 4, 4]
const out: string[] = []
let i = 0
for (const g of groups) {
if (i >= d.length) break
out.push(d.slice(i, i + g))
i += g
}
return out.join(' ')
}
function formatExp(raw: string) {
let d = onlyDigits(raw).slice(0, 4)
if (d.length === 1 && Number(d) > 1) d = '0' + d
return d.length > 2 ? `${d.slice(0, 2)} / ${d.slice(2)}` : d
}
function luhn(d: string) {
let sum = 0
for (let i = 0; i < d.length; i++) {
let n = Number(d[d.length - 1 - i])
if (i % 2) {
n *= 2
if (n > 9) n -= 9
}
sum += n
}
return d.length > 0 && sum % 10 === 0
}
function validExp(s: string) {
const m = /^(\d{2}) \/ (\d{2})$/.exec(s)
if (!m) return false
const month = Number(m[1])
const year = 2000 + Number(m[2])
if (month < 1 || month > 12) return false
const now = new Date()
return year > now.getFullYear() || (year === now.getFullYear() && month >= now.getMonth() + 1)
}
function validate(v: OneStepOrder3Values, copy: OneStepOrder3Copy, networks: OneStepOrder3Network[]): Errors {
const e: Errors = {}
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v.email.trim())) e.email = copy.emailError
if (v.name.trim().length < 2) e.name = copy.nameError
const d = onlyDigits(v.card)
const brand = detectBrand(d)
if (brand && !networks.includes(brand)) e.card = copy.unsupportedError
else if (!brand || d.length !== (brand === 'amex' ? 15 : 16) || !luhn(d)) e.card = copy.cardError
if (!validExp(v.exp)) e.exp = copy.expError
const need = brand === 'amex' ? 4 : 3
if (v.cvc.length !== need) e.cvc = copy.cvcError.replace('{digits}', String(need))
return e
}
const CSS = `
.cf-one-step-order-3{--os3-ink:var(--ink,#1b2232);--os3-card:var(--card,#ffffff);--os3-cta:var(--button-bg,var(--cta,#d63a2f));--os3-shadow:var(--shadow,oklch(0.22 0.03 256));--os3-subhead:color-mix(in oklab,var(--os3-cta) 50%,var(--os3-ink));--os3-marker:var(--marker,#fae37c);--os3-radius:var(--card-radius,var(--radius,14px));--os3-sh-sm:var(--shadow-sm,0 1px 1px oklch(from var(--os3-shadow) l c h / .18),0 1px 3px oklch(from var(--os3-shadow) l c h / .14));--os3-sh-md:var(--shadow-md,0 1px 2px oklch(from var(--os3-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--os3-shadow) l c h / .2));--os3-sh-lg:var(--shadow-lg,0 2px 4px oklch(from var(--os3-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--os3-shadow) l c h / .32));position:relative;isolation:isolate;overflow-x:clip;background:var(--surface,#ffffff);color:var(--os3-ink);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-step-order-3 *,.cf-one-step-order-3 *::before,.cf-one-step-order-3 *::after{box-sizing:border-box}
.cf-one-step-order-3 :where(h2,h3,p,ul,figure,fieldset){margin:0}
.cf-one-step-order-3 :where(ul){padding:0;list-style:none}
.cf-one-step-order-3 .os3-wrap{position:relative;z-index:1;max-width:1120px;margin-inline:auto}
.cf-one-step-order-3 .os3-grid{display:grid;gap:16px;grid-template-columns:repeat(12,minmax(0,1fr));grid-template-areas:var(--os3-areas-lg);grid-template-rows:var(--os3-rows-lg)}
.cf-one-step-order-3 .os3-tile{position:relative;min-width:0;border-radius:var(--os3-radius);padding:clamp(20px,3vw,32px);animation:os3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
.cf-one-step-order-3 .os3-card{background:var(--os3-card);border:1px solid var(--card-border,oklch(from var(--os3-ink) l c h / .12));box-shadow:var(--card-shadow,var(--os3-sh-md))}
.cf-one-step-order-3 .os3-promise{grid-area:p;display:flex;flex-direction:column;justify-content:space-between;gap:24px;background:var(--band,#1d2a44);color:var(--band-ink,#ffffff);box-shadow:inset 0 1px 0 oklch(from var(--band,#1d2a44) calc(l + .1) c h / .9),var(--os3-sh-md)}
.cf-one-step-order-3 .os3-h2{font-family:var(--font-display,inherit);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:inherit}
.cf-one-step-order-3 .os3-mark{color:var(--field-ink,#1b2232);background:linear-gradient(176deg,transparent 12%,var(--os3-marker) 12%,var(--os3-marker) 92%,transparent 92%);padding:0 .14em;margin:0 -.06em;border-radius:.12em .3em .16em .28em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-one-step-order-3 .os3-foot{display:flex;align-items:flex-end;justify-content:space-between;gap:24px}
.cf-one-step-order-3 .os3-lead{font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;max-width:46ch;text-wrap:pretty;color:inherit}
.cf-one-step-order-3 .os3-spot{flex:none;line-height:0}
.cf-one-step-order-3 .os3-form{grid-area:f;z-index:1;display:flex;flex-direction:column;background:var(--os3-card);border:1px solid color-mix(in oklch,var(--accent,#2a62c9) 30%,var(--os3-card));box-shadow:var(--os3-sh-lg)}
.cf-one-step-order-3 .os3-q{font-family:var(--font-display,inherit);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(--os3-ink);margin-bottom:16px}
.cf-one-step-order-3 .os3-anchor{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.cf-one-step-order-3 .os3-anchor.is-solo{grid-template-columns:minmax(0,1fr)}
.cf-one-step-order-3 .os3-half{display:flex;flex-direction:column;gap:4px;min-width:0;padding:16px 18px;border-radius:10px}
.cf-one-step-order-3 .os3-alt{background:color-mix(in oklch,var(--os3-ink) 6%,var(--os3-card));color:var(--os3-ink)}
.cf-one-step-order-3 .os3-now{background:var(--accent-fill,var(--accent,#2a62c9));color:var(--accent-fill-ink,var(--os3-card));box-shadow:inset 0 1px 0 oklch(from var(--accent-fill,var(--accent,#2a62c9)) calc(l + .1) c h / .7)}
.cf-one-step-order-3 .os3-half-label{font-size:15px;line-height:1.3;font-weight:700;text-wrap:pretty}
.cf-one-step-order-3 .os3-alt-price{margin-top:auto;padding-top:8px;font-family:var(--font-display,inherit);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.1;letter-spacing:-0.02em;font-variant-numeric:tabular-nums;color:var(--muted,#55607a)}
.cf-one-step-order-3 .os3-now-price{margin-top:auto;padding-top:4px;font-family:var(--font-display,inherit);font-weight:800;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-one-step-order-3 .os3-half-unit{font-size:15px;line-height:1.35;font-weight:600;text-wrap:balance}
.cf-one-step-order-3 .os3-half-unit.is-strong{margin-top:12px;font-weight:800}
.cf-one-step-order-3 .os3-vs{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;place-items:center;min-width:34px;height:28px;padding:0 8px;border-radius:999px;background:var(--os3-card);color:var(--os3-ink);font-size:14px;font-weight:800;line-height:1;box-shadow:var(--os3-sh-sm);pointer-events:none}
.cf-one-step-order-3 .os3-pnote{margin-top:12px;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted,#55607a);text-wrap:pretty}
.cf-one-step-order-3 .os3-fields{display:grid;gap:16px;min-width:0;margin-top:24px;padding:0;border:0}
.cf-one-step-order-3 .os3-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.cf-one-step-order-3 .os3-field{min-width:0}
.cf-one-step-order-3 .os3-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:24px;margin-bottom:8px}
.cf-one-step-order-3 .os3-label{font-size:16px;font-weight:700;line-height:1.25;color:var(--label-ink,var(--os3-ink))}
.cf-one-step-order-3 .os3-control{position:relative}
.cf-one-step-order-3 .os3-input{display:block;width:100%;height:56px;padding:0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--os3-ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field,#ffffff);color:var(--field-ink,#1b2232);font-family:var(--font-body,inherit);font-size:17px;font-weight:500;font-variant-numeric:tabular-nums;outline:none;-webkit-appearance:none;appearance:none;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}
.cf-one-step-order-3 .os3-input.has-trail{padding-right:68px}
.cf-one-step-order-3 .os3-input::placeholder{color:color-mix(in oklch,var(--field-ink,#1b2232) 65%,var(--field,#ffffff));opacity:1}
@media (hover:hover){.cf-one-step-order-3 .os3-input:hover:not(:disabled):not(:focus){border-color:color-mix(in oklch,var(--field-ink,#1b2232) 45%,var(--field,#ffffff))}}
.cf-one-step-order-3 .os3-input:focus{border-color:var(--field-focus,var(--accent,#2a62c9));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2a62c9)) l c h / .35)}
.cf-one-step-order-3 .os3-input.is-invalid{border-color:var(--danger,#c0362c)}
.cf-one-step-order-3 .os3-input.is-invalid:focus{box-shadow:0 0 0 3px oklch(from var(--danger,#c0362c) l c h / .3)}
.cf-one-step-order-3 .os3-input:disabled{background:color-mix(in oklch,var(--field-ink,#1b2232) 5%,var(--field,#ffffff));cursor:not-allowed}
.cf-one-step-order-3 .os3-brand{position:absolute;right:12px;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:46px;height:32px;pointer-events:none}
.cf-one-step-order-3 .os3-pop{display:flex;align-items:center;justify-content:center;animation:os3-pop .3s cubic-bezier(.2,.7,.2,1) both}
.cf-one-step-order-3 .os3-pop svg{display:block;width:44px;height:auto}
.cf-one-step-order-3 .os3-pop.is-generic svg{width:22px;height:22px;color:color-mix(in oklch,var(--field-ink,#1b2232) 60%,var(--field,#ffffff))}
.cf-one-step-order-3 .os3-nets{display:flex;align-items:center;gap:4px}
.cf-one-step-order-3 .os3-net{display:flex;line-height:0;transition:opacity .16s ease,filter .16s ease}
.cf-one-step-order-3 .os3-net svg{display:block;width:30px;height:auto}
.cf-one-step-order-3 .os3-net.is-dim{opacity:.3;filter:grayscale(1)}
.cf-one-step-order-3 .os3-err{margin-top:8px;font-size:15px;line-height:1.35;font-weight:600;color:var(--danger,#c0362c);text-wrap:pretty}
.cf-one-step-order-3 .os3-inline{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-one-step-order-3 .os3-notice,.cf-one-step-order-3 .os3-fail{margin-top:16px;padding:12px 16px;border-radius:10px;font-size:15px;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-one-step-order-3 .os3-notice{background:var(--warning-soft,#f6efd9);color:var(--warning,#7a5b00)}
.cf-one-step-order-3 .os3-fail{background:var(--danger-soft,#f7e3e1);color:var(--danger,#c0362c)}
.cf-one-step-order-3 .os3-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:24px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--os3-cta) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--os3-cta))) 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);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--os3-cta) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--os3-cta) calc(l - .16) c h),0 1px 2px oklch(from var(--os3-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--os3-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-one-step-order-3 .os3-btn.is-hover:not(:disabled),.cf-one-step-order-3 .os3-btn:not(:disabled):hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--os3-cta) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--os3-cta))) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--os3-cta) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--os3-cta) calc(l - .2) c h),0 1px 2px oklch(from var(--os3-shadow) l c h / .32),0 12px 20px -8px oklch(from var(--os3-shadow) l c h / .5)}
.cf-one-step-order-3 .os3-btn.is-active:not(:disabled),.cf-one-step-order-3 .os3-btn:not(:disabled):active{transform:translateY(1px);background:linear-gradient(oklch(from var(--os3-cta) calc(l - .06) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--os3-cta))) calc(l - .1) c h));box-shadow:inset 0 2px 4px oklch(from var(--os3-cta) calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from var(--os3-cta) calc(l - .18) c h),0 1px 2px oklch(from var(--os3-shadow) l c h / .28)}
.cf-one-step-order-3 .os3-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2a62c9));outline-offset:3px}
.cf-one-step-order-3 .os3-btn:disabled{background:var(--button-2-bg,var(--secondary,#e7eaf0));color:var(--button-2-ink,var(--secondary-ink,#1b2232));text-shadow:none;box-shadow:none;transform:none;cursor:not-allowed}
.cf-one-step-order-3 .os3-btn.is-busy{background:linear-gradient(oklch(from var(--os3-cta) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--os3-cta))) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#ffffff));text-shadow:var(--button-text-shadow,none);cursor:progress}
.cf-one-step-order-3 .os3-spin{flex:none;animation:os3-spin .8s linear infinite}
.cf-one-step-order-3 .os3-note{margin-top:12px;text-align:center;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted,#55607a);text-wrap:pretty}
.cf-one-step-order-3 .os3-app{grid-area:a;display:flex;flex-direction:column;gap:12px;overflow:hidden;background:color-mix(in oklch,var(--os3-ink) 5%,var(--os3-card));border:1px solid var(--card-border,oklch(from var(--os3-ink) l c h / .12));box-shadow:var(--os3-sh-sm)}
.cf-one-step-order-3 .os3-shot{position:relative;flex:1 1 auto;min-height:220px}
.cf-one-step-order-3 .os3-shot img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--os3-shadow) l c h / .28)) drop-shadow(0 14px 18px oklch(from var(--os3-shadow) l c h / .22))}
.cf-one-step-order-3 .os3-app figcaption{font-size:15px;line-height:1.4;font-weight:600;color:var(--os3-ink);text-align:center;text-wrap:pretty}
.cf-one-step-order-3 .os3-incl{grid-area:i}
.cf-one-step-order-3 .os3-subhead{font-family:var(--font-display,inherit);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(--os3-subhead)}
.cf-one-step-order-3 .os3-ticks{display:grid;gap:12px;margin-top:16px}
.cf-one-step-order-3 .os3-ticks li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:600;color:var(--os3-ink);text-wrap:pretty}
.cf-one-step-order-3 .os3-badge{display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:999px;background:var(--success,#1f7a3f);color:var(--os3-badge-ink,#ffffff)}
.cf-one-step-order-3 .os3-seal{grid-area:s;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"img head" "img body";column-gap:24px;row-gap:8px;align-content:center}
.cf-one-step-order-3 .os3-seal.no-img{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "body"}
.cf-one-step-order-3 .os3-seal-img{grid-area:img;align-self:center;display:block;width:104px;height:104px;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--os3-shadow) l c h / .3)) drop-shadow(0 10px 14px oklch(from var(--os3-shadow) l c h / .2))}
.cf-one-step-order-3 .os3-seal-head{grid-area:head;align-self:end}
.cf-one-step-order-3 .os3-seal-text{grid-area:body;align-self:start;max-width:64ch;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--os3-ink);text-wrap:pretty}
.cf-one-step-order-3 .os3-seal-text strong{font-weight:800}
.cf-one-step-order-3 .os3-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media (max-width:999px){.cf-one-step-order-3 .os3-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:var(--os3-areas-md);grid-template-rows:none}}
@media (max-width:679px){.cf-one-step-order-3 .os3-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:var(--os3-areas-sm)}.cf-one-step-order-3 .os3-spot{display:none}.cf-one-step-order-3 .os3-shot{min-height:200px}.cf-one-step-order-3 .os3-seal:not(.no-img){grid-template-areas:"img head" "body body";column-gap:16px;row-gap:12px}.cf-one-step-order-3 .os3-seal-head{align-self:center}.cf-one-step-order-3 .os3-seal-img{width:72px;height:72px}}
@keyframes os3-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes os3-pop{from{opacity:.6;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes os3-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.cf-one-step-order-3 .os3-tile,.cf-one-step-order-3 .os3-pop,.cf-one-step-order-3 .os3-spin{animation:none}.cf-one-step-order-3 .os3-btn,.cf-one-step-order-3 .os3-input,.cf-one-step-order-3 .os3-net{transition:none}.cf-one-step-order-3 .os3-btn.is-hover,.cf-one-step-order-3 .os3-btn.is-active,.cf-one-step-order-3 .os3-btn:not(:disabled):hover,.cf-one-step-order-3 .os3-btn:not(:disabled):active{transform:none}}
`
pieces/checkout/one-step-order-3/specimen.tsx 44 lines
import __studioImageb251fd8b from "../assets/c2b6593792897bda.webp";
import __studioImage5c554710 from "../assets/7633ed05ba29515e.webp";
import { OneStepOrder3, type OneStepOrder3State } from '../one-step-order-3'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
const SAMPLE_VALUES = { email: 'dana@example.com', name: 'Dana Ruiz', card: '4242 4242 4242 4242', exp: '08 / 29', cvc: '123' }
export default function OneStepOrder3Specimen({ state = 'default' }: { state?: OneStepOrder3State }) {
const guarantee = defaults.sample.guarantee
return (
<OneStepOrder3
state={state}
defaultValues={SAMPLE_VALUES}
headline='Close your books in ten minutes a month'
highlight='ten minutes a month'
lead='Ledgerly matches every bank transaction, files your receipts and hands you a clean monthly report. You just review and approve.'
productName='Ledgerly'
productImage={slot('product', __studioImageb251fd8b)}
productImageAlt='Ledgerly dashboard open on a laptop'
productCaption='Your whole month, reconciled on one screen'
includesTitle='Everything your books need'
includes={['Bank and card matching', 'Receipt capture by phone', 'Monthly profit report', 'Tax-ready year-end export']}
formQuestion='Ready to stop doing your books by hand?'
formTitle='Start your Ledgerly annual plan'
alternativeLabel='A part-time bookkeeper'
alternativePrice='$4,800'
alternativeUnit='a year'
priceLabel='Ledgerly, the whole year'
price='$290'
priceLine='today. That’s it.'
priceNote='One payment covers all 12 months. No setup fee.'
label='I’m Ready, Start My Year'
sublabel='Secure checkout · Set up in minutes'
guaranteeTitle='Try Ledgerly for 30 days, risk free'
guaranteeText={`Run your next month-end on Ledgerly. If it doesn’t save you hours, email us within 30 days for a full refund. That’s our ${guarantee}, no questions asked.`}
guaranteeEmphasis='full refund'
sealGuaranteeImage={slot('seal-guarantee', __studioImage5c554710)}
sealGuaranteeImageAlt={guarantee}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalOneStepOrder3 |
Partial<OneStepOrder3Copy> |
|
onSubmit OptionalOneStepOrder3 |
(values: Readonly<OneStepOrder3Values>) => void | Promise<void> |
|
defaultValues OptionalOneStepOrder3 |
Partial<OneStepOrder3Values> |
|
headline OptionalOneStepOrder3 |
string |
Default 'Get your whole year set up in one step'
|
highlight OptionalOneStepOrder3 |
string |
Default 'in one step'
|
lead OptionalOneStepOrder3 |
string |
Default 'Start today and have everything running in minutes.'
|
productName OptionalOneStepOrder3 |
string |
Default 'Annual plan'
|
productImage OptionalOneStepOrder3 |
string |
|
productImageAlt OptionalOneStepOrder3 |
string |
Default ''
|
productCaption OptionalOneStepOrder3 |
string |
|
includesTitle OptionalOneStepOrder3 |
string |
Default 'Everything in your plan'
|
includes OptionalOneStepOrder3 |
string[] |
Default []
|
formQuestion OptionalOneStepOrder3 |
string |
Default 'Ready to get started?'
|
formTitle OptionalOneStepOrder3 |
string |
Default 'Your order details'
|
alternativeLabel OptionalOneStepOrder3 |
string |
|
alternativePrice OptionalOneStepOrder3 |
string |
|
alternativeUnit OptionalOneStepOrder3 |
string |
Default 'a year'
|
priceLabel OptionalOneStepOrder3 |
string |
|
price OptionalOneStepOrder3 |
string |
Default '$47'
|
priceLine OptionalOneStepOrder3 |
string |
Default 'today. That’s it.'
|
priceNote OptionalOneStepOrder3 |
string |
|
networks OptionalOneStepOrder3 |
OneStepOrder3Network[] |
Default ['visa', 'mastercard', 'amex', 'discover']
|
label OptionalOneStepOrder3 |
string |
Default 'I’m Ready, Start My Plan'
|
sublabel OptionalOneStepOrder3 |
string |
Default 'Secure checkout'
|
guaranteeTitle OptionalOneStepOrder3 |
string |
|
guaranteeText OptionalOneStepOrder3 |
string |
|
guaranteeEmphasis OptionalOneStepOrder3 |
string |
|
sealGuaranteeImage OptionalOneStepOrder3 |
string |
|
sealGuaranteeImageAlt OptionalOneStepOrder3 |
string |
Default ''
|
errorMessage OptionalOneStepOrder3 |
string |
Default 'We couldn’t start your plan. Please try again.'
|
disabledMessage OptionalOneStepOrder3 |
string |
Default 'Checkout is unavailable right now.'
|
state OptionalOneStepOrder3 |
OneStepOrder3State |
Default 'default'
|
disabled OptionalOneStepOrder3 |
boolean |
Default false
|
className OptionalOneStepOrder3 |
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- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-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.
product- The main product shot or cover (ebook, kit, bottle).
seal-guarantee- The money-back guarantee seal, on a transparent background.
-
369bb6f216bb84ab.webp
image/webp · 22.6 KB
-
7633ed05ba29515e.webp
image/webp · 192 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c2b6593792897bda.webp
image/webp · 41.9 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB