Order Form Header 2
Event checkout header: the whole order at a glance (stage photo, pass and dates, what it includes, a live receipt total, secure checkout), collapsing into a slim sticky bar once the buyer reaches the form so the purchase stays vivid while they type.
Use it in a prompt
Use offer/order-form-header-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/offer/order-form-header-2.tsx. - Import it and pass your copy and images (Props tab):
import { OrderFormHeader2 } from "@/components/funneldna/offer/order-form-header-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/order-form-header-2/component.tsx 519 lines
// layout: sticky-offer-side
// Event checkout header: the whole order at a glance (stage photo, pass and dates, what it includes, a live receipt total, secure checkout), collapsing into a slim sticky bar once the buyer reaches the form so the purchase stays vivid while they type.
import * as React from 'react'
import { CalendarDays, Check, Lock, MapPin, Pencil } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
import stage from '../fx/backdrops/stage'
export type OrderFormHeader2Network = 'visa' | 'mastercard' | 'amex' | 'discover'
export type OrderFormHeader2Line = {
label: string
/** Shown as written, e.g. 'Included' or '$29' */
amount: string
}
export type OrderFormHeader2Props = {
eventName?: string
passName?: string
/** Headline in the pass tile */
headline?: string
/** Phrase inside the headline swiped with the marker */
highlight?: string
/** Supplied event dates, e.g. 'May 13–14, 2027' */
dates?: string
venue?: string
/** Stage or venue photo (slot scene) */
sceneImage?: string
sceneImageAlt?: string
/** Small chip on the photo; empty hides it */
photoLabel?: string
includesTitle?: string
/** What the pass includes, three short lines */
includes?: string[]
/** Price of one pass */
unitPrice?: number
/** Number of passes; the receipt and bar totals follow it */
quantity?: number
/** Extra receipt lines under the pass */
extras?: OrderFormHeader2Line[]
/** Amount off the whole order; 0 hides the subtotal and discount lines */
discount?: number
discountLabel?: string
/** ISO currency code for every amount */
currency?: string
locale?: string
secureTitle?: string
secureNote?: string
/** Card marks shown; list only the networks the processor accepts */
networks?: OrderFormHeader2Network[]
/** Plain instruction right above the button */
instruction?: string
actionLabel?: string
/** Where the button goes; defaults to the form (#formId) */
href?: string
onAction?: (event: React.MouseEvent<HTMLElement>) => void
disabled?: boolean
editLabel?: string
/** Where 'Edit order' goes; defaults to this header */
editHref?: string
onEdit?: (event: React.MouseEvent<HTMLAnchorElement>) => void
/** id of the order form; the header collapses once it reaches the upper part of the screen */
formId?: string
/** true shows the collapsed bar in place, false keeps the bento; unset follows the scroll */
collapsed?: boolean
/** px offset for the sticky bar under a fixed page nav */
stickyTop?: number
/** 'active' shows the collapsed bar in place; 'hover' also forces the Edit order hover */
state?: 'default' | 'hover' | 'active'
copy?: {
/** Template with {quantity} and {item} */
lineItem?: string
/** Template with {quantity} and {unit} */
quantity?: string
unit?: string
units?: string
subtotal?: string
total?: string
/** Accessible label on the receipt */
receiptLabel?: string
/** Accessible label on the sticky bar */
barLabel?: string
/** Accessible label on the card marks */
marksLabel?: string
}
id?: string
className?: string
}
export function OrderFormHeader2(props: OrderFormHeader2Props) {
const {
eventName = 'Northlight Live 2027',
passName = 'Two-Day Workshop Pass',
headline = 'You’re one step from Northlight Live 2027',
highlight = 'Northlight Live 2027',
dates = 'May 13–14, 2027',
venue = 'Harbor Hall, Portland, OR',
sceneImage = stage,
sceneImageAlt = 'The event stage lit and ready before the first session',
photoLabel = 'Live · In person',
includesTitle = 'Both days, fully covered',
includes = DEFAULT_INCLUDES,
unitPrice = 397,
quantity = 1,
extras = NO_LINES,
discount = 0,
discountLabel = 'Discount',
currency = 'USD',
locale = 'en-US',
secureTitle = 'Safe, encrypted checkout',
secureNote = 'Pay with any major card.',
networks = DEFAULT_NETWORKS,
instruction = 'Click the button below to get instant access',
actionLabel = 'Order now',
href,
onAction,
disabled = false,
editLabel = 'Edit order',
editHref,
onEdit,
formId = 'order-form',
collapsed,
stickyTop = 0,
state = 'default',
copy,
id = 'order-at-a-glance',
className,
} = props
const c = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const titleId = `${uid}-title`
const qty = Math.max(1, Math.floor(Number(quantity) || 1))
const subtotal = qty * unitPrice
const off = Math.min(Math.max(Number(discount) || 0, 0), subtotal)
const total = subtotal - off
const fmt = (n: number) => money(n, currency, locale)
const qtyText = fill(c.quantity, { quantity: String(qty), unit: qty === 1 ? c.unit : c.units })
const lineText = fill(c.lineItem, { quantity: String(qty), item: passName })
const where = [dates, venue].filter(Boolean).join(' · ')
const forced = state === 'hover' || state === 'active' ? true : collapsed
const controlled = forced !== undefined
const inline = forced === true
const [live, setLive] = React.useState(false)
const sentinel = React.useRef<HTMLDivElement>(null)
React.useEffect(() => {
if (controlled) return
if (typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return
const form = formId ? document.getElementById(formId) : null
const target = form || sentinel.current
if (!target) return
const io = new IntersectionObserver(
(entries) => {
const e = entries[entries.length - 1]
if (!e) return
const above = e.boundingClientRect.top < 0
setLive(form ? e.isIntersecting || above : !e.isIntersecting && above)
},
{ rootMargin: form ? '0px 0px -55% 0px' : '0px', threshold: 0 },
)
io.observe(target)
return () => io.disconnect()
}, [controlled, formId])
const isCollapsed = controlled ? inline : live
const [tick, setTick] = React.useState(0)
const first = React.useRef(true)
React.useEffect(() => {
if (first.current) {
first.current = false
return
}
setTick((t) => t + 1)
}, [total])
const amt = (
<span key={tick} className={tick > 0 ? 'ofh2-amt ofh2-pop' : 'ofh2-amt'}>
{fmt(total)}
</span>
)
const actionHref = href ?? (formId ? `#${formId}` : undefined)
const rootClass = ['cf-order-form-header-2', className].filter(Boolean).join(' ')
return (
<section
id={id}
className={rootClass}
aria-labelledby={titleId}
data-mode={inline ? 'inline' : 'live'}
data-collapsed={isCollapsed ? '' : undefined}
data-state={state === 'default' ? undefined : state}
style={{ ['--ofh-top' as string]: `${stickyTop}px` } as React.CSSProperties}
>
<style>{CSS}</style>
<div className='ofh2-bento'>
<figure className='ofh2-tile ofh2-photo' style={tile(0)}>
<img src={sceneImage} alt={sceneImageAlt} width={1600} height={900} decoding='async' />
{photoLabel ? (
<span className='ofh2-chip'>
<span className='ofh2-dot' aria-hidden='true' />
{photoLabel}
</span>
) : null}
</figure>
<div className='ofh2-tile ofh2-pass' style={tile(1)}>
<div className='ofh2-pass-top'>
<h2 id={titleId} className='ofh2-h'>
{withMark(headline, highlight)}
</h2>
<p className='ofh2-passname'>{passName}</p>
{dates || venue ? (
<ul className='ofh2-facts'>
{dates ? (
<li>
<CalendarDays size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{dates}</span>
</li>
) : null}
{venue ? (
<li>
<MapPin size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{venue}</span>
</li>
) : null}
</ul>
) : null}
</div>
<div className='ofh2-pass-buy'>
<dl className='ofh2-receipt' aria-label={c.receiptLabel}>
<div className='ofh2-row'>
<dt>{lineText}</dt>
<dd>{fmt(subtotal)}</dd>
</div>
{extras.map((line, i) => (
<div className='ofh2-row' key={line.label + i}>
<dt>{line.label}</dt>
<dd>{line.amount}</dd>
</div>
))}
{off > 0 ? (
<>
<div className='ofh2-row'>
<dt>{c.subtotal}</dt>
<dd>{fmt(subtotal)}</dd>
</div>
<div className='ofh2-row' data-kind='save'>
<dt>{discountLabel}</dt>
<dd>−{fmt(off)}</dd>
</div>
</>
) : null}
<div className='ofh2-row' data-kind='total'>
<dt>{c.total}</dt>
<dd aria-live='polite' aria-atomic='true'>
{amt}
</dd>
</div>
</dl>
{instruction ? <p className='ofh2-instr'>{instruction}</p> : null}
{actionHref && !disabled ? (
<a className='ofh2-btn' href={actionHref} onClick={onAction}>
{actionLabel}
</a>
) : (
<button className='ofh2-btn' type='button' disabled={disabled} onClick={onAction}>
{actionLabel}
</button>
)}
{secureTitle || secureNote || networks.length ? (
<div className='ofh2-secure'>
{secureTitle || secureNote ? (
<p className='ofh2-sec-line'>
<Lock className='ofh2-sec-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{secureTitle ? <strong>{secureTitle}</strong> : null}
{secureTitle && secureNote ? ' ' : null}
{secureNote ? <span>{secureNote}</span> : null}
</p>
) : null}
{networks.length ? (
<ul className='ofh2-marks' aria-label={c.marksLabel}>
{networks.map((n) => {
const mark = MARKS[n]
if (!mark) return null
const [name, Mark] = mark
return (
<li key={n}>
<Mark aria-hidden='true' width={40} height={26} />
<span className='ofh2-sr'>{name}</span>
</li>
)
})}
</ul>
) : null}
</div>
) : null}
</div>
</div>
<div className='ofh2-tile ofh2-well ofh2-incl' style={tile(2)}>
<h3 className='ofh2-h3'>{includesTitle}</h3>
<ul className='ofh2-list'>
{includes.map((line, i) => (
<li key={line + i}>
<span className='ofh2-tick' aria-hidden='true'>
<Check size={14} strokeWidth={3} />
</span>
<span>{line}</span>
</li>
))}
</ul>
</div>
</div>
<div ref={sentinel} className='ofh2-sentinel' aria-hidden='true' />
<div className='ofh2-bar' role='region' aria-label={c.barLabel}>
<div className='ofh2-bar-in'>
<img className='ofh2-thumb' src={sceneImage} alt='' width={44} height={44} decoding='async' />
<div className='ofh2-bar-id'>
<p className='ofh2-bar-name'>
{eventName}
<span className='ofh2-wide'> · {passName}</span>
</p>
{where ? <p className='ofh2-bar-sub ofh2-wide'>{where}</p> : null}
<p className='ofh2-bar-sub ofh2-narrow'>
{qtyText} · <strong>{amt}</strong>
</p>
</div>
<span className='ofh2-qty ofh2-wide'>{qtyText}</span>
<p className='ofh2-bar-total ofh2-wide'>
<span className='ofh2-bar-tl'>{c.total}</span>
<span className='ofh2-bar-amt'>{amt}</span>
</p>
<a className='ofh2-edit' href={editHref ?? `#${id}`} onClick={onEdit}>
<Pencil size={16} strokeWidth={2.5} aria-hidden='true' />
{editLabel}
</a>
</div>
</div>
</section>
)
}
export default OrderFormHeader2
const DEFAULT_INCLUDES = ['Both workshop days, 9am–5pm', 'Live build sessions with the team', 'Lunch and coffee on both days']
const DEFAULT_NETWORKS: OrderFormHeader2Network[] = ['visa', 'mastercard', 'amex', 'discover']
const NO_LINES: OrderFormHeader2Line[] = []
const DEFAULT_COPY = {
lineItem: '{quantity} × {item}',
quantity: '{quantity} {unit}',
unit: 'pass',
units: 'passes',
subtotal: 'Subtotal',
total: 'Total',
receiptLabel: 'Your order',
barLabel: 'Your order at a glance',
marksLabel: 'Cards accepted',
}
type MarkIcon = React.ComponentType<React.SVGProps<SVGSVGElement>>
// Official card-network marks keep their own colours (theme-contract exception).
const MARKS: Record<OrderFormHeader2Network, [string, MarkIcon]> = {
visa: ['Visa', Visa as unknown as MarkIcon],
mastercard: ['Mastercard', Mastercard as unknown as MarkIcon],
amex: ['American Express', AmericanExpress as unknown as MarkIcon],
discover: ['Discover', Discover as unknown as MarkIcon],
}
function tile(i: number) {
return { ['--i' as string]: i } as React.CSSProperties
}
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((out, key) => out.split('{' + key + '}').join(vars[key]), template)
}
function money(n: number, currency: string, locale: string) {
const whole = Math.abs(n - Math.round(n)) < 0.005
try {
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: whole ? 0 : 2,
}).format(n)
} catch {
return String(n)
}
}
function withMark(text: string, phrase?: string) {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='ofh2-mk'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
const R = '.cf-order-form-header-2'
// Shadow fallbacks are recipes on --shadow (via --ofh-sh), never fixed colours.
const SH_SM = '0 1px 1px oklch(from var(--ofh-sh) l c h / 0.18), 0 1px 3px oklch(from var(--ofh-sh) l c h / 0.14)'
const SH_MD = '0 1px 2px oklch(from var(--ofh-sh) l c h / 0.22), 0 4px 10px -2px oklch(from var(--ofh-sh) l c h / 0.2)'
const SH_LG = '0 2px 4px oklch(from var(--ofh-sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--ofh-sh) l c h / 0.32)'
const CSS = `
${R}{--ofh-ease:cubic-bezier(.2,.7,.2,1);--ofh-ink:var(--ink, oklch(0.21 0.034 263));--ofh-card:var(--card, #fff);--ofh-line:oklch(from var(--ofh-ink) l c h / 0.12);--ofh-well:color-mix(in oklch, var(--ofh-ink) 5%, var(--surface, #fff));--ofh-sh:var(--shadow, oklch(0.22 0.03 256));--ofh-mk:var(--marker, #fae37c);--ofh-band:var(--band, oklch(0.27 0.067 256));--ofh-band-ink:var(--band-ink, #fff);position:relative;display:block;width:100%;max-width:1120px;margin-inline:auto;scroll-margin-top:calc(var(--ofh-top, 0px) + 16px);color:var(--ofh-ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :is(h2,h3,p,ul,dl,dd,figure){margin:0}
${R} ul{padding:0;list-style:none}
${R} .ofh2-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
${R} .ofh2-bento{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;grid-template-areas:'photo pass' 'incl pass';gap:16px}
${R} .ofh2-tile{min-width:0;border-radius:var(--card-radius, var(--radius, 14px));animation:ofh2-rise .45s var(--ofh-ease) both;animation-delay:calc(var(--i, 0) * .07s)}
${R} .ofh2-photo{grid-area:photo;position:relative;min-height:clamp(240px,24vw,320px);overflow:hidden;border-radius:var(--radius, 12px);background:var(--ofh-band)}
${R} .ofh2-photo img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center 42%}
${R} .ofh2-chip{position:absolute;top:16px;left:16px;display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:4px 12px;border-radius:999px;background:var(--ofh-card);color:var(--ofh-ink);font-size:.875rem;font-weight:800;line-height:1.2;box-shadow:var(--shadow-sm, ${SH_SM})}
${R} .ofh2-dot{flex:0 0 auto;width:8px;height:8px;border-radius:50%;background:var(--accent-fill, var(--accent))}
${R} .ofh2-pass{grid-area:pass;display:flex;flex-direction:column;padding:clamp(20px,3vw,32px);background:var(--ofh-card);border:1px solid color-mix(in oklch, var(--accent) 26%, var(--ofh-card));box-shadow:inset 0 1px 0 oklch(from var(--ofh-card) calc(l + .04) c h / .6), var(--card-shadow, var(--shadow-lg, ${SH_LG}))}
${R} .ofh2-pass-top{min-width:0}
${R} .ofh2-pass-buy{min-width:0;margin-top:auto;padding-top:24px}
${R} .ofh2-h{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(1.75rem,2.3vw,2.125rem);line-height:1.08;text-wrap:balance}
${R} .ofh2-mk{color:var(--marker-ink, currentColor);background-image:linear-gradient(var(--ofh-mk),var(--ofh-mk));background-repeat:no-repeat;background-size:100% .9em;background-position:0 86%;padding:0 .12em;margin:0 -.04em;border-radius:.2em .42em .24em .36em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .ofh2-passname{margin-top:12px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
${R} .ofh2-facts{display:grid;gap:8px;margin-top:16px}
${R} .ofh2-facts li{display:flex;align-items:flex-start;gap:8px;font-weight:600;line-height:1.35}
${R} .ofh2-facts svg{flex:0 0 auto;margin-top:.1em;color:var(--accent)}
${R} .ofh2-receipt{padding:16px 18px;border-radius:10px;background:color-mix(in oklch, var(--ofh-ink) 4%, var(--ofh-card));font-variant-numeric:tabular-nums}
${R} .ofh2-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:.9375rem;font-weight:500;line-height:1.4}
${R} .ofh2-row+.ofh2-row{margin-top:6px}
${R} .ofh2-row dt{min-width:0;text-wrap:pretty}
${R} .ofh2-row dd{flex:0 0 auto;font-weight:700;white-space:nowrap}
${R} .ofh2-row[data-kind='save'] dd{color:var(--success)}
${R} .ofh2-row[data-kind='total']{margin-top:16px;font-size:1.0625rem;font-weight:800}
${R} .ofh2-row[data-kind='total'] dd{font-family:var(--font-display);font-weight:800;font-size:clamp(1.75rem,2.4vw,2.25rem);letter-spacing:-.03em;line-height:1}
${R} .ofh2-amt{display:inline-block}
${R} .ofh2-pop{animation:ofh2-pop .3s var(--ofh-ease) both}
${R} .ofh2-instr{margin-top:16px;font-size:.9375rem;font-weight:600;line-height:1.4;text-align:center;text-wrap:pretty}
${R} .ofh2-btn{--bb:var(--button-bg, var(--cta, oklch(0.58 0.21 29)));--bb2:var(--button-bg-2, var(--cta-2, oklch(0.51 0.2 29)));--d:0;position:relative;display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:64px;margin-top:12px;padding:0 28px;border:0;border-radius:var(--button-radius, var(--radius, 12px));background:linear-gradient(oklch(from var(--bb) calc(l + .04 - var(--d)) c h), oklch(from var(--bb2) calc(l - .02 - var(--d)) c h));color:var(--button-ink, var(--cta-ink, #fff));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-decoration:none;text-shadow:var(--button-text-shadow, none);white-space:nowrap;cursor:pointer;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--bb) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--bb) calc(l - .16) c h), 0 1px 2px oklch(from var(--ofh-sh) l c h / .3), 0 8px 16px -6px oklch(from var(--ofh-sh) l c h / .45));transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
${R} .ofh2-btn:hover{--d:.05;box-shadow:inset 0 1px 0 oklch(from var(--bb) calc(l + .1) c h / .7), inset 0 -3px 0 oklch(from var(--bb) calc(l - .2) c h), 0 1px 2px oklch(from var(--ofh-sh) l c h / .32), 0 10px 18px -6px oklch(from var(--ofh-sh) l c h / .55)}
${R} .ofh2-btn:active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--bb) calc(l - .22) c h / .45), inset 0 -2px 0 oklch(from var(--bb) calc(l - .16) c h), 0 1px 2px oklch(from var(--ofh-sh) l c h / .3)}
${R} .ofh2-btn:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
${R} .ofh2-btn:disabled{cursor:not-allowed;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, ${SH_SM}));transform:none}
${R} .ofh2-well{padding:clamp(20px,2.6vw,28px);background:var(--ofh-well);border:1px solid var(--ofh-line)}
${R} .ofh2-incl{grid-area:incl}
${R} .ofh2-h3{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-.01em;text-wrap:balance}
${R} .ofh2-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px 24px;margin-top:16px}
${R} .ofh2-list li{display:flex;align-items:flex-start;gap:12px;font-weight:600;line-height:1.35;text-wrap:pretty}
${R} .ofh2-tick{flex:0 0 auto;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--success);color:var(--success-ink, #fff)}
${R} .ofh2-secure{display:grid;justify-items:center;gap:12px;margin-top:16px;text-align:center}
${R} .ofh2-sec-line{font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .ofh2-sec-line strong{color:var(--ofh-ink);font-weight:800}
${R} .ofh2-sec-icon{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em;color:var(--accent)}
${R} .ofh2-marks{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
${R} .ofh2-marks li{display:flex}
${R} .ofh2-marks svg{display:block;width:40px;height:26px;filter:drop-shadow(0 1px 1px oklch(from var(--ofh-sh) l c h / .18))}
${R} .ofh2-sentinel{height:1px;margin-top:-1px}
${R} .ofh2-bar{position:fixed;left:0;right:0;top:var(--ofh-top, 0px);z-index:60;background:var(--ofh-band);color:var(--ofh-band-ink);box-shadow:var(--shadow-md, ${SH_MD});transform:translateY(calc(-100% - var(--ofh-top, 0px) - 12px));visibility:hidden;transition:transform .32s var(--ofh-ease),visibility 0s linear .32s}
${R}[data-collapsed] .ofh2-bar{transform:none;visibility:visible;transition:transform .32s var(--ofh-ease),visibility 0s}
${R}[data-mode='inline'] .ofh2-bar{position:relative;top:auto;transform:none;visibility:visible;transition:none;border-radius:var(--radius, 12px)}
${R}[data-mode='inline'] .ofh2-bento{display:none}
${R} .ofh2-bar-in{display:flex;align-items:center;gap:16px;max-width:1120px;min-height:68px;margin-inline:auto;padding:10px clamp(16px,5vw,48px)}
${R}[data-mode='inline'] .ofh2-bar-in{padding-inline:clamp(16px,2.5vw,24px)}
${R} .ofh2-thumb{flex:0 0 auto;display:block;width:44px;height:44px;border-radius:8px;object-fit:cover}
${R} .ofh2-bar-id{flex:1 1 auto;min-width:0;display:grid;gap:2px}
${R} .ofh2-bar-name{font-size:1.0625rem;font-weight:800;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
${R} .ofh2-bar-sub{font-size:.9375rem;font-weight:500;line-height:1.3;color:color-mix(in oklab, var(--ofh-band-ink) 84%, var(--ofh-band));white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
${R} .ofh2-bar-sub strong{color:var(--ofh-band-ink);font-weight:800}
${R} .ofh2-qty{flex:0 0 auto;display:inline-flex;align-items:center;min-height:30px;padding:4px 12px;border-radius:999px;background:oklch(from var(--ofh-band-ink) l c h / .12);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap}
${R} .ofh2-bar-total{flex:0 0 auto;display:grid;justify-items:end;gap:4px;line-height:1}
${R} .ofh2-bar-tl{font-size:.875rem;font-weight:800;color:color-mix(in oklab, var(--ofh-band-ink) 84%, var(--ofh-band))}
${R} .ofh2-bar-amt{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);letter-spacing:-.02em;font-variant-numeric:tabular-nums}
${R} .ofh2-edit{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 4px;border-radius:6px;color:var(--ofh-band-ink);font-size:.9375rem;font-weight:700;text-decoration:underline;text-decoration-color:oklch(from var(--ofh-band-ink) l c h / .5);text-decoration-thickness:1px;text-underline-offset:.22em;transition:text-decoration-color .16s ease,text-decoration-thickness .16s ease,transform .16s ease}
${R} .ofh2-edit:hover,${R}[data-state='hover'] .ofh2-edit{text-decoration-color:currentColor;text-decoration-thickness:2px}
${R} .ofh2-edit:active{transform:translateY(1px)}
${R} .ofh2-edit:focus-visible{outline:3px solid var(--ofh-band-ink);outline-offset:2px}
${R} .ofh2-narrow{display:none}
@keyframes ofh2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ofh2-pop{from{transform:scale(.9)}to{transform:none}}
@media (max-width:959px){
${R} .ofh2-bento{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:'photo' 'pass' 'incl'}
${R} .ofh2-photo{min-height:0;aspect-ratio:21/9}
${R} .ofh2-pass{flex-direction:row;align-items:flex-start;gap:32px}
${R} .ofh2-pass-top{flex:1 1 0}
${R} .ofh2-pass-buy{flex:0 0 48%;margin-top:0;padding-top:0}
}
@media (max-width:599px){
${R} .ofh2-bento{gap:12px}
${R} .ofh2-photo{aspect-ratio:16/9}
${R} .ofh2-pass{flex-direction:column;gap:0}
${R} .ofh2-pass-top{flex:none}
${R} .ofh2-pass-buy{flex:none;padding-top:24px}
${R} .ofh2-chip{top:12px;left:12px}
${R} .ofh2-wide{display:none}
${R} .ofh2-narrow{display:block}
${R} .ofh2-bar-in{min-height:60px;gap:12px}
${R} .ofh2-thumb{width:40px;height:40px}
}
@media (prefers-reduced-motion:reduce){
${R} .ofh2-tile,${R} .ofh2-pop{animation:none}
${R} .ofh2-bar,${R}[data-collapsed] .ofh2-bar,${R} .ofh2-btn,${R} .ofh2-edit{transition:none}
${R} .ofh2-btn:active,${R} .ofh2-edit:active{transform:none}
}
`
pieces/offer/order-form-header-2/specimen.tsx 37 lines
import __studioImage61fd86bd from "../assets/03b5242e99de8868.webp";
// Specimen: the Northlight Live 2027 checkout header. Default shows the expanded bento; hover and active show the collapsed sticky bar in place.
import * as React from 'react'
import { OrderFormHeader2 } from '../order-form-header-2'
import { slot } from '../../slots'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active']
export default function OrderFormHeader2Specimen({ state = 'default' }: { state?: 'default' | 'hover' | 'active' }) {
const workbook = defaults.sample.items[1]?.name ?? 'Page Copy Workbook'
return (
<OrderFormHeader2
state={state}
eventName='Northlight Live 2027'
passName='Two-Day Workshop Pass'
headline='You’re one step from Northlight Live 2027'
highlight='Northlight Live 2027'
dates='May 13–14, 2027'
venue='Harbor Hall, Portland, OR'
sceneImage={slot('scene', __studioImage61fd86bd)}
sceneImageAlt='The Northlight Live stage lit and ready before the first session'
photoLabel='Live · In person'
includesTitle='Both days, fully covered'
includes={['Both workshop days, 9am–5pm', 'Live build sessions with the Northlight team', 'Lunch and coffee on both days']}
unitPrice={397}
quantity={2}
extras={[{ label: `${workbook} (printed)`, amount: 'Included' }]}
discount={100}
discountLabel='Two-pass saving'
secureTitle='Safe, encrypted checkout'
secureNote='Pay with any major card.'
instruction='Click the button below to reserve your passes'
actionLabel='Order now'
/>
)
}
| Name | Type | Details |
|---|---|---|
eventName OptionalOrderFormHeader2 |
string |
|
passName OptionalOrderFormHeader2 |
string |
|
headline OptionalOrderFormHeader2 |
string |
|
highlight OptionalOrderFormHeader2 |
string |
|
dates OptionalOrderFormHeader2 |
string |
|
venue OptionalOrderFormHeader2 |
string |
|
sceneImage OptionalOrderFormHeader2 |
string |
|
sceneImageAlt OptionalOrderFormHeader2 |
string |
|
photoLabel OptionalOrderFormHeader2 |
string |
|
includesTitle OptionalOrderFormHeader2 |
string |
|
includes OptionalOrderFormHeader2 |
string[] |
|
unitPrice OptionalOrderFormHeader2 |
number |
|
quantity OptionalOrderFormHeader2 |
number |
|
extras OptionalOrderFormHeader2 |
OrderFormHeader2Line[] |
|
discount OptionalOrderFormHeader2 |
number |
|
discountLabel OptionalOrderFormHeader2 |
string |
|
currency OptionalOrderFormHeader2 |
string |
|
locale OptionalOrderFormHeader2 |
string |
|
secureTitle OptionalOrderFormHeader2 |
string |
|
secureNote OptionalOrderFormHeader2 |
string |
|
networks OptionalOrderFormHeader2 |
OrderFormHeader2Network[] |
|
instruction OptionalOrderFormHeader2 |
string |
|
actionLabel OptionalOrderFormHeader2 |
string |
|
href OptionalOrderFormHeader2 |
string |
|
onAction OptionalOrderFormHeader2 |
(event: React.MouseEvent<HTMLElement>) => void |
|
disabled OptionalOrderFormHeader2 |
boolean |
|
editLabel OptionalOrderFormHeader2 |
string |
|
editHref OptionalOrderFormHeader2 |
string |
|
onEdit OptionalOrderFormHeader2 |
(event: React.MouseEvent<HTMLAnchorElement>) => void |
|
formId OptionalOrderFormHeader2 |
string |
|
collapsed OptionalOrderFormHeader2 |
boolean |
|
stickyTop OptionalOrderFormHeader2 |
number |
|
state OptionalOrderFormHeader2 |
'default' | 'hover' | 'active' |
|
copy OptionalOrderFormHeader2 |
{
/** Template with {quantity} and {item} */
lineItem?: string
/** Template with {quantity} and {unit} */
quantity?: string
unit?: string
units?: string
subtotal?: string
total?: string
/** Accessible label on the receipt */
receiptLabel?: string
/** Accessible label on the sticky bar */
barLabel?: string
/** Accessible label on the card marks */
marksLabel?: string
} |
|
id OptionalOrderFormHeader2 |
string |
|
className OptionalOrderFormHeader2 |
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--button-2-shadow- Secondary button.
--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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
03b5242e99de8868.webp
image/webp · 56.2 KB
-
44c4a68a8f1604d6.webp
image/webp · 18.4 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB