Checkout Header 1
Checkout and upsell page header: logo, secure line, step progress and a help disclosure, with a slim offer strip that keeps the next action one tap away.
Use it in a prompt
Use nav/checkout-header 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/nav/checkout-header.tsx. - Import it and pass your copy and images (Props tab):
import { CheckoutHeader } from "@/components/funneldna/nav/checkout-header"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/nav/checkout-header/component.tsx 554 lines
// layout: hello-strip
// Checkout and upsell page header: logo, secure line, step progress and a help disclosure, with a slim offer strip that keeps the next action one tap away.
// It has no exit or navigation links, so traffic stays in the checkout.
import * as React from 'react';
import { Check, Clock, Headset, Lock, Mail, Phone, Tag, X } from 'lucide-react';
export type CheckoutHeaderNote = {
/** Bold lead-in phrase that opens the note */
lead: string;
/** Rest of the note after the lead-in */
text: string;
};
export type CheckoutHeaderProps = {
/** Wordmark beside the logo; an empty string hides it */
brandName?: string;
/** logo slot image: a transparent mark or wordmark */
logoImage?: string;
/** Defaults to empty (decorative) when the wordmark is shown */
logoAlt?: string;
/** Alt text for the logo when there is no wordmark and no logoAlt */
logoFallbackAlt?: string;
/** Trust line beside the brand, with a lock icon */
secureLabel?: string;
/** Benefit-led step names, in order */
steps?: string[];
/** 1-based index of the step the visitor is on */
currentStep?: number;
/** Template with {current} and {total} */
stepCountLabel?: string;
/** Accessible name of the step list */
progressLabel?: string;
/** Accessible label template for the step list, with {label} (progressLabel) and {count} (stepCountLabel) */
progressAriaLabel?: string;
/** Screen-reader suffix for finished steps */
completedLabel?: string;
/** Help button label on wider screens */
helpLabel?: string;
/** Help button label on phones */
helpLabelShort?: string;
/** Heading inside the help panel */
helpTitle?: string;
helpNotes?: CheckoutHeaderNote[];
emailLabel?: string;
/** Support address; an empty string hides the email row */
supportEmail?: string;
phoneLabel?: string;
/** Support number as shown; digits and + form the tel: link */
supportPhone?: string;
supportHours?: string;
/** Accessible label of the panel's close button */
closeLabel?: string;
/** Show the offer strip under the header bar */
showOffer?: boolean;
/** Bold opening of the strip's promise line */
promiseLead?: string;
/** Rest of the promise line, hidden on narrow widths */
promiseText?: string;
/** Saving amount for the coupon pill; empty hides the pill */
couponSaving?: string;
/** Full value the saving is taken from */
couponValue?: string;
/** Template with {saving} */
couponLead?: string;
/** Template with {value} */
couponRest?: string;
/** Price shown in the strip; empty hides it */
price?: string;
priceNote?: string;
/** Extra price note, hidden on phones */
priceNoteMore?: string;
actionLabel?: string;
/** Shorter action label for narrow widths */
actionLabelShort?: string;
/** Navigation destination of the action; without it the action is a button */
href?: string;
/** Called when the action is clicked (not while disabled) */
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
disabled?: boolean;
/** Stick to the top of the viewport while the visitor scrolls */
sticky?: boolean;
/** Open the help panel on first render */
defaultHelpOpen?: boolean;
state?: 'default' | 'hover' | 'active' | 'disabled';
className?: string;
};
export function CheckoutHeader(props: CheckoutHeaderProps) {
const {
brandName = 'Funnel Starter Kit',
logoImage,
logoAlt,
logoFallbackAlt = 'Logo',
secureLabel = 'Secure checkout',
steps = ['Your details', 'Secure your kit', 'Instant access'],
currentStep = 2,
stepCountLabel = 'Step {current} of {total}',
progressLabel = 'Checkout progress',
progressAriaLabel = '{label}: {count}',
completedLabel = 'completed',
helpLabel = 'Need help?',
helpLabelShort = 'Help',
helpTitle = 'Questions before you finish?',
helpNotes = [{ lead: 'Ask before you buy.', text: 'Email us and mention your checkout step so we know where you are.' }],
emailLabel = 'Email support',
supportEmail = 'support@example.com',
phoneLabel = 'Call support',
supportPhone,
supportHours,
closeLabel = 'Close help',
showOffer = true,
promiseLead = 'You’re one step from the Funnel Starter Kit.',
promiseText = 'Finish your details below and it’s yours today.',
couponSaving = '$50',
couponValue = '$97',
couponLead = '{saving} off',
couponRest = 'the {value} value',
price = '$47',
priceNote = 'today',
priceNoteMore = 'one payment',
actionLabel = 'Yes! I want the Funnel Starter Kit',
actionLabelShort = 'Yes! I want the Starter Kit',
href = '#order-form',
onAction,
disabled = false,
sticky = false,
defaultHelpOpen = false,
state = 'default',
className,
} = props;
const uid = React.useId();
const panelId = `${uid}-help`;
const titleId = `${uid}-help-title`;
const [open, setOpen] = React.useState(defaultHelpOpen);
const [stuck, setStuck] = React.useState(false);
const helpRef = React.useRef<HTMLDivElement>(null);
const triggerRef = React.useRef<HTMLButtonElement>(null);
const panelRef = React.useRef<HTMLDivElement>(null);
const sentinelRef = React.useRef<HTMLSpanElement>(null);
const focusPanel = React.useRef(false);
const close = React.useCallback((returnFocus: boolean) => {
setOpen(false);
if (returnFocus) triggerRef.current?.focus();
}, []);
React.useEffect(() => {
if (!open) return;
if (focusPanel.current) {
panelRef.current?.focus();
focusPanel.current = false;
}
const onKey = (event: KeyboardEvent) => {
if (event.key === 'Escape') {
event.preventDefault();
close(true);
}
};
const onDown = (event: PointerEvent) => {
if (helpRef.current && !helpRef.current.contains(event.target as Node)) close(false);
};
document.addEventListener('keydown', onKey);
document.addEventListener('pointerdown', onDown);
return () => {
document.removeEventListener('keydown', onKey);
document.removeEventListener('pointerdown', onDown);
};
}, [open, close]);
React.useEffect(() => {
const el = sentinelRef.current;
if (!sticky || !el || typeof IntersectionObserver === 'undefined') {
setStuck(false);
return;
}
const observer = new IntersectionObserver(([entry]) => {
setStuck(!entry.isIntersecting && entry.boundingClientRect.top < 0);
});
observer.observe(el);
return () => observer.disconnect();
}, [sticky]);
const total = steps.length;
const current = Math.min(Math.max(Math.round(currentStep), 1), Math.max(total, 1));
const countText = fill(stepCountLabel, { current: String(current), total: String(total) });
const stepsLabel = fill(progressAriaLabel, { label: progressLabel, count: countText });
const isDisabled = disabled || state === 'disabled';
const tel = supportPhone ? supportPhone.replace(/[^0-9+]/g, '') : '';
const hasHelp = Boolean(supportEmail || tel);
const hasCoupon = Boolean(couponSaving);
const hasPrice = Boolean(price);
const toggleHelp = () => {
if (open) {
setOpen(false);
return;
}
focusPanel.current = true;
setOpen(true);
};
const onHelpBlur = (event: React.FocusEvent<HTMLDivElement>) => {
const next = event.relatedTarget as Node | null;
if (open && next && !event.currentTarget.contains(next)) setOpen(false);
};
const handleAction = (event: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
event.preventDefault();
return;
}
onAction?.(event);
};
const label = (
<>
<span className='cfch-cta-long'>{actionLabel}</span>
<span className='cfch-cta-short'>{actionLabelShort || actionLabel}</span>
</>
);
const action =
href && !isDisabled ? (
<a className='cfch-cta' href={href} onClick={handleAction}>
{label}
</a>
) : (
<button type='button' className='cfch-cta' disabled={isDisabled} onClick={handleAction}>
{label}
</button>
);
return (
<>
<style>{CSS}</style>
{sticky ? <span ref={sentinelRef} className='cfch-sentinel' style={SENTINEL_STYLE} aria-hidden='true' /> : null}
<header
className={['cf-checkout-header', className].filter(Boolean).join(' ')}
data-sticky={sticky ? 'true' : undefined}
data-stuck={stuck ? 'true' : undefined}
data-state={state}
data-offer={showOffer ? 'true' : 'false'}
>
<div className='cfch-bar'>
<div className='cfch-inner cfch-bar-grid'>
<div className='cfch-brand'>
{logoImage ? (
<img
className='cfch-logo'
src={logoImage}
alt={logoAlt ?? (brandName ? '' : logoFallbackAlt)}
width={36}
height={36}
/>
) : null}
<div className='cfch-brand-text'>
{brandName ? <span className='cfch-name'>{brandName}</span> : null}
<span className='cfch-secure'>
<Lock className='cfch-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{secureLabel}
</span>
</div>
</div>
{total > 0 ? (
<div className='cfch-progress'>
<p className='cfch-count' aria-hidden='true'>
<span className='cfch-count-step'>{countText}</span>
<span className='cfch-count-label'>{steps[current - 1]}</span>
</p>
<ol className='cfch-steps' aria-label={stepsLabel} style={{ '--cfch-n': total } as React.CSSProperties}>
{steps.map((step, i) => {
const status = i + 1 < current ? 'done' : i + 1 === current ? 'current' : 'next';
return (
<li
key={`${i}-${step}`}
className='cfch-step'
data-status={status}
aria-current={status === 'current' ? 'step' : undefined}
>
<span className='cfch-seg' aria-hidden='true' />
<span className='cfch-step-label'>
{status === 'done' ? (
<Check className='cfch-step-check' size={16} strokeWidth={2.5} aria-hidden='true' />
) : (
<span className='cfch-step-num' aria-hidden='true'>
{i + 1}
</span>
)}
<span className='cfch-step-name'>{step}</span>
{status === 'done' ? <span className='cfch-sr'>, {completedLabel}</span> : null}
</span>
</li>
);
})}
</ol>
</div>
) : null}
{hasHelp ? (
<div className='cfch-help' ref={helpRef} onBlur={onHelpBlur}>
<button
ref={triggerRef}
type='button'
className='cfch-help-btn'
aria-expanded={open}
aria-controls={open ? panelId : undefined}
onClick={toggleHelp}
>
<Headset size={18} strokeWidth={2.5} aria-hidden='true' />
<span className='cfch-help-long'>{helpLabel}</span>
<span className='cfch-help-short'>{helpLabelShort || helpLabel}</span>
</button>
{open ? (
<div
ref={panelRef}
id={panelId}
className='cfch-panel'
role='dialog'
aria-modal='false'
aria-labelledby={titleId}
tabIndex={-1}
>
<button type='button' className='cfch-close' aria-label={closeLabel} onClick={() => close(true)}>
<X size={20} strokeWidth={2.5} aria-hidden='true' />
</button>
<p id={titleId} className='cfch-panel-title'>
{helpTitle}
</p>
{helpNotes.map((note, i) => (
<p key={`${i}-${note.lead}`} className='cfch-note'>
<strong>{note.lead}</strong> {note.text}
</p>
))}
<ul className='cfch-contacts'>
{supportEmail ? (
<li>
<a className='cfch-contact' href={`mailto:${supportEmail}`}>
<Mail size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='cfch-contact-text'>
<span className='cfch-contact-label'>{emailLabel}</span>
<span className='cfch-contact-value'>{supportEmail}</span>
</span>
</a>
</li>
) : null}
{tel ? (
<li>
<a className='cfch-contact' href={`tel:${tel}`}>
<Phone size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='cfch-contact-text'>
<span className='cfch-contact-label'>{phoneLabel}</span>
<span className='cfch-contact-value'>{supportPhone}</span>
</span>
</a>
</li>
) : null}
</ul>
{supportHours ? (
<p className='cfch-hours'>
<Clock className='cfch-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{supportHours}
</p>
) : null}
</div>
) : null}
</div>
) : null}
</div>
</div>
{showOffer ? (
<div className='cfch-strip'>
<div className='cfch-inner cfch-strip-grid'>
{promiseLead || promiseText ? (
<p className='cfch-promise'>
{promiseLead ? <strong>{promiseLead}</strong> : null}
{promiseText ? <span className='cfch-promise-rest'>{' '}{promiseText}</span> : null}
</p>
) : null}
{hasCoupon || hasPrice ? (
<div className='cfch-deal'>
{hasPrice ? (
<p className='cfch-price'>
<span className='cfch-price-num'>{price}</span>
<span className='cfch-price-note'>
{priceNote}
{priceNoteMore ? <span className='cfch-price-more'> · {priceNoteMore}</span> : null}
</span>
</p>
) : null}
{hasCoupon ? (
<p className='cfch-coupon'>
<Tag className='cfch-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
<strong>{fill(couponLead, { saving: couponSaving })}</strong>
{couponRest && couponValue ? ` ${fill(couponRest, { value: couponValue })}` : null}
</p>
) : null}
</div>
) : null}
<div className='cfch-action'>{action}</div>
</div>
</div>
) : null}
</header>
</>
);
}
export default CheckoutHeader;
/** Replaces every named {placeholder} in a copy template with its value. */
function fill(template: string, values: Record<string, string>): string {
return Object.keys(values).reduce((text, key) => text.split(`{${key}}`).join(values[key]), template);
}
/** Zero-height marker before the header; sticky mode watches it to know when the header is stuck. */
const SENTINEL_STYLE: React.CSSProperties = { display: 'block', width: '100%', height: 0 };
// Scoped under .cf-checkout-header. Descendant rules use :where() so the scope adds no specificity
// and the approved cascade (hover/active/disabled/stuck overrides) is unchanged.
const CSS = `
.cf-checkout-header{container:cfch / inline-size;position:relative;z-index:30;font-family:var(--font-body,system-ui,sans-serif);color:var(--ink,#1a2233);-webkit-font-smoothing:antialiased}
.cf-checkout-header,.cf-checkout-header *{box-sizing:border-box}
.cf-checkout-header[data-sticky='true']{position:sticky;top:0;z-index:40}
.cf-checkout-header[data-stuck='true']{box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2))}
:where(.cf-checkout-header) .cfch-inner{width:100%;max-width:calc(1120px + 2 * clamp(16px,5cqi,48px));margin-inline:auto;padding-inline:clamp(16px,5cqi,48px)}
:where(.cf-checkout-header) .cfch-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
:where(.cf-checkout-header) .cfch-inline-icon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
:where(.cf-checkout-header) .cfch-bar{background:var(--card,#fff);color:var(--ink,#1a2233)}
.cf-checkout-header[data-offer='false'] .cfch-bar{box-shadow:inset 0 -1px 0 oklch(from var(--ink,#1a2233) l c h / .12)}
:where(.cf-checkout-header) .cfch-bar-grid{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:'brand progress help';align-items:center;column-gap:clamp(24px,4cqi,48px);min-height:80px;padding-block:12px}
:where(.cf-checkout-header) .cfch-brand{grid-area:brand;display:flex;align-items:center;gap:12px;min-width:0}
:where(.cf-checkout-header) .cfch-logo{display:block;width:auto;height:36px;max-width:160px;object-fit:contain;filter:drop-shadow(0 1px 1px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22))}
:where(.cf-checkout-header) .cfch-brand-text{display:flex;align-items:center;gap:16px;min-width:0}
:where(.cf-checkout-header) .cfch-name{min-width:0;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:1.3125rem;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--ink,#1a2233)}
:where(.cf-checkout-header) .cfch-secure{position:relative;display:block;font-size:.9375rem;font-weight:600;line-height:1.4;white-space:nowrap;color:var(--ink,#1a2233)}
:where(.cf-checkout-header) .cfch-secure svg{color:var(--success,#1d7a3f)}
:where(.cf-checkout-header) .cfch-name + .cfch-secure{padding-inline-start:16px}
:where(.cf-checkout-header) .cfch-name + .cfch-secure::before{content:'';position:absolute;left:0;top:50%;width:1px;height:20px;translate:0 -50%;background:oklch(from var(--ink,#1a2233) l c h / .16)}
:where(.cf-checkout-header) .cfch-progress{grid-area:progress;justify-self:center;width:100%;max-width:520px;min-width:0}
:where(.cf-checkout-header) .cfch-count{display:none;margin:0}
:where(.cf-checkout-header) .cfch-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(var(--cfch-n,3),minmax(0,1fr));gap:8px}
:where(.cf-checkout-header) .cfch-step{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0}
:where(.cf-checkout-header) .cfch-seg{position:relative;display:block;height:6px;border-radius:999px;overflow:hidden;background:color-mix(in oklch,var(--ink,#1a2233) 10%,var(--card,#fff))}
:where(.cf-checkout-header) .cfch-seg::after{content:'';position:absolute;inset:0;border-radius:inherit;transform-origin:left center}
:where(.cf-checkout-header) .cfch-step[data-status='done'] .cfch-seg::after{background:var(--success,#1d7a3f)}
:where(.cf-checkout-header) .cfch-step[data-status='current'] .cfch-seg::after{background:var(--accent-fill,var(--accent,#2557c7));animation:cfch-fill .6s cubic-bezier(.2,.7,.2,1) both}
:where(.cf-checkout-header) .cfch-step-label{display:flex;align-items:center;gap:6px;min-width:0;font-size:.875rem;font-weight:700;line-height:1.2;color:var(--muted,#4a5568)}
:where(.cf-checkout-header) .cfch-step-num{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-variant-numeric:tabular-nums}
:where(.cf-checkout-header) .cfch-step-name{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:where(.cf-checkout-header) .cfch-step-check{flex:none;color:var(--success,#1d7a3f)}
:where(.cf-checkout-header) .cfch-step[data-status='done'] .cfch-step-label{color:var(--ink,#1a2233)}
:where(.cf-checkout-header) .cfch-step[data-status='current'] .cfch-step-label{color:var(--ink,#1a2233);font-weight:800}
:where(.cf-checkout-header) .cfch-step[data-status='current'] .cfch-step-num{color:var(--accent,#2557c7)}
:where(.cf-checkout-header) .cfch-help{grid-area:help;position:relative;justify-self:end}
:where(.cf-checkout-header) .cfch-help-btn{--cfch-h:var(--button-2-bg,var(--secondary,#eef0f4));display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 16px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--cfch-h);color:var(--button-2-ink,var(--secondary-ink,#1a2233));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:.9375rem;line-height:1.15;white-space:nowrap;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(0.22 0.03 260 / .2)));transition:background .16s ease,transform .16s ease}
:where(.cf-checkout-header) .cfch-help-btn:hover,:where(.cf-checkout-header) .cfch-help-btn[aria-expanded='true']{background:oklch(from var(--cfch-h) calc(l - .04) c h)}
:where(.cf-checkout-header) .cfch-help-btn:active{transform:translateY(1px)}
:where(.cf-checkout-header) .cfch-help-btn:focus-visible{outline:2px solid var(--field-focus,var(--accent,#2557c7));outline-offset:3px}
:where(.cf-checkout-header) .cfch-help-short{display:none}
:where(.cf-checkout-header) .cfch-panel{position:absolute;top:calc(100% + 10px);right:0;z-index:60;width:min(380px,calc(100cqi - 32px));padding:20px clamp(20px,3cqi,24px) clamp(20px,3cqi,24px);background:var(--card,#fff);color:var(--ink,#1a2233);border:1px solid var(--card-border,color-mix(in oklch,var(--ink,#1a2233) 12%,transparent));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));text-align:left;animation:cfch-pop .3s cubic-bezier(.2,.7,.2,1) both}
:where(.cf-checkout-header) .cfch-panel:focus{outline:none}
:where(.cf-checkout-header) .cfch-panel:focus-visible{outline:2px solid var(--field-focus,var(--accent,#2557c7));outline-offset:2px}
:where(.cf-checkout-header) .cfch-panel-title{margin:0 0 12px;padding-inline-end:40px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.01em);font-size:1.3125rem;line-height:1.15;text-wrap:balance}
:where(.cf-checkout-header) .cfch-note{margin:0 0 12px;font-size:1rem;line-height:1.5;text-wrap:pretty;color:var(--ink,#1a2233)}
:where(.cf-checkout-header) .cfch-note strong{font-weight:800}
:where(.cf-checkout-header) .cfch-close{position:absolute;top:12px;right:12px;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:0;border-radius:min(var(--button-radius,var(--radius,12px)),10px);background:transparent;color:var(--ink,#1a2233);cursor:pointer;transition:background .16s ease}
:where(.cf-checkout-header) .cfch-close:hover{background:color-mix(in oklch,var(--ink,#1a2233) 6%,var(--card,#fff))}
:where(.cf-checkout-header) .cfch-close:focus-visible{outline:2px solid var(--field-focus,var(--accent,#2557c7));outline-offset:2px}
:where(.cf-checkout-header) .cfch-contacts{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:4px}
:where(.cf-checkout-header) .cfch-contact{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 12px;margin-inline:-12px;border-radius:10px;color:var(--ink,#1a2233);text-decoration:none;transition:background .16s ease}
:where(.cf-checkout-header) .cfch-contact:hover{background:color-mix(in oklch,var(--ink,#1a2233) 5%,var(--card,#fff))}
:where(.cf-checkout-header) .cfch-contact:focus-visible{outline:2px solid var(--field-focus,var(--accent,#2557c7));outline-offset:0}
:where(.cf-checkout-header) .cfch-contact svg{flex:none;color:var(--accent,#2557c7)}
:where(.cf-checkout-header) .cfch-contact-text{display:flex;flex-direction:column;gap:2px;min-width:0}
:where(.cf-checkout-header) .cfch-contact-label{font-size:.875rem;font-weight:800;line-height:1.2}
:where(.cf-checkout-header) .cfch-contact-value{font-size:1rem;font-weight:600;line-height:1.4;color:var(--link,var(--accent,#2557c7));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent,#2557c7)) l c h / .45);text-underline-offset:.18em;overflow-wrap:anywhere}
:where(.cf-checkout-header) .cfch-contact:hover .cfch-contact-value{color:oklch(from var(--link,var(--accent,#2557c7)) calc(l - .08) c h);text-decoration-color:currentColor}
:where(.cf-checkout-header) .cfch-hours{margin:12px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty;color:var(--muted,#4a5568)}
:where(.cf-checkout-header) .cfch-strip{background:var(--band,#1b2a4a);color:var(--band-ink,#fff)}
:where(.cf-checkout-header) .cfch-strip-grid{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:'promise deal action';align-items:center;column-gap:clamp(24px,3cqi,40px);row-gap:12px;padding-block:16px}
:where(.cf-checkout-header) .cfch-promise{grid-area:promise;max-width:60ch;margin:0;font-size:1.0625rem;font-weight:500;line-height:1.45;text-wrap:pretty;color:var(--band-ink,#fff)}
:where(.cf-checkout-header) .cfch-promise strong{font-weight:800}
:where(.cf-checkout-header) .cfch-deal{grid-area:deal;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
:where(.cf-checkout-header) .cfch-coupon{display:inline-block;margin:0;padding:5px 12px;border-radius:999px;background:oklch(from var(--band-ink,#fff) l c h / .12);box-shadow:inset 0 0 0 1px oklch(from var(--band-ink,#fff) l c h / .16);font-size:.875rem;font-weight:600;line-height:1.3;white-space:nowrap;color:var(--band-ink,#fff)}
:where(.cf-checkout-header) .cfch-coupon strong{font-weight:800}
:where(.cf-checkout-header) .cfch-coupon .cfch-inline-icon{margin-inline-end:.35em}
:where(.cf-checkout-header) .cfch-price{margin:0;display:flex;align-items:baseline;gap:8px;white-space:nowrap;color:var(--band-ink,#fff)}
:where(.cf-checkout-header) .cfch-price-num{font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.75rem,2.4cqi,2rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
:where(.cf-checkout-header) .cfch-price-note{font-size:.9375rem;font-weight:600;line-height:1.4}
:where(.cf-checkout-header) .cfch-action{grid-area:action;min-width:0}
:where(.cf-checkout-header) .cfch-cta{--cfch-b:var(--button-bg,var(--cta,#d9342b));--cfch-b2:var(--button-bg-2,var(--cta-2,#b8241c));--cfch-sh:var(--shadow,oklch(0.22 0.03 260));position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:56px;padding:0 24px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--cfch-b) calc(l + .04) c h),oklch(from var(--cfch-b2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:1.125rem;line-height:1.15;text-align:center;text-decoration:none;white-space:nowrap;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cfch-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--cfch-b) calc(l - .16) c h),0 1px 2px oklch(from var(--cfch-sh) l c h / .45),0 8px 16px -6px oklch(from var(--cfch-sh) l c h / .55));transition:background .16s ease,box-shadow .16s ease,transform .16s ease;-webkit-tap-highlight-color:transparent}
:where(.cf-checkout-header) .cfch-cta:hover,.cf-checkout-header[data-state='hover'] .cfch-cta{background:linear-gradient(oklch(from var(--cfch-b) calc(l - .01) c h),oklch(from var(--cfch-b2) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cfch-b) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--cfch-b) calc(l - .2) c h),0 1px 2px oklch(from var(--cfch-sh) l c h / .5),0 10px 18px -6px oklch(from var(--cfch-sh) l c h / .65))}
:where(.cf-checkout-header) .cfch-cta:active,.cf-checkout-header[data-state='active'] .cfch-cta{transform:translateY(1px);background:linear-gradient(oklch(from var(--cfch-b) calc(l - .05) c h),oklch(from var(--cfch-b2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--cfch-b) calc(l - .25) c h / .5),inset 0 -2px 0 oklch(from var(--cfch-b) calc(l - .16) c h),0 1px 2px oklch(from var(--cfch-sh) l c h / .4)}
:where(.cf-checkout-header) .cfch-cta:focus-visible{outline:3px solid var(--band-ink,#fff);outline-offset:3px}
:where(.cf-checkout-header) .cfch-cta:disabled,:where(.cf-checkout-header) .cfch-cta:disabled:hover,:where(.cf-checkout-header) .cfch-cta:disabled:active{cursor:not-allowed;transform:none;background:oklch(from var(--band-ink,#fff) l c h / .14);color:var(--band-ink,#fff);text-shadow:none;box-shadow:inset 0 0 0 1px oklch(from var(--band-ink,#fff) l c h / .24)}
:where(.cf-checkout-header) .cfch-cta-short{display:none}
@container cfch (max-width: 1279px){
:where(.cf-checkout-header) .cfch-brand-text{flex-direction:column;align-items:flex-start;gap:2px}
:where(.cf-checkout-header) .cfch-name + .cfch-secure{padding-inline-start:0}
:where(.cf-checkout-header) .cfch-name + .cfch-secure::before{display:none}
}
@container cfch (max-width: 1023px){
:where(.cf-checkout-header) .cfch-bar-grid{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'brand help' 'progress progress';row-gap:12px;min-height:0;padding-block:12px 14px}
:where(.cf-checkout-header) .cfch-progress{justify-self:stretch;max-width:none;display:grid;gap:8px}
:where(.cf-checkout-header) .cfch-count{display:flex;align-items:baseline;gap:8px;min-width:0;font-size:.875rem;line-height:1.2}
:where(.cf-checkout-header) .cfch-count-step{font-weight:800;color:var(--accent,#2557c7);white-space:nowrap}
:where(.cf-checkout-header) .cfch-count-label{min-width:0;font-weight:700;color:var(--ink,#1a2233);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:where(.cf-checkout-header) .cfch-steps{gap:6px}
:where(.cf-checkout-header) .cfch-step{gap:0}
:where(.cf-checkout-header) .cfch-step-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:where(.cf-checkout-header) .cfch-strip-grid{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'promise action' 'deal action';row-gap:8px}
:where(.cf-checkout-header) .cfch-promise{max-width:none}
:where(.cf-checkout-header) .cfch-deal{flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 16px}
}
@container cfch (max-width: 860px){
:where(.cf-checkout-header) .cfch-promise-rest{display:none}
:where(.cf-checkout-header) .cfch-cta-long{display:none}
:where(.cf-checkout-header) .cfch-cta-short{display:inline}
}
@container cfch (max-width: 640px){
:where(.cf-checkout-header) .cfch-help-long{display:none}
:where(.cf-checkout-header) .cfch-help-short{display:inline}
:where(.cf-checkout-header) .cfch-name{font-size:1.125rem}
:where(.cf-checkout-header) .cfch-logo{height:32px}
:where(.cf-checkout-header) .cfch-strip-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:'promise' 'deal' 'action';row-gap:10px;padding-block:12px 14px}
:where(.cf-checkout-header) .cfch-promise{font-size:.9375rem}
:where(.cf-checkout-header) .cfch-deal{justify-content:space-between;flex-wrap:nowrap;gap:12px}
:where(.cf-checkout-header) .cfch-price-num{font-size:1.75rem}
:where(.cf-checkout-header) .cfch-price-more{display:none}
:where(.cf-checkout-header) .cfch-cta{display:flex;width:100%;padding:0 20px}
.cf-checkout-header[data-stuck='true'] .cfch-bar-grid{grid-template-areas:'brand help';row-gap:0}
.cf-checkout-header[data-stuck='true'] .cfch-strip-grid{grid-template-areas:'action';row-gap:0;padding-block:10px}
.cf-checkout-header[data-stuck='true'] .cfch-progress,
.cf-checkout-header[data-stuck='true'] .cfch-promise,
.cf-checkout-header[data-stuck='true'] .cfch-deal{display:none}
}
@keyframes cfch-fill{from{transform:scaleX(.15)}to{transform:scaleX(1)}}
@keyframes cfch-pop{from{opacity:0;transform:translateY(-6px) scale(.98)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){
:where(.cf-checkout-header) .cfch-step[data-status='current'] .cfch-seg::after,:where(.cf-checkout-header) .cfch-panel{animation:none}
:where(.cf-checkout-header) .cfch-cta,:where(.cf-checkout-header) .cfch-help-btn,:where(.cf-checkout-header) .cfch-close,:where(.cf-checkout-header) .cfch-contact{transition:none}
}
`;
pieces/nav/checkout-header/specimen.tsx 41 lines
import __studioImagecba6dfd3 from "../assets/268831891c31f426.webp";
import { CheckoutHeader, type CheckoutHeaderProps } from '../checkout-header';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
const sample = defaults.sample;
const product = sample.name.replace(/^The /, '');
const amount = (value: string) => Number(value.replace(/[^0-9.]/g, ''));
const saving = `$${amount(sample.regularPrice) - amount(sample.price)}`;
export const states = ['default', 'hover', 'active', 'disabled'];
export default function CheckoutHeaderSpecimen({ state = 'default' }: { state?: CheckoutHeaderProps['state'] }) {
return (
<CheckoutHeader
state={state}
sticky
brandName={product}
logoImage={slot('logo', __studioImagecba6dfd3)}
steps={['Your details', 'Secure your kit', 'Instant access']}
currentStep={2}
promiseLead={`You’re one step from the ${product}.`}
promiseText='Finish your details below and the guide, workbook and checklist are yours today.'
couponSaving={saving}
couponValue={sample.regularPrice}
price={sample.price}
priceNote='today'
priceNoteMore='one payment'
actionLabel={`Yes! I want the ${product}`}
actionLabelShort='Yes! I want the Starter Kit'
href='#order-form'
helpNotes={[
{ lead: 'Ask before you buy.', text: 'Email or call and mention your checkout step so we know where you are.' },
{ lead: 'Covered either way.', text: `Your kit comes with a ${sample.guarantee}.` },
]}
supportEmail='support@funnelstarter.example'
supportPhone='(555) 014-2290'
supportHours='Mon–Fri, 9am–5pm ET'
/>
);
}
| Name | Type | Details |
|---|---|---|
brandName OptionalCheckoutHeader |
string |
|
logoImage OptionalCheckoutHeader |
string |
|
logoAlt OptionalCheckoutHeader |
string |
|
logoFallbackAlt OptionalCheckoutHeader |
string |
|
secureLabel OptionalCheckoutHeader |
string |
|
steps OptionalCheckoutHeader |
string[] |
|
currentStep OptionalCheckoutHeader |
number |
|
stepCountLabel OptionalCheckoutHeader |
string |
|
progressLabel OptionalCheckoutHeader |
string |
|
progressAriaLabel OptionalCheckoutHeader |
string |
|
completedLabel OptionalCheckoutHeader |
string |
|
helpLabel OptionalCheckoutHeader |
string |
|
helpLabelShort OptionalCheckoutHeader |
string |
|
helpTitle OptionalCheckoutHeader |
string |
|
helpNotes OptionalCheckoutHeader |
CheckoutHeaderNote[] |
|
emailLabel OptionalCheckoutHeader |
string |
|
supportEmail OptionalCheckoutHeader |
string |
|
phoneLabel OptionalCheckoutHeader |
string |
|
supportPhone OptionalCheckoutHeader |
string |
|
supportHours OptionalCheckoutHeader |
string |
|
closeLabel OptionalCheckoutHeader |
string |
|
showOffer OptionalCheckoutHeader |
boolean |
|
promiseLead OptionalCheckoutHeader |
string |
|
promiseText OptionalCheckoutHeader |
string |
|
couponSaving OptionalCheckoutHeader |
string |
|
couponValue OptionalCheckoutHeader |
string |
|
couponLead OptionalCheckoutHeader |
string |
|
couponRest OptionalCheckoutHeader |
string |
|
price OptionalCheckoutHeader |
string |
|
priceNote OptionalCheckoutHeader |
string |
|
priceNoteMore OptionalCheckoutHeader |
string |
|
actionLabel OptionalCheckoutHeader |
string |
|
actionLabelShort OptionalCheckoutHeader |
string |
|
href OptionalCheckoutHeader |
string |
|
onAction OptionalCheckoutHeader |
(event: React.MouseEvent<HTMLElement>) => void |
|
disabled OptionalCheckoutHeader |
boolean |
|
sticky OptionalCheckoutHeader |
boolean |
|
defaultHelpOpen OptionalCheckoutHeader |
boolean |
|
state OptionalCheckoutHeader |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalCheckoutHeader |
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-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
logo- The brand’s logo mark.
-
268831891c31f426.webp
image/webp · 47.8 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB