Persuasion Rail Checkout 1
Persuasion rail checkout: a numbered three-step order form beside a sticky rail that keeps selling while the buyer types: the product, its outcomes, optional proof, the guarantee and a completion meter.
Use it in a prompt
Use checkout/persuasion-rail-checkout 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/persuasion-rail-checkout.tsx. - Import it and pass your copy and images (Props tab):
import { PersuasionRailCheckout } from "@/components/funneldna/checkout/persuasion-rail-checkout"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/persuasion-rail-checkout/component.tsx 637 lines
// layout: number-rail
// Persuasion rail checkout: a numbered three-step order form beside a sticky rail that keeps selling while the buyer types: the product, its outcomes, optional proof, the guarantee and a completion meter.
import React from 'react';
import { AlertCircle, Check, ChevronDown, CreditCard, Loader2, Lock } from 'lucide-react';
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded';
import { FX_HOST, Glow, Spot } from '../fx/fx';
import shield from '../fx/spots/shield';
type FieldName = 'name' | 'email' | 'card' | 'expiry' | 'cvc';
type CardMark = 'visa' | 'mastercard' | 'amex' | 'discover';
export type CheckoutValues = { name: string; email: string; cardNumber: string; expiry: string; cvc: string; bump: boolean };
export type PersuasionRailCheckoutCopy = {
railLabel: string; // accessible name of the rail
toggleLabel: string; // phone disclosure button
meter: string; // placeholders {done} {total}
meterReady: string;
meterLabel: string; // progressbar accessible name
stepLabel: string; // screen-reader prefix before each step heading, {n}
cardsLabel: string;
summaryLabel: string;
errorSummary: string; // {count}
errorSummaryOne: string;
labels: Record<FieldName, string>;
placeholders: Record<FieldName, string>;
errors: Record<FieldName, string>;
};
export type PersuasionRailCheckoutProps = {
headline?: React.ReactNode; // the question the button answers
lead?: React.ReactNode;
productName?: string;
productImage?: string; // slot: product (transparent cut-out)
productImageAlt?: string;
price?: string;
priceLine?: string; // words after the price
priceNote?: string;
items?: { name: string; detail?: string; image?: string; imageAlt?: string }[]; // slots: item-1 … item-n; detail is one short line under the name
outcomesHeading?: string;
outcomes?: { lead: string; text: string }[]; // bold lead-in + sentence
testimonial?: { quote: string; name?: string; role?: string }; // proof: empty by default
guaranteeTitle?: string;
guaranteeText?: string;
bump?: { label: string; name: string; text: string; price: string; totalWithBump: string }; // optional, always starts unchecked
stepHeadings?: [string, string, string];
buttonLabel?: string;
loadingLabel?: string;
reassurance?: string;
cards?: CardMark[]; // only the networks the processor really accepts
copy?: Partial<Omit<PersuasionRailCheckoutCopy, 'labels' | 'placeholders' | 'errors'>> & {
labels?: Partial<Record<FieldName, string>>;
placeholders?: Partial<Record<FieldName, string>>;
errors?: Partial<Record<FieldName, string>>;
};
loading?: boolean;
disabled?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
onSubmit?: (values: CheckoutValues) => void; // validated values; the page wires payment
className?: string;
};
export function PersuasionRailCheckout(props: PersuasionRailCheckoutProps) {
const {
headline = 'Ready to map your first funnel?',
lead = 'Two quick steps and your Funnel Starter Kit is ready to download.',
productName = 'The Funnel Starter Kit',
productImage,
productImageAlt = '',
price = '$47',
priceLine = `today. That's it.`,
priceNote = 'One payment · Lifetime access',
items = [],
outcomesHeading = `What you'll have once it's yours`,
outcomes = DEFAULT_OUTCOMES,
testimonial,
guaranteeTitle = 'Try it for 30 days, risk free',
guaranteeText = `If the kit doesn't help you plan your funnel, ask within 30 days and get every cent back.`,
bump,
stepHeadings = ['Tell us where to send your kit', 'Pay once, keep it forever', 'Get the whole kit in one download'],
buttonLabel = `I'm ready, send my kit`,
loadingLabel = 'Securing your order…',
reassurance = 'Secure checkout · Instant download',
cards = ['visa', 'mastercard', 'amex', 'discover'],
copy,
loading = false,
disabled = false,
state = 'default',
onSubmit,
className,
} = props;
const c = mergeCopy(copy);
const uid = React.useId().replace(/:/g, '');
const headId = `${uid}-head`;
const moreId = `${uid}-more`;
const [values, setValues] = React.useState<Record<FieldName, string>>({ name: '', email: '', card: '', expiry: '', cvc: '' });
const [touched, setTouched] = React.useState<Partial<Record<FieldName, boolean>>>({});
const [submitted, setSubmitted] = React.useState(false);
const [bumpOn, setBumpOn] = React.useState(false);
const [open, setOpen] = React.useState(false);
const refs = React.useRef<Partial<Record<FieldName, HTMLInputElement | null>>>({});
const forceErrors = state === 'error';
const isDisabled = disabled || state === 'disabled';
const valid = {} as Record<FieldName, boolean>;
FIELDS.forEach((f) => { valid[f] = isValid(f, values[f]); });
const total = FIELDS.length;
const invalid = FIELDS.filter((f) => !valid[f]);
const done = total - invalid.length;
const pct = Math.round((done / total) * 100);
const showError = (f: FieldName) => !valid[f] && Boolean(touched[f] || submitted || forceErrors);
const showSummary = (submitted || forceErrors) && invalid.length > 0;
const amount = bump && bumpOn ? bump.totalWithBump : price;
const stepsDone = [valid.name && valid.email, valid.card && valid.expiry && valid.cvc, false];
const summaryRows: NonNullable<PersuasionRailCheckoutProps['items']> = items.length
? items
: [{ name: productName, image: productImage, imageAlt: productImageAlt }];
const rowsHaveImages = summaryRows.some((r) => Boolean(r.image));
function change(f: FieldName, raw: string) {
setValues((v) => ({ ...v, [f]: format(f, raw) }));
}
function submit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
if (isDisabled || loading) return;
setSubmitted(true);
if (invalid.length) {
refs.current[invalid[0]]?.focus();
return;
}
onSubmit?.({
name: values.name.trim(),
email: values.email.trim(),
cardNumber: values.card.replace(/\D/g, ''),
expiry: values.expiry,
cvc: values.cvc,
bump: Boolean(bump && bumpOn),
});
}
const field = (f: FieldName) => {
const id = `${uid}-${f}`;
const errId = `${id}-err`;
const err = showError(f);
const meta = FIELD_META[f];
return (
<div className='cf-prc__field'>
<label className='cf-prc__label' htmlFor={id}>{c.labels[f]}</label>
<div className={`cf-prc__control${f === 'card' ? ' has-icon' : ''}`}>
{f === 'card' ? <CreditCard className='cf-prc__fieldicon' size={20} strokeWidth={2.5} aria-hidden='true' /> : null}
<input
ref={(el) => { refs.current[f] = el; }}
id={id}
name={f}
className='cf-prc__input'
type={meta.type}
inputMode={meta.inputMode}
autoComplete={meta.autoComplete}
placeholder={c.placeholders[f]}
value={values[f]}
onChange={(e) => change(f, e.target.value)}
onBlur={() => setTouched((t) => ({ ...t, [f]: true }))}
aria-invalid={err || undefined}
aria-describedby={err ? errId : undefined}
required
/>
{valid[f] ? <Check className='cf-prc__ok' size={18} strokeWidth={2.5} aria-hidden='true' /> : null}
</div>
{err ? (
<p className='cf-prc__error' id={errId}>
<AlertCircle className='cf-prc__inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{c.errors[f]}
</p>
) : null}
</div>
);
};
const step = (n: number, body: React.ReactNode) => {
const isDone = stepsDone[n - 1];
return (
<div className={`cf-prc__step${isDone ? ' is-done' : ''}${n === 3 ? ' is-last' : ''}`}>
<div className='cf-prc__num' aria-hidden='true'>
<span className='cf-prc__digit'>
{n}
{isDone ? <span className='cf-prc__tick'><Check size={14} strokeWidth={3} /></span> : null}
</span>
</div>
<h3 className='cf-prc__stephead'>
<span className='cf-prc__sr'>{fill(c.stepLabel, { n })}</span>
{stepHeadings[n - 1]}
</h3>
<div className='cf-prc__body'>{body}</div>
</div>
);
};
const btnClass = [
'cf-prc__btn',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-active' : '',
isDisabled ? 'is-disabled' : '',
loading ? 'is-loading' : '',
].filter(Boolean).join(' ');
return (
<section className={['cf-prc', open ? 'is-open' : '', className].filter(Boolean).join(' ')} aria-labelledby={headId}>
<style>{CSS}</style>
<div className='cf-prc__band' style={FX_HOST}>
<Glow />
<div className='cf-prc__wrap'>
<div className='cf-prc__head'>
<h2 className='cf-prc__title' id={headId}>{headline}</h2>
{lead ? <p className='cf-prc__lead'>{lead}</p> : null}
</div>
</div>
</div>
<div className='cf-prc__wrap'>
<div className='cf-prc__layout'>
<aside className='cf-prc__rail' aria-label={c.railLabel}>
<div className='cf-prc__card cf-prc__rail-card'>
<div className={`cf-prc__product${productImage ? ' has-img' : ''}`}>
{productImage ? (
<img className='cf-prc__product-img' src={productImage} alt={productImageAlt} width={320} height={210} decoding='async' />
) : null}
<div>
<h3 className='cf-prc__product-name'>{productName}</h3>
{amount ? (
<p className='cf-prc__rail-price'><strong>{amount}</strong> {priceLine}</p>
) : null}
</div>
</div>
<div className={`cf-prc__meter${done === total ? ' is-ready' : ''}`}>
<p className='cf-prc__meter-row' aria-live='polite'>
<span>{done === total ? c.meterReady : fill(c.meter, { done, total })}</span>
<span className='cf-prc__pct'>{pct}%</span>
</p>
<div className='cf-prc__track' role='progressbar' aria-label={c.meterLabel} aria-valuemin={0} aria-valuemax={100} aria-valuenow={pct}>
<span className='cf-prc__fill' style={{ width: `${pct}%` }} />
</div>
</div>
<button type='button' className='cf-prc__toggle' aria-expanded={open} aria-controls={moreId} onClick={() => setOpen((o) => !o)}>
<span>{c.toggleLabel}</span>
<ChevronDown className='cf-prc__chev' size={20} strokeWidth={2.5} aria-hidden='true' />
</button>
<div className='cf-prc__more' id={moreId}>
{outcomes.length ? (
<>
<h3 className='cf-prc__more-head'>{outcomesHeading}</h3>
<ul className='cf-prc__outcomes'>
{outcomes.map((o) => (
<li key={o.lead}>
<span className='cf-prc__badge' aria-hidden='true'><Check size={14} strokeWidth={3} /></span>
<span><strong>{o.lead}</strong> {o.text}</span>
</li>
))}
</ul>
</>
) : null}
{testimonial && testimonial.quote ? (
<figure className='cf-prc__quote'>
<blockquote>{`“${testimonial.quote}”`}</blockquote>
{testimonial.name ? (
<figcaption>
<strong>{testimonial.name}</strong>
{testimonial.role ? ` · ${testimonial.role}` : null}
</figcaption>
) : null}
</figure>
) : null}
{guaranteeTitle ? (
<div className='cf-prc__guarantee'>
<Spot src={shield} size={56} />
<div>
<p className='cf-prc__g-title'>{guaranteeTitle}</p>
{guaranteeText ? <p className='cf-prc__g-text'>{guaranteeText}</p> : null}
</div>
</div>
) : null}
</div>
</div>
</aside>
<form className='cf-prc__card cf-prc__form' noValidate onSubmit={submit} aria-labelledby={headId}>
{step(1, <div className='cf-prc__fields'>{field('name')}{field('email')}</div>)}
{step(2, (
<>
{cards.length ? (
<ul className='cf-prc__marks' aria-label={c.cardsLabel}>
{cards.map((k) => {
const Icon = MARKS[k].Icon;
return (
<li key={k}>
<span className='cf-prc__mark' role='img' aria-label={MARKS[k].label}>
<Icon width={40} height={26} aria-hidden='true' focusable='false' />
</span>
</li>
);
})}
</ul>
) : null}
<div className='cf-prc__stack'>
{field('card')}
<div className='cf-prc__pair'>{field('expiry')}{field('cvc')}</div>
</div>
</>
))}
{step(3, (
<>
<ul className='cf-prc__summary' aria-label={c.summaryLabel}>
{summaryRows.map((it) => (
<li className='cf-prc__row' key={it.name}>
{it.image ? (
<img className='cf-prc__thumb' src={it.image} alt={it.imageAlt ?? ''} width={48} height={48} loading='lazy' decoding='async' />
) : rowsHaveImages ? <span className='cf-prc__thumb-gap' aria-hidden='true' /> : null}
<span className='cf-prc__row-text'>
<span className='cf-prc__row-name'>{it.name}</span>
{it.detail ? <span className='cf-prc__row-detail'>{it.detail}</span> : null}
</span>
</li>
))}
{bump && bumpOn ? (
<li className='cf-prc__row'>
{rowsHaveImages ? <span className='cf-prc__thumb-gap' aria-hidden='true' /> : null}
<span className='cf-prc__row-text'>
<span className='cf-prc__row-name'>{bump.name}</span>
</span>
<span className='cf-prc__row-price'>{bump.price}</span>
</li>
) : null}
</ul>
{bump ? (
<div className={`cf-prc__bump${bumpOn ? ' is-on' : ''}`}>
<label className='cf-prc__bump-strip' htmlFor={`${uid}-bump`}>
<span className='cf-prc__box'>
<input id={`${uid}-bump`} type='checkbox' checked={bumpOn} onChange={(e) => setBumpOn(e.target.checked)} aria-describedby={`${uid}-bump-text`} />
<span className='cf-prc__boxface' aria-hidden='true'><Check size={16} strokeWidth={3} /></span>
</span>
<span>{bump.label}</span>
</label>
<p className='cf-prc__bump-text' id={`${uid}-bump-text`}>{bump.text}</p>
</div>
) : null}
{amount ? (
<>
<p className='cf-prc__price'>
<span className='cf-prc__amount'>{amount}</span>
<span className='cf-prc__priceline'>{priceLine}</span>
</p>
{priceNote ? <p className='cf-prc__note'>{priceNote}</p> : null}
</>
) : null}
{showSummary ? (
<p className='cf-prc__alert' role='alert'>
<AlertCircle className='cf-prc__inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{invalid.length === 1 ? c.errorSummaryOne : fill(c.errorSummary, { count: invalid.length })}
</p>
) : null}
<button type='submit' className={btnClass} disabled={isDisabled || loading} aria-busy={loading || undefined}>
{loading ? (
<>
<Loader2 className='cf-prc__spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{loadingLabel}
</>
) : buttonLabel}
</button>
{reassurance ? (
<p className='cf-prc__assure'>
<Lock className='cf-prc__inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</>
))}
</form>
</div>
</div>
</section>
);
}
export default PersuasionRailCheckout;
const FIELDS: FieldName[] = ['name', 'email', 'card', 'expiry', 'cvc'];
const DEFAULT_OUTCOMES = [
{ lead: 'A funnel you can see.', text: 'Every page mapped before you build a thing.' },
{ lead: 'Copy that is already drafted.', text: 'Your headline, offer and call to action, written.' },
{ lead: 'A launch you can trust.', text: 'Every link, form and next step checked off.' },
];
const DEFAULT_COPY: PersuasionRailCheckoutCopy = {
railLabel: `Why you're getting this`,
toggleLabel: `Why you're getting this`,
meter: '{done} of {total} details complete',
meterReady: 'All set. Your kit is one click away.',
meterLabel: 'Checkout progress',
stepLabel: 'Step {n}: ',
cardsLabel: 'Cards accepted',
summaryLabel: 'Your order',
errorSummary: 'Fix the {count} highlighted details to get your kit.',
errorSummaryOne: 'Fix the highlighted detail to get your kit.',
labels: { name: 'Full name', email: 'Email address', card: 'Card number', expiry: 'Expiry date', cvc: 'Security code' },
placeholders: { name: 'Jane Smith', email: 'you@example.com', card: '1234 1234 1234 1234', expiry: 'MM / YY', cvc: '123' },
errors: {
name: 'Enter the name for your receipt.',
email: 'Enter an email like you@example.com.',
card: 'Check the card number and try again.',
expiry: 'Enter a future date as MM / YY.',
cvc: 'Enter the 3 or 4 digits on your card.',
},
};
const FIELD_META: Record<FieldName, { type: string; inputMode: 'text' | 'email' | 'numeric'; autoComplete: string }> = {
name: { type: 'text', inputMode: 'text', autoComplete: 'name' },
email: { type: 'email', inputMode: 'email', autoComplete: 'email' },
card: { type: 'text', inputMode: 'numeric', autoComplete: 'cc-number' },
expiry: { type: 'text', inputMode: 'numeric', autoComplete: 'cc-exp' },
cvc: { type: 'text', inputMode: 'numeric', autoComplete: 'cc-csc' },
};
// Official card-network marks keep their own colours (theme-contract §3 exception).
const MARKS: Record<CardMark, { label: string; Icon: React.ElementType }> = {
visa: { label: 'Visa', Icon: Visa },
mastercard: { label: 'Mastercard', Icon: Mastercard },
amex: { label: 'American Express', Icon: AmericanExpress },
discover: { label: 'Discover', Icon: Discover },
};
function mergeCopy(copy?: PersuasionRailCheckoutProps['copy']): PersuasionRailCheckoutCopy {
return {
...DEFAULT_COPY,
...copy,
labels: { ...DEFAULT_COPY.labels, ...copy?.labels },
placeholders: { ...DEFAULT_COPY.placeholders, ...copy?.placeholders },
errors: { ...DEFAULT_COPY.errors, ...copy?.errors },
};
}
function fill(template: string, map: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (m, k: string) => (k in map ? String(map[k]) : m));
}
function digits(v: string, max: number) {
return v.replace(/\D/g, '').slice(0, max);
}
function format(f: FieldName, raw: string) {
if (f === 'card') return digits(raw, 19).replace(/(\d{4})(?=\d)/g, '$1 ');
if (f === 'expiry') {
const d = digits(raw, 4);
return d.length > 2 ? `${d.slice(0, 2)} / ${d.slice(2)}` : d;
}
if (f === 'cvc') return digits(raw, 4);
return raw;
}
function luhn(d: string) {
let sum = 0;
let dbl = false;
for (let i = d.length - 1; i >= 0; i--) {
let n = Number(d[i]);
if (dbl) {
n *= 2;
if (n > 9) n -= 9;
}
sum += n;
dbl = !dbl;
}
return sum % 10 === 0;
}
function isValid(f: FieldName, v: string): boolean {
if (f === 'name') return v.trim().length >= 2;
if (f === 'email') return /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(v.trim());
if (f === 'card') {
const d = v.replace(/\D/g, '');
return d.length >= 13 && d.length <= 19 && luhn(d);
}
if (f === 'expiry') {
const m = /^(\d{2}) \/ (\d{2})$/.exec(v);
if (!m) return false;
const month = Number(m[1]);
const year = Number(m[2]);
if (month < 1 || month > 12) return false;
const now = new Date();
const yy = now.getFullYear() % 100;
const mm = now.getMonth() + 1;
return year > yy || (year === yy && month >= mm);
}
return /^\d{3,4}$/.test(v);
}
const CSS = `
.cf-prc{--prc-hair:oklch(from var(--ink) l c h / .12);--prc-well:color-mix(in oklch,var(--ink) 4%,var(--card));--prc-shadow:var(--shadow,oklch(.22 .03 260));position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding-bottom:clamp(64px,8.5vw,120px)}
.cf-prc *,.cf-prc *::before,.cf-prc *::after{box-sizing:border-box}
.cf-prc__wrap{width:100%;max-width:1120px;margin-inline:auto;padding-inline:clamp(16px,5vw,48px)}
.cf-prc__band{background:var(--band);color:var(--band-ink);overflow:hidden;padding-top:clamp(56px,8vw,112px);padding-bottom:calc(clamp(72px,9vw,128px) + 32px)}
.cf-prc__head{position:relative;z-index:1;max-width:46rem;animation:cf-prc-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-prc__title{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.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)}
.cf-prc__lead{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:var(--band-ink)}
.cf-prc__layout{position:relative;z-index:1;margin-top:calc(-1 * clamp(72px,9vw,128px));display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,380px);grid-template-areas:'form rail';gap:clamp(24px,3vw,40px);align-items:start}
.cf-prc__card{background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--prc-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--prc-shadow) l c h / .2)));padding:clamp(20px,3vw,32px)}
.cf-prc__form{grid-area:form;min-width:0;border-color:oklch(from var(--accent) l c h / .34);box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--prc-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--prc-shadow) l c h / .32)));animation:cf-prc-rise .45s cubic-bezier(.2,.7,.2,1) .14s both}
.cf-prc__rail{grid-area:rail;position:sticky;top:24px;min-width:0}
.cf-prc__rail-card{animation:cf-prc-rise .45s cubic-bezier(.2,.7,.2,1) .07s both}
.cf-prc__product{display:grid;gap:12px}
.cf-prc__product-img{display:block;width:100%;height:clamp(160px,16vw,210px);object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--prc-shadow) l c h / .28)) drop-shadow(0 12px 14px oklch(from var(--prc-shadow) l c h / .16))}
.cf-prc__product-name{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-.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)}
.cf-prc__rail-price{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-prc__rail-price strong{color:var(--ink);font-weight:800;font-variant-numeric:lining-nums tabular-nums}
.cf-prc__meter{margin-top:20px;padding:14px 16px;border-radius:10px;background:var(--prc-well)}
.cf-prc__meter-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 10px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-prc__pct{flex:none;font-family:var(--font-body);font-weight:800;font-variant-numeric:lining-nums tabular-nums;color:var(--ink)}
.cf-prc__track{height:10px;border-radius:999px;background:oklch(from var(--ink) l c h / .12);overflow:hidden}
.cf-prc__fill{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transition:width .45s cubic-bezier(.2,.7,.2,1),background .16s ease}
.cf-prc__meter.is-ready .cf-prc__fill{background:var(--success)}
.cf-prc__toggle{display:none;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:48px;margin-top:16px;padding:10px 16px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));font-family:var(--button-font,var(--font-display));font-weight:800;font-size:1.0625rem;line-height:1.2;text-align:left;cursor:pointer;transition:background .16s ease}
.cf-prc__toggle:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .03) c h)}
.cf-prc__toggle:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-prc__chev{flex:none;transition:transform .16s ease}
.cf-prc.is-open .cf-prc__chev{transform:rotate(180deg)}
.cf-prc__more{margin-top:24px}
.cf-prc__more-head{margin:0 0 16px;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-.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)}
.cf-prc__outcomes{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.cf-prc__outcomes 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.5;text-wrap:pretty}
.cf-prc__outcomes strong{font-weight:800}
.cf-prc__badge{display:grid;place-items:center;width:24px;height:24px;margin-top:2px;border-radius:999px;background:var(--success);color:var(--status-ink,#fff)}
.cf-prc__quote{margin:24px 0 0;padding:16px 20px;border-radius:10px;background:var(--prc-well)}
.cf-prc__quote blockquote{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-weight:500;text-wrap:pretty;color:var(--ink)}
.cf-prc__quote figcaption{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-prc__quote figcaption strong{color:var(--ink);font-weight:700}
.cf-prc__guarantee{margin-top:24px;display:grid;grid-template-columns:56px minmax(0,1fr);gap:16px;align-items:start}
.cf-prc__g-title{margin:0;font-family:var(--font-display);font-weight:800;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;text-wrap:balance;color:var(--ink)}
.cf-prc__g-text{margin:4px 0 0;font-size:.9375rem;line-height:1.45;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-prc__step{display:grid;grid-template-columns:56px minmax(0,1fr);grid-template-areas:'num head' 'num body';column-gap:20px}
.cf-prc__num{grid-area:num;display:flex;flex-direction:column;align-items:center}
.cf-prc__num::after{content:'';flex:1 1 auto;width:2px;margin:12px 0 16px;border-radius:2px;background:var(--prc-hair);transition:background .16s ease}
.cf-prc__step.is-last .cf-prc__num::after{display:none}
.cf-prc__step.is-done .cf-prc__num::after{background:oklch(from var(--success) l c h / .5)}
.cf-prc__digit{position:relative;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:lining-nums tabular-nums;color:var(--accent);transition:color .16s ease}
.cf-prc__step.is-done .cf-prc__digit{color:var(--success)}
.cf-prc__tick{position:absolute;top:-4px;right:-18px;display:grid;place-items:center;width:22px;height:22px;border-radius:999px;background:var(--success);color:var(--status-ink,#fff);outline:3px solid var(--card);animation:cf-prc-pop .3s cubic-bezier(.2,.7,.2,1) both}
.cf-prc__stephead{grid-area:head;margin:0;padding-top:.3em;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-.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)}
.cf-prc__body{grid-area:body;min-width:0;padding:16px 0 40px}
.cf-prc__step.is-last .cf-prc__body{padding-bottom:0}
.cf-prc__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-prc__fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:16px}
.cf-prc__stack{display:grid;gap:16px}
.cf-prc__pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cf-prc__field{min-width:0}
.cf-prc__label{display:block;margin-bottom:8px;font-size:1.0625rem;line-height:1.2;font-weight:700;color:var(--label-ink,var(--ink))}
.cf-prc__control{position:relative}
.cf-prc__input{appearance:none;display:block;width:100%;height:56px;margin:0;padding:0 44px 0 16px;font-family:var(--font-body);font-size:1.0625rem;font-weight:500;line-height:1.2;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(--prc-shadow) l c h / .06);transition:border-color .16s ease,box-shadow .16s ease}
.cf-prc__control.has-icon .cf-prc__input{padding-left:48px}
.cf-prc__input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-prc__input:hover{border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
.cf-prc__input:focus-visible{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
.cf-prc__input[aria-invalid='true']{border-color:var(--danger)}
.cf-prc__input[aria-invalid='true']:focus-visible{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-prc__fieldicon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink) 60%,var(--field));pointer-events:none}
.cf-prc__ok{position:absolute;right:16px;top:50%;transform:translateY(-50%);color:var(--success);pointer-events:none}
.cf-prc__error{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-prc__inline{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-prc__marks{list-style:none;margin:0 0 16px;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.cf-prc__mark{display:block;line-height:0}
.cf-prc__mark svg{display:block;width:40px;height:26px}
.cf-prc__summary{list-style:none;margin:0;padding:0}
.cf-prc__row{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--prc-hair)}
.cf-prc__row:first-child{padding-top:0}
.cf-prc__row:last-child{border-bottom:0;padding-bottom:0}
.cf-prc__thumb{display:block;flex:none;width:48px;height:48px;border-radius:8px;object-fit:cover}
.cf-prc__thumb-gap{flex:none;width:48px}
.cf-prc__row-text{flex:1 1 auto;min-width:0;display:grid;gap:2px}
.cf-prc__row-name{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:700;color:var(--ink);text-wrap:pretty}
.cf-prc__row-detail{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-prc__row-price{flex:none;font-weight:800;font-variant-numeric:lining-nums tabular-nums;color:var(--ink)}
.cf-prc__bump{margin-top:24px;background:var(--bump);color:var(--bump-ink);border:1px solid oklch(from var(--bump-ink) l c h / .16);border-radius:var(--radius,12px);overflow:hidden}
.cf-prc__bump-strip{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--bump-strip);color:var(--bump-ink);cursor:pointer;font-family:var(--font-display);font-weight:800;font-size:1.0625rem;line-height:1.3;font-variant-numeric:lining-nums;text-wrap:pretty}
.cf-prc__box{position:relative;flex:none;width:26px;height:26px}
.cf-prc__box input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.cf-prc__boxface{display:grid;place-items:center;width:100%;height:100%;border-radius:7px;background:var(--field);border:2px solid oklch(from var(--bump-ink) l c h / .6);color:transparent;transition:background .16s ease,border-color .16s ease}
.cf-prc__box input:checked + .cf-prc__boxface{background:var(--success);border-color:var(--success);color:var(--status-ink,#fff)}
.cf-prc__box input:focus-visible + .cf-prc__boxface{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
.cf-prc__bump-text{margin:0;padding:12px 16px 16px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty;color:var(--bump-ink)}
.cf-prc__price{margin:32px 0 0;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:10px;row-gap:4px}
.cf-prc__amount{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-.03em;font-variant-numeric:lining-nums tabular-nums;color:var(--ink)}
.cf-prc__priceline{font-family:var(--font-display);font-weight:800;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;color:var(--ink)}
.cf-prc__note{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted)}
.cf-prc__alert{margin:20px 0 0;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:700;text-wrap:pretty}
.cf-prc__btn{--prc-bg:var(--button-bg,var(--cta));--prc-bg2:var(--button-bg-2,var(--cta-2));display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:24px;padding:12px 28px;border:0;cursor:pointer;border-radius:var(--button-radius,var(--radius,12px));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;text-align:center;text-wrap:balance;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--prc-bg) calc(l + .04) c h),oklch(from var(--prc-bg2) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--prc-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--prc-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--prc-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--prc-shadow) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-prc__btn:hover:not(:disabled),.cf-prc__btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--prc-bg) calc(l - .01) c h),oklch(from var(--prc-bg2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--prc-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--prc-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--prc-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--prc-shadow) l c h / .5))}
.cf-prc__btn:active:not(:disabled),.cf-prc__btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--prc-bg) calc(l - .04) c h),oklch(from var(--prc-bg2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--prc-shadow) l c h / .35),inset 0 -2px 0 oklch(from var(--prc-bg) calc(l - .16) c h)}
.cf-prc__btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-prc__btn:disabled{cursor:not-allowed}
.cf-prc__btn.is-loading{cursor:progress}
.cf-prc__btn.is-disabled{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))}
.cf-prc__spin{flex:none;animation:cf-prc-spin .8s linear infinite}
.cf-prc__assure{margin:12px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
@keyframes cf-prc-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-prc-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes cf-prc-spin{to{transform:rotate(360deg)}}
@media (max-width:960px){
.cf-prc__layout{grid-template-columns:minmax(0,1fr);grid-template-areas:'rail' 'form'}
.cf-prc__rail{position:static}
.cf-prc__product.has-img{grid-template-columns:72px minmax(0,1fr);align-items:center;gap:16px}
.cf-prc__product-img{width:72px;height:72px}
.cf-prc__toggle{display:flex}
.cf-prc__more{display:none;margin-top:20px}
.cf-prc.is-open .cf-prc__more{display:block}
}
@media (max-width:640px){
.cf-prc__step{grid-template-columns:auto minmax(0,1fr);grid-template-areas:'num head' 'body body';column-gap:24px}
.cf-prc__num::after{display:none}
.cf-prc__stephead{padding-top:0;align-self:center}
.cf-prc__body{padding-bottom:32px}
.cf-prc__btn{padding:12px 20px}
}
@media (prefers-reduced-motion:reduce){
.cf-prc *,.cf-prc *::before,.cf-prc *::after{animation:none!important;transition:none!important}
}
`;
pieces/checkout/persuasion-rail-checkout/specimen.tsx 47 lines
import __studioImage4eaf0039 from "../assets/518324d041adcc81.webp";
import React from 'react';
import PersuasionRailCheckout, { type PersuasionRailCheckoutProps } from '../persuasion-rail-checkout';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function PersuasionRailCheckoutSpecimen({ state = 'default' }: { state?: string }) {
const s = defaults.sample;
return (
<PersuasionRailCheckout
state={state as PersuasionRailCheckoutProps['state']}
headline='Ready to map your first funnel?'
lead={`Two quick steps and ${s.name} is yours: the guide, the workbook and the launch checklist in one download.`}
productName={s.name}
productImage={slot('product', __studioImage4eaf0039)}
productImageAlt={`${s.name}: planning guide, copy workbook and launch checklist`}
price={s.price}
priceLine={`today. That's it.`}
priceNote={s.note}
items={s.items.map((it, i) => ({ name: it.name, detail: it.detail, image: slot(`item-${i + 1}`, it.image), imageAlt: it.imageAlt }))}
outcomesHeading={`What you'll have once it's yours`}
outcomes={[
{ lead: 'A funnel you can see.', text: 'Every page mapped before you build a thing.' },
{ lead: 'Copy that is already drafted.', text: 'Your headline, offer and call to action, written in the workbook.' },
{ lead: 'A launch you can trust.', text: 'Every link, form and next step checked off first.' },
]}
testimonial={{
quote: 'I mapped every page of my funnel in one Sunday afternoon. The checklist caught two broken links before I launched.',
name: 'Dana R.',
role: 'Course creator, Austin',
}}
guaranteeTitle='Try it for 30 days, risk free'
guaranteeText={`Every kit comes with a ${s.guarantee}. If it doesn't help you plan your funnel, ask and get every cent back.`}
bump={{
label: 'Yes! Add the Headline Swipe File for $19',
name: 'Headline Swipe File',
text: 'Fifty fill-in headline templates written for funnel pages. Paste one into your workbook and make it yours in minutes.',
price: '$19',
totalWithBump: '$66',
}}
buttonLabel={`I'm ready, send my kit`}
reassurance={s.sublabel}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalPersuasionRailCheckout |
React.ReactNode |
|
lead OptionalPersuasionRailCheckout |
React.ReactNode |
|
productName OptionalPersuasionRailCheckout |
string |
|
productImage OptionalPersuasionRailCheckout |
string |
|
productImageAlt OptionalPersuasionRailCheckout |
string |
|
price OptionalPersuasionRailCheckout |
string |
|
priceLine OptionalPersuasionRailCheckout |
string |
|
priceNote OptionalPersuasionRailCheckout |
string |
|
items OptionalPersuasionRailCheckout |
{ name: string; detail?: string; image?: string; imageAlt?: string }[] |
|
outcomesHeading OptionalPersuasionRailCheckout |
string |
|
outcomes OptionalPersuasionRailCheckout |
{ lead: string; text: string }[] |
|
testimonial OptionalPersuasionRailCheckout |
{ quote: string; name?: string; role?: string } |
|
guaranteeTitle OptionalPersuasionRailCheckout |
string |
|
guaranteeText OptionalPersuasionRailCheckout |
string |
|
bump OptionalPersuasionRailCheckout |
{ label: string; name: string; text: string; price: string; totalWithBump: string } |
|
stepHeadings OptionalPersuasionRailCheckout |
[string, string, string] |
|
buttonLabel OptionalPersuasionRailCheckout |
string |
|
loadingLabel OptionalPersuasionRailCheckout |
string |
|
reassurance OptionalPersuasionRailCheckout |
string |
|
cards OptionalPersuasionRailCheckout |
CardMark[] |
|
copy OptionalPersuasionRailCheckout |
Partial<Omit<PersuasionRailCheckoutCopy, 'labels' | 'placeholders' | 'errors'>> & {
labels?: Partial<Record<FieldName, string>>;
placeholders?: Partial<Record<FieldName, string>>;
errors?: Partial<Record<FieldName, string>>;
} |
|
loading OptionalPersuasionRailCheckout |
boolean |
|
disabled OptionalPersuasionRailCheckout |
boolean |
|
state OptionalPersuasionRailCheckout |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
onSubmit OptionalPersuasionRailCheckout |
(values: CheckoutValues) => void |
|
className OptionalPersuasionRailCheckout |
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-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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
product- The main product shot or cover (ebook, kit, bottle).
-
518324d041adcc81.webp
image/webp · 164 KB
-
7d6f1c81c93d8f71.webp
image/webp · 18.2 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB