Tabbed Demo Hero 1
Tabbed demo hero: a bold promise and bold-lead-in facts beside a guided, tabbed product tour, so visitors watch booking, prep and cost work before they click.
Use it in a prompt
Use hero/tabbed-demo-hero 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/hero/tabbed-demo-hero.tsx. - Import it and pass your copy and images (Props tab):
import { TabbedDemoHero } from "@/components/funneldna/hero/tabbed-demo-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/tabbed-demo-hero/component.tsx 826 lines
// layout: bento-grid
// Tabbed demo hero: a bold promise and bold-lead-in facts beside a guided, tabbed product tour, so visitors watch booking, prep and cost work before they click.
import React, { useEffect, useId, useRef, useState } from 'react';
import { useReducedMotion } from 'motion/react';
import {
BellRing,
CalendarCheck2,
CalendarDays,
Check,
CircleAlert,
ClipboardCheck,
CreditCard,
FileText,
Lock,
MessageSquareText,
Pause,
Play,
ReceiptText,
UserRound,
} from 'lucide-react';
import { FX_HOST, Pattern } from '../fx/fx';
export type TabbedDemoIcon = 'calendar' | 'checklist' | 'receipt' | 'user' | 'bell' | 'message' | 'card' | 'file';
export type TabbedDemoBookingPanel = {
type: 'booking';
title: string;
lead?: string;
serviceLabel?: string;
services?: string[];
dayLabel?: string;
days: { label: string; sub?: string }[];
timeLabel?: string;
times: string[];
unavailable?: string[]; // times shown struck through and not bookable
actionLabel: string;
error?: string; // inline error when no time is chosen
note?: string;
};
export type TabbedDemoChecklistPanel = {
type: 'checklist';
title: string;
lead?: string;
items: { label: string; detail?: string; done?: boolean }[];
progress?: string; // template with {done} and {total}
actionLabel: string;
note?: string;
};
export type TabbedDemoLedgerPanel = {
type: 'ledger';
title: string;
lead?: string;
lines: { label: string; value: string }[]; // supplied values only, never computed
totalLabel: string;
total: string;
todayLabel: string;
today: string;
note?: string;
actionLabel: string;
};
export type TabbedDemoFormPanel = {
type: 'form';
title: string;
lead?: string;
fields: { name: string; label: string; type?: 'text' | 'email' | 'tel'; autoComplete?: string; placeholder?: string }[];
actionLabel: string;
note?: string;
requiredError?: string; // template with {label}
emailError?: string;
};
export type TabbedDemoPanel = TabbedDemoBookingPanel | TabbedDemoChecklistPanel | TabbedDemoLedgerPanel | TabbedDemoFormPanel;
export type TabbedDemoTab = { id: string; label: string; icon?: TabbedDemoIcon; panel: TabbedDemoPanel };
export type TabbedDemoHeroProps = {
headline?: React.ReactNode;
highlight?: string; // phrase inside a string headline that gets one marker stroke
lead?: React.ReactNode;
actionLabel?: string;
href?: string; // destination of the main action and of plain card actions
reassurance?: string; // one short line under the main button
facts?: { lead: string; text: string }[]; // short points, each opened by a bold lead-in
sceneImage?: string; // slot: scene
sceneAlt?: string;
tabs?: TabbedDemoTab[];
cardBrand?: string; // business name at the top of each demo card
logoImage?: string; // slot: logo
logoAlt?: string;
autoAdvance?: boolean;
autoAdvanceMs?: number;
initialTab?: number;
copy?: { tourLabel?: string; pause?: string; play?: string };
onAction?: (source: string) => void; // 'hero' or the id of the tab whose card button was pressed
onSubmit?: (values: Record<string, string>, tabId: string) => void; // validated booking or form values
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
export function TabbedDemoHero(props: TabbedDemoHeroProps) {
const {
headline = 'Let clients book, prep and see the cost before they arrive',
highlight = 'before they arrive',
lead = 'Give every visitor a guided look at how it works, then let them pick a time on the spot.',
actionLabel = 'Book my first visit',
href,
reassurance = 'Choose your time online · No phone call needed',
facts = DEFAULT_FACTS,
sceneImage,
sceneAlt = '',
tabs = DEFAULT_TABS,
cardBrand,
logoImage,
logoAlt = '',
autoAdvance = true,
autoAdvanceMs = 7000,
initialTab = 0,
copy,
onAction,
onSubmit,
state = 'default',
className,
} = props;
const text = {
tourLabel: copy?.tourLabel ?? 'See how it works',
pause: copy?.pause ?? 'Pause the tour',
play: copy?.play ?? 'Play the tour',
};
const uid = useId().replace(/:/g, '');
const reduce = useReducedMotion();
const n = tabs.length;
const [active, setActive] = useState(() => Math.max(0, Math.min(initialTab, n - 1)));
const [tour, setTour] = useState<'playing' | 'paused' | 'stopped'>('playing');
const tabRefs = useRef<Array<HTMLButtonElement | null>>([]);
const listRef = useRef<HTMLDivElement | null>(null);
const current = n ? Math.min(active, n - 1) : 0;
const autoOn = autoAdvance && !reduce && n > 1 && state === 'default';
const disabled = state === 'disabled';
const forceError = state === 'error';
const tabId = (i: number) => `${uid}-tab-${i}`;
const panelId = (i: number) => `${uid}-panel-${i}`;
useEffect(() => {
const list = listRef.current;
const tab = tabRefs.current[current];
if (!list || !tab || list.scrollWidth <= list.clientWidth + 1) return;
const left = tab.offsetLeft - (list.clientWidth - tab.offsetWidth) / 2;
list.scrollTo({ left: Math.max(0, left), behavior: reduce ? 'auto' : 'smooth' });
}, [current, reduce]);
const stopTour = () => setTour('stopped');
const pick = (i: number) => {
stopTour();
setActive(i);
};
const onTabKey = (e: React.KeyboardEvent<HTMLDivElement>) => {
const moves: Record<string, number> = { ArrowRight: current + 1, ArrowLeft: current - 1, Home: 0, End: n - 1 };
if (!(e.key in moves)) return;
e.preventDefault();
const target = (moves[e.key] + n) % n;
pick(target);
tabRefs.current[target]?.focus();
};
const onProgressEnd = (e: React.AnimationEvent<HTMLElement>) => {
if (e.animationName === 'cf-tdh-progress') setActive((a) => (a + 1) % n);
};
const prev = n > 2 ? (current - 1 + n) % n : -1;
const next = n > 1 ? (current + 1) % n : -1;
const shared: SharedCardProps = { disabled, forceError, href, onAction, onSubmit, brand: cardBrand, logo: logoImage, logoAlt };
const hasAside = Boolean(sceneImage) || facts.length > 0;
const stageStyle = { ...FX_HOST, '--tdh-interval': `${autoAdvanceMs}ms` } as React.CSSProperties;
const heroClass = ['tdh-btn--hero', state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : ''].filter(Boolean).join(' ');
return (
<section className={['cf-tabbed-demo-hero', className].filter(Boolean).join(' ')} aria-labelledby={`${uid}-h`}>
<style>{CSS}</style>
<div className={hasAside ? 'tdh-wrap' : 'tdh-wrap is-solo'}>
<div className='tdh-promise'>
<h1 id={`${uid}-h`} className='tdh-h1'>
{typeof headline === 'string' ? <Highlighted text={headline} phrase={highlight} /> : headline}
</h1>
{lead ? <p className='tdh-lead'>{lead}</p> : null}
<div className='tdh-action'>
<ActionButton className={heroClass} label={actionLabel} href={href} disabled={disabled} onClick={() => onAction?.('hero')} />
{reassurance ? (
<p className='tdh-reassure'>
<CalendarCheck2 className='tdh-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</div>
</div>
{hasAside ? (
<div className={sceneImage ? 'tdh-aside' : 'tdh-aside is-text'}>
{sceneImage ? (
<img className='tdh-photo' src={sceneImage} alt={sceneAlt} width={900} height={563} loading='eager' decoding='async' />
) : null}
{facts.length ? (
<div className='tdh-facts'>
{facts.map((f) => (
<p key={f.lead}>
<strong>{f.lead}</strong> {f.text}
</p>
))}
</div>
) : null}
</div>
) : null}
{n > 0 ? (
<div className={tour === 'paused' ? 'tdh-stage is-paused' : 'tdh-stage'} style={stageStyle}>
<Pattern name='grid' fade='edges' />
<div className='tdh-stage-body'>
<div className='tdh-tabbar'>
<div className='tdh-tablist' role='tablist' aria-label={text.tourLabel} ref={listRef} onKeyDown={onTabKey}>
{tabs.map((tab, i) => {
const Icon = ICONS[tab.icon ?? 'calendar'];
const on = i === current;
const forcedHover = state === 'hover' && i === next;
return (
<button
key={tab.id}
ref={(el) => {
tabRefs.current[i] = el;
}}
id={tabId(i)}
type='button'
role='tab'
aria-selected={on}
aria-controls={panelId(i)}
tabIndex={on ? 0 : -1}
className={forcedHover ? 'tdh-tab is-hover' : 'tdh-tab'}
onClick={() => pick(i)}
>
<Icon className='tdh-tab-icon' size={18} strokeWidth={2.5} aria-hidden='true' />
<span>{tab.label}</span>
{on && autoOn && tour !== 'stopped' ? (
<span className='tdh-progress' aria-hidden='true'>
<i key={current} onAnimationEnd={onProgressEnd} />
</span>
) : null}
</button>
);
})}
</div>
{autoOn ? (
<button
type='button'
className='tdh-pause'
aria-label={tour === 'playing' ? text.pause : text.play}
onClick={() => setTour((t) => (t === 'playing' ? 'paused' : 'playing'))}
>
{tour === 'playing' ? <Pause size={16} strokeWidth={2.5} aria-hidden='true' /> : <Play size={16} strokeWidth={2.5} aria-hidden='true' />}
</button>
) : null}
</div>
<div className='tdh-deck' onPointerDown={stopTour}>
<div className='tdh-side tdh-side--prev'>
{prev >= 0 ? <Ghost key={`p-${prev}`} side='prev' tab={tabs[prev]} onPick={() => pick(prev)} shared={shared} /> : null}
</div>
<div className='tdh-center' onKeyDown={stopTour}>
{tabs.map((tab, i) => (
<div key={tab.id} id={panelId(i)} role='tabpanel' aria-labelledby={tabId(i)} className='tdh-panel' data-on={i === current ? 'true' : 'false'}>
<PanelCard {...shared} panel={tab.panel} tabId={tab.id} />
</div>
))}
</div>
<div className='tdh-side tdh-side--next'>
{next >= 0 ? <Ghost key={`n-${next}`} side='next' tab={tabs[next]} onPick={() => pick(next)} shared={shared} /> : null}
</div>
</div>
</div>
</div>
) : null}
</div>
</section>
);
}
export default TabbedDemoHero;
type SharedCardProps = {
disabled: boolean;
forceError: boolean;
href?: string;
onAction?: (source: string) => void;
onSubmit?: (values: Record<string, string>, tabId: string) => void;
brand?: string;
logo?: string;
logoAlt?: string;
};
type CardProps<P> = SharedCardProps & { panel: P; tabId: string };
type InnerProps<P> = CardProps<P> & { head: React.ReactNode };
const ICONS: Record<TabbedDemoIcon, typeof CalendarDays> = {
calendar: CalendarDays,
checklist: ClipboardCheck,
receipt: ReceiptText,
user: UserRound,
bell: BellRing,
message: MessageSquareText,
card: CreditCard,
file: FileText,
};
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]+$/;
const DEFAULT_FACTS = [
{ lead: 'Real open times.', text: 'Visitors pick a slot you can actually fill, any hour of the day.' },
{ lead: 'Forms done at home.', text: 'Everything you need arrives before they do.' },
{ lead: 'No surprises.', text: 'Show what a visit includes before anyone books.' },
];
const DEFAULT_TABS: TabbedDemoTab[] = [
{
id: 'book',
label: 'Book online',
icon: 'calendar',
panel: {
type: 'booking',
title: 'Pick your appointment',
lead: 'Choose a time that suits you.',
serviceLabel: 'What do you need?',
services: ['First visit', 'Follow-up', 'Consultation'],
dayLabel: 'Day',
days: [{ label: 'Mon' }, { label: 'Tue' }, { label: 'Wed' }, { label: 'Thu' }],
timeLabel: 'Time',
times: ['9:00 am', '11:30 am', '2:00 pm', '4:30 pm', '6:00 pm', '7:15 pm'],
actionLabel: 'Book my appointment',
error: 'Choose a time to continue.',
},
},
{
id: 'prep',
label: 'Get ready',
icon: 'checklist',
panel: {
type: 'checklist',
title: 'Arrive with everything done',
lead: 'Tick these off before your visit.',
items: [{ label: 'Contact details' }, { label: 'A few questions about you' }, { label: 'Consent form' }],
progress: '{done} of {total} done',
actionLabel: 'Finish my forms',
},
},
{
id: 'account',
label: 'Your account',
icon: 'user',
panel: {
type: 'form',
title: 'Keep it all in one place',
lead: 'Visits, forms and receipts in your account.',
fields: [
{ name: 'name', label: 'Full name', autoComplete: 'name', placeholder: 'Jane Smith' },
{ name: 'email', label: 'Email address', type: 'email', autoComplete: 'email', placeholder: 'you@example.com' },
],
actionLabel: 'Create my account',
note: 'We’ll email you a secure sign-in link.',
},
},
];
function setInert(el: HTMLElement | null) {
if (el) el.setAttribute('inert', '');
}
function defaultPlaceholder(type?: string, name?: string) {
if (type === 'email') return 'you@example.com';
if (type === 'tel') return '(555) 123-4567';
if (name && /name/i.test(name)) return 'Jane Smith';
return 'Type your answer';
}
function Highlighted({ text, phrase }: { text: string; phrase?: string }) {
const at = phrase ? text.toLowerCase().indexOf(phrase.toLowerCase()) : -1;
if (!phrase || at < 0) return <>{text}</>;
return (
<>
{text.slice(0, at)}
<span className='tdh-mark'>{text.slice(at, at + phrase.length)}</span>
{text.slice(at + phrase.length)}
</>
);
}
// Primary action: always the .tdh-btn recipe (reads --button-bg, --button-bg-2, --button-ink, --button-radius, --button-font, --button-weight, --button-shadow); className adds the size modifier.
function ActionButton({ className, label, href, disabled, onClick }: { className: string; label: string; href?: string; disabled?: boolean; onClick?: () => void }) {
if (href && !disabled) {
return (
<a className={`tdh-btn ${className}`} href={href} onClick={onClick}>
{label}
</a>
);
}
return (
<button type='button' className={`tdh-btn ${className}`} disabled={disabled} onClick={onClick}>
{label}
</button>
);
}
function Ghost({ side, tab, onPick, shared }: { side: 'prev' | 'next'; tab: TabbedDemoTab; onPick: () => void; shared: SharedCardProps }) {
return (
<div className={`tdh-ghost tdh-ghost--${side}`} aria-hidden='true' onClick={onPick}>
<div className='tdh-ghost-body' ref={setInert}>
<PanelCard {...shared} disabled={false} forceError={false} panel={tab.panel} tabId={tab.id} />
</div>
</div>
);
}
function PanelCard(props: CardProps<TabbedDemoPanel>) {
const { panel } = props;
const head = (
<>
{props.brand || props.logo ? (
<p className='tdh-brand'>
{props.logo ? <img className='tdh-logo' src={props.logo} alt={props.logoAlt ?? ''} /> : null}
{props.brand ? <span>{props.brand}</span> : null}
</p>
) : null}
<h2 className='tdh-card-title'>{panel.title}</h2>
{panel.lead ? <p className='tdh-card-lead'>{panel.lead}</p> : null}
</>
);
return (
<div className='tdh-card'>
{panel.type === 'booking' ? <BookingCard {...props} panel={panel} head={head} /> : null}
{panel.type === 'checklist' ? <ChecklistCard {...props} panel={panel} head={head} /> : null}
{panel.type === 'ledger' ? <LedgerCard {...props} panel={panel} head={head} /> : null}
{panel.type === 'form' ? <FormCard {...props} panel={panel} head={head} /> : null}
</div>
);
}
function BookingCard({ panel, head, tabId, disabled, forceError, onSubmit, onAction }: InnerProps<TabbedDemoBookingPanel>) {
const uid = useId().replace(/:/g, '');
const services = panel.services ?? [];
const blocked = panel.unavailable ?? [];
const [service, setService] = useState(services[0] ?? '');
const [day, setDay] = useState(panel.days[0]?.label ?? '');
const [time, setTime] = useState('');
const [tried, setTried] = useState(false);
const showError = (tried || forceError) && !time;
const errId = `${uid}-err`;
const submit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled) return;
if (!time) {
setTried(true);
return;
}
const values = { service, day, time };
if (onSubmit) onSubmit(values, tabId);
else onAction?.(tabId);
};
return (
<form className='tdh-form' noValidate onSubmit={submit}>
{head}
{services.length ? (
<fieldset className='tdh-fs'>
<legend className='tdh-label'>{panel.serviceLabel ?? 'What do you need?'}</legend>
<div className='tdh-opts'>
{services.map((s) => (
<label key={s} className='tdh-chip tdh-chip--pill'>
<input type='radio' name={`${uid}-service`} value={s} checked={service === s} onChange={() => setService(s)} />
<span>{s}</span>
</label>
))}
</div>
</fieldset>
) : null}
{panel.days.length ? (
<fieldset className='tdh-fs'>
<legend className='tdh-label'>{panel.dayLabel ?? 'Day'}</legend>
<div className='tdh-opts tdh-opts--grid tdh-opts--days' style={{ '--tdh-cols': Math.min(panel.days.length, 5) } as React.CSSProperties}>
{panel.days.map((d) => (
<label key={d.label} className='tdh-chip tdh-chip--day'>
<input type='radio' name={`${uid}-day`} value={d.label} checked={day === d.label} onChange={() => setDay(d.label)} />
{d.sub ? (
<>
<small>{d.label}</small>
<span>{d.sub}</span>
</>
) : (
<span>{d.label}</span>
)}
</label>
))}
</div>
</fieldset>
) : null}
<fieldset className={showError ? 'tdh-fs is-invalid' : 'tdh-fs'} aria-describedby={showError ? errId : undefined}>
<legend className='tdh-label'>{panel.timeLabel ?? 'Time'}</legend>
<div className='tdh-opts tdh-opts--grid tdh-opts--times' style={{ '--tdh-cols': 3 } as React.CSSProperties}>
{panel.times.map((t) => (
<label key={t} className='tdh-chip'>
<input type='radio' name={`${uid}-time`} value={t} checked={time === t} disabled={blocked.includes(t)} onChange={() => setTime(t)} />
<span>{t}</span>
</label>
))}
</div>
</fieldset>
{showError ? (
<p className='tdh-error' id={errId} role='alert'>
<CircleAlert className='tdh-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{panel.error ?? 'Choose a time to continue.'}
</p>
) : null}
<button type='submit' className='tdh-btn tdh-btn--card' disabled={disabled}>
{panel.actionLabel}
</button>
{panel.note ? <p className='tdh-fine'>{panel.note}</p> : null}
</form>
);
}
function ChecklistCard({ panel, head, tabId, disabled, href, onAction }: InnerProps<TabbedDemoChecklistPanel>) {
const [done, setDone] = useState(() => panel.items.map((it) => Boolean(it.done)));
const total = panel.items.length;
const count = done.filter(Boolean).length;
const status = (panel.progress ?? '{done} of {total} done').replace('{done}', String(count)).replace('{total}', String(total));
return (
<div className='tdh-form'>
{head}
<div className='tdh-meter'>
<span className='tdh-meter-text' aria-live='polite'>
{status}
</span>
<span className='tdh-meter-bar' aria-hidden='true'>
<i style={{ width: `${total ? (count / total) * 100 : 0}%` }} />
</span>
</div>
<ul className='tdh-checks'>
{panel.items.map((it, i) => (
<li key={it.label}>
<label className='tdh-check'>
<input type='checkbox' checked={done[i] ?? false} onChange={() => setDone((d) => d.map((v, j) => (j === i ? !v : v)))} />
<span className='tdh-tick' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span className='tdh-check-text'>
<span className='tdh-check-label'>{it.label}</span>
{it.detail ? <span className='tdh-check-detail'>{it.detail}</span> : null}
</span>
</label>
</li>
))}
</ul>
<ActionButton className='tdh-btn--card' label={panel.actionLabel} href={href} disabled={disabled} onClick={() => onAction?.(tabId)} />
{panel.note ? <p className='tdh-fine'>{panel.note}</p> : null}
</div>
);
}
function LedgerCard({ panel, head, tabId, disabled, href, onAction }: InnerProps<TabbedDemoLedgerPanel>) {
return (
<div className='tdh-form'>
{head}
<ul className='tdh-lines'>
{panel.lines.map((line) => (
<li key={line.label} className='tdh-line'>
<span className='tdh-line-label'>{line.label}</span>
<span className='tdh-leader' aria-hidden='true' />
<span className='tdh-line-value'>{line.value}</span>
</li>
))}
</ul>
<p className='tdh-total'>
<span>{panel.totalLabel}</span>
<s>{panel.total}</s>
</p>
<p className='tdh-today'>
<span className='tdh-today-label'>{panel.todayLabel}</span>
<span className='tdh-price'>{panel.today}</span>
</p>
{panel.note ? <p className='tdh-ledger-note'>{panel.note}</p> : null}
<ActionButton className='tdh-btn--card' label={panel.actionLabel} href={href} disabled={disabled} onClick={() => onAction?.(tabId)} />
</div>
);
}
function FormCard({ panel, head, tabId, disabled, forceError, onSubmit, onAction }: InnerProps<TabbedDemoFormPanel>) {
const uid = useId().replace(/:/g, '');
const [values, setValues] = useState<Record<string, string>>(() => Object.fromEntries(panel.fields.map((f) => [f.name, ''])));
const [errors, setErrors] = useState<Record<string, string>>({});
const validate = (v: Record<string, string>) => {
const out: Record<string, string> = {};
panel.fields.forEach((f) => {
const val = (v[f.name] ?? '').trim();
if (!val) out[f.name] = (panel.requiredError ?? 'Enter your {label}.').replace('{label}', f.label.toLowerCase());
else if (f.type === 'email' && !EMAIL.test(val)) out[f.name] = panel.emailError ?? 'Enter a valid email address.';
});
return out;
};
const shown = forceError ? { ...validate(values), ...errors } : errors;
const change = (name: string, value: string) => {
const nextValues = { ...values, [name]: value };
setValues(nextValues);
if (errors[name]) {
const fresh = validate(nextValues);
setErrors((prior) => {
const draft = { ...prior };
if (fresh[name]) draft[name] = fresh[name];
else delete draft[name];
return draft;
});
}
};
const submit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (disabled) return;
const found = validate(values);
setErrors(found);
const first = panel.fields.find((f) => found[f.name]);
if (first) {
const el = e.currentTarget.elements.namedItem(first.name);
if (el instanceof HTMLInputElement) el.focus();
return;
}
if (onSubmit) onSubmit(values, tabId);
else onAction?.(tabId);
};
return (
<form className='tdh-form' noValidate onSubmit={submit}>
{head}
{panel.fields.map((f) => {
const id = `${uid}-${f.name}`;
const err = shown[f.name];
return (
<div key={f.name} className='tdh-field'>
<label htmlFor={id}>{f.label}</label>
<input
id={id}
className='tdh-input'
name={f.name}
type={f.type ?? 'text'}
autoComplete={f.autoComplete}
placeholder={f.placeholder ?? defaultPlaceholder(f.type, f.name)}
value={values[f.name] ?? ''}
aria-required='true'
aria-invalid={err ? 'true' : 'false'}
aria-describedby={err ? `${id}-err` : undefined}
onChange={(e) => change(f.name, e.target.value)}
/>
{err ? (
<p className='tdh-error' id={`${id}-err`}>
<CircleAlert className='tdh-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{err}
</p>
) : null}
</div>
);
})}
<button type='submit' className='tdh-btn tdh-btn--card' disabled={disabled}>
{panel.actionLabel}
</button>
{panel.note ? (
<p className='tdh-fine'>
<Lock className='tdh-ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{panel.note}
</p>
) : null}
</form>
);
}
const R = '.cf-tabbed-demo-hero';
const CSS = `
${R}{--tdh-r:var(--card-radius,var(--radius,14px));--tdh-well:color-mix(in oklch,var(--ink) 3.5%,var(--surface));--tdh-hair:oklch(from var(--ink) l c h / .1);--tdh-ring:oklch(from var(--field-focus,var(--accent)) l c h / .5);--tdh-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow-x:clip}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .tdh-wrap{max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);grid-template-areas:'promise aside' 'stage stage';column-gap:clamp(32px,5vw,72px);row-gap:clamp(32px,4vw,48px);align-items:start}
${R} .tdh-wrap.is-solo{grid-template-columns:minmax(0,1fr);grid-template-areas:'promise' 'stage'}
${R} .tdh-promise{grid-area:promise;min-width:0}
${R} .tdh-h1{margin:0 0 clamp(14px,1.6vw,22px);font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
${R} .tdh-mark{padding:0 .08em;margin:0 -.02em;border-radius:.2em .45em .3em .16em;background-image:linear-gradient(180deg,transparent 34%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 34%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 92%,transparent 92%);-webkit-box-decoration-break:clone;box-decoration-break:clone;color:inherit}
${R} .tdh-lead{margin:0 0 clamp(24px,3vw,32px);max-width:54ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .tdh-action{display:grid;grid-template-columns:minmax(0,1fr);justify-items:stretch;gap:12px;width:fit-content;max-width:100%}
${R} .tdh-reassure{margin:0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-align:center;text-wrap:balance}
${R} .tdh-ico{display:inline-block;flex:none;vertical-align:-.15em;margin-inline-end:.4em}
${R} .tdh-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:64px;padding:0 28px;border:0;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-decoration:none;text-wrap:balance;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--tdh-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--tdh-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .tdh-btn:hover:not(:disabled),${R} .tdh-btn.is-hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--tdh-shadow) l c h / .32),0 10px 20px -6px oklch(from var(--tdh-shadow) l c h / .5)}
${R} .tdh-btn:active:not(:disabled),${R} .tdh-btn.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 1px oklch(from var(--tdh-shadow) l c h / .3)}
${R} .tdh-btn:focus-visible{outline:3px solid var(--tdh-ring);outline-offset:3px}
${R} .tdh-btn:disabled{background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:var(--shadow-sm,none);cursor:not-allowed;transform:none}
${R} .tdh-btn--hero{min-height:72px;padding:0 32px}
${R} .tdh-btn--card{width:100%;min-height:56px;margin-top:4px;font-size:1.125rem}
${R} .tdh-aside{grid-area:aside;display:grid;gap:16px;min-width:0;align-content:start}
${R} .tdh-photo{display:block;width:100%;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:50% 35%;border-radius:12px;background:var(--tdh-well)}
${R} .tdh-facts{padding:clamp(20px,2.4vw,24px);border-radius:var(--tdh-r);background:var(--tdh-well);display:grid;gap:12px}
${R} .tdh-facts p{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
${R} .tdh-facts strong{font-weight:800}
${R} .tdh-stage{grid-area:stage;position:relative;min-width:0;border-radius:var(--tdh-r);background:var(--tdh-well);border:1px solid var(--tdh-hair);overflow:hidden}
${R} .tdh-stage-body{position:relative;z-index:1}
${R} .tdh-tabbar{display:flex;align-items:center;gap:8px;padding:8px;background:color-mix(in oklch,var(--ink) 7%,var(--surface));border-bottom:1px solid var(--tdh-hair)}
${R} .tdh-tablist{position:relative;flex:1 1 auto;min-width:0;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px}
${R} .tdh-tab{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:8px 14px;border:1px solid transparent;border-radius:calc(var(--radius,12px) - 2px);background:transparent;color:var(--muted);font-family:var(--font-body);font-size:1rem;font-weight:700;line-height:1.2;text-align:center;text-wrap:balance;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease,border-color .16s ease}
${R} .tdh-tab-icon{flex:none}
${R} .tdh-tab:hover,${R} .tdh-tab.is-hover{color:var(--ink);background:color-mix(in oklch,var(--ink) 12%,var(--surface))}
${R} .tdh-tab[aria-selected=true]{color:var(--ink);background:var(--card);border-color:var(--tdh-hair);box-shadow:var(--shadow-sm,0 1px 2px oklch(from var(--tdh-shadow) l c h / .2))}
${R} .tdh-tab[aria-selected=true] .tdh-tab-icon{color:var(--accent)}
${R} .tdh-tab:focus-visible{outline:3px solid var(--tdh-ring);outline-offset:2px}
${R} .tdh-progress{position:absolute;left:16px;right:16px;bottom:5px;height:3px;border-radius:999px;background:oklch(from var(--ink) l c h / .12);overflow:hidden;pointer-events:none}
${R} .tdh-progress i{display:block;height:100%;border-radius:inherit;background:var(--accent-fill,var(--accent));transform:scaleX(0);transform-origin:left center;animation:cf-tdh-progress var(--tdh-interval,7000ms) linear forwards}
${R} .tdh-stage:hover .tdh-progress i,${R} .tdh-stage:focus-within .tdh-progress i,${R} .tdh-stage.is-paused .tdh-progress i{animation-play-state:paused}
${R} .tdh-pause{flex:0 0 auto;display:inline-grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid var(--button-2-border,transparent);border-radius:999px;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:pointer;transition:background .16s ease,transform .16s ease}
${R} .tdh-pause:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - .04) c h)}
${R} .tdh-pause:active{transform:translateY(1px)}
${R} .tdh-pause:focus-visible{outline:3px solid var(--tdh-ring);outline-offset:2px}
${R} .tdh-deck{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,440px) minmax(0,1fr);column-gap:clamp(24px,3.2vw,44px);padding:clamp(24px,3vw,40px) clamp(16px,3vw,32px) clamp(28px,3.5vw,48px)}
${R} .tdh-side{position:relative;min-width:0}
${R} .tdh-ghost{position:absolute;width:380px;cursor:pointer;opacity:.5;filter:blur(1.5px) saturate(.85);transition:opacity .2s ease,filter .2s ease}
${R} .tdh-ghost:hover{opacity:.7;filter:blur(.6px)}
${R} .tdh-ghost--prev{top:48px;right:0;-webkit-mask-image:linear-gradient(to left,currentColor 30%,transparent 100%);mask-image:linear-gradient(to left,currentColor 30%,transparent 100%)}
${R} .tdh-ghost--next{top:20px;left:0;-webkit-mask-image:linear-gradient(to right,currentColor 30%,transparent 100%);mask-image:linear-gradient(to right,currentColor 30%,transparent 100%)}
${R} .tdh-ghost-body{pointer-events:none;transform:scale(.92);transform-origin:50% 0;animation:cf-tdh-ghost .45s cubic-bezier(.2,.7,.2,1) both}
${R} .tdh-ghost .tdh-card{box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--tdh-shadow) l c h / .22))}
${R} .tdh-center{display:grid;min-width:0}
${R} .tdh-panel{grid-area:1/1;align-self:center;min-width:0;transition:opacity .38s ease,transform .38s cubic-bezier(.2,.7,.2,1),visibility 0s linear 0s}
${R} .tdh-panel[data-on=false]{opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .22s ease,transform .22s ease,visibility 0s linear .22s}
${R} .tdh-card{background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--tdh-r);box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--tdh-shadow) l c h / .22)));padding:clamp(20px,2.6vw,28px)}
${R} .tdh-form{display:block}
${R} .tdh-brand{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:.9375rem;font-weight:800;line-height:1.3;color:var(--muted)}
${R} .tdh-logo{display:block;height:22px;width:auto;object-fit:contain}
${R} .tdh-card-title{margin:0 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
${R} .tdh-card-lead{margin:0 0 20px;font-size:1rem;line-height:1.45;color:var(--muted);text-wrap:pretty}
${R} .tdh-fs{border:0;margin:0 0 18px;padding:0;min-width:0}
${R} .tdh-label{float:left;width:100%;padding:0;margin:0 0 8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .tdh-opts{clear:both;display:flex;flex-wrap:wrap;gap:8px}
${R} .tdh-opts--grid{display:grid;grid-template-columns:repeat(var(--tdh-cols,3),minmax(0,1fr))}
${R} .tdh-chip{position:relative;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:44px;padding:8px 12px;border:1px solid transparent;border-radius:calc(var(--radius,12px) - 2px);background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.9375rem;font-weight:700;line-height:1.2;text-align:center;cursor:pointer;transition:background .16s ease,border-color .16s ease,box-shadow .16s ease}
${R} .tdh-chip--pill{border-radius:999px;padding:8px 16px}
${R} .tdh-chip--day{min-height:56px;padding:8px 12px}
${R} .tdh-opts--times .tdh-chip{white-space:nowrap}
${R} .tdh-chip small{font-size:.9375rem;font-weight:500;color:inherit}
${R} .tdh-chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}
${R} .tdh-chip:hover{background:color-mix(in oklch,var(--ink) 10%,var(--card))}
${R} .tdh-chip:has(input:checked){background:color-mix(in oklch,var(--accent) 12%,var(--card));border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
${R} .tdh-chip:has(input:focus-visible){outline:3px solid var(--tdh-ring);outline-offset:2px}
${R} .tdh-chip:has(input:disabled){background:transparent;border-color:oklch(from var(--ink) l c h / .14);color:var(--muted);text-decoration:line-through;cursor:not-allowed}
${R} .tdh-fs.is-invalid .tdh-chip:not(:has(input:disabled)){border-color:var(--danger)}
${R} .tdh-error{margin:-8px 0 16px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .tdh-fine{margin:12px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;text-align:center;color:var(--muted);text-wrap:pretty}
${R} .tdh-meter{margin:0 0 14px}
${R} .tdh-meter-text{display:block;margin:0 0 8px;font-size:.9375rem;font-weight:800;color:var(--ink)}
${R} .tdh-meter-bar{display:block;height:8px;border-radius:999px;background:color-mix(in oklch,var(--ink) 8%,var(--card));overflow:hidden}
${R} .tdh-meter-bar i{display:block;height:100%;border-radius:inherit;background:var(--success);transition:width .3s cubic-bezier(.2,.7,.2,1)}
${R} .tdh-checks{list-style:none;margin:0 0 18px;padding:0;display:grid;gap:8px}
${R} .tdh-check{position:relative;display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));cursor:pointer;transition:background .16s ease}
${R} .tdh-check:hover{background:color-mix(in oklch,var(--ink) 7%,var(--card))}
${R} .tdh-check input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
${R} .tdh-check:has(input:checked){background:var(--success-soft)}
${R} .tdh-check:has(input:focus-visible){outline:3px solid var(--tdh-ring);outline-offset:2px}
${R} .tdh-tick{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:999px;border:2px solid oklch(from var(--ink) l c h / .3);background:var(--card);color:transparent;transition:background .16s ease,border-color .16s ease}
${R} .tdh-check:has(input:checked) .tdh-tick{background:var(--success);border-color:var(--success);color:var(--success-ink,#fff)}
${R} .tdh-check-label{display:block;font-size:1rem;font-weight:700;line-height:1.3}
${R} .tdh-check-detail{display:block;margin-top:2px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--ink)}
${R} .tdh-lines{list-style:none;margin:0 0 8px;padding:0}
${R} .tdh-line{display:flex;align-items:baseline;gap:10px;padding:7px 0;font-size:1rem;line-height:1.35}
${R} .tdh-line-label{min-width:0}
${R} .tdh-leader{flex:1 1 auto;min-width:20px;border-bottom:1px solid oklch(from var(--ink) l c h / .16);transform:translateY(-5px)}
${R} .tdh-line-value{font-weight:700;font-variant-numeric:tabular-nums}
${R} .tdh-total{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0;padding:12px 14px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,var(--card));font-size:1rem;font-weight:800;line-height:1.3}
${R} .tdh-total s{text-decoration-color:var(--danger);text-decoration-thickness:2px;font-variant-numeric:tabular-nums}
${R} .tdh-today{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin:18px 0}
${R} .tdh-today-label{font-size:1rem;font-weight:800;line-height:1.3;text-wrap:balance}
${R} .tdh-price{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:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
${R} .tdh-ledger-note{margin:-6px 0 18px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .tdh-field{margin:0 0 14px}
${R} .tdh-field label{display:block;margin:0 0 8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .tdh-input{display:block;width:100%;height:56px;padding:0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field);color:var(--field-ink);font-family:var(--font-body);font-size:1.0625rem;font-weight:500;transition:border-color .16s ease,box-shadow .16s ease}
${R} .tdh-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .tdh-input:hover{border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
${R} .tdh-input:focus{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)}
${R} .tdh-input[aria-invalid=true]{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .2)}
${R} .tdh-field .tdh-error{margin:8px 0 0}
@keyframes cf-tdh-progress{to{transform:scaleX(1)}}
@keyframes cf-tdh-ghost{from{opacity:0;transform:scale(.92) translateY(8px)}to{opacity:1;transform:scale(.92)}}
@keyframes cf-tdh-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
${R} .tdh-promise,${R} .tdh-aside,${R} .tdh-stage{animation:cf-tdh-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .tdh-aside{animation-delay:.07s}
${R} .tdh-stage{animation-delay:.14s}
}
@media (max-width:960px){
${R} .tdh-tablist{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:4px;margin:-4px}
${R} .tdh-tablist::-webkit-scrollbar{display:none}
${R} .tdh-tab{flex:0 0 auto;min-height:44px;padding:0 16px;border-radius:999px;border-color:oklch(from var(--ink) l c h / .16);white-space:nowrap;scroll-snap-align:start;font-size:.9375rem}
${R} .tdh-tab[aria-selected=true]{border-color:var(--accent)}
${R} .tdh-progress{left:16px;right:16px;bottom:4px;height:2px}
}
@media (max-width:900px){
${R} .tdh-wrap,${R} .tdh-wrap.is-solo{grid-template-columns:minmax(0,1fr);grid-template-areas:'promise' 'stage' 'aside'}
${R} .tdh-aside{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start}
${R} .tdh-aside.is-text{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px){
${R} .tdh-deck{grid-template-columns:minmax(0,1fr);padding:20px 12px 24px}
${R} .tdh-side{display:none}
${R} .tdh-center{width:100%;max-width:480px;justify-self:center}
}
@media (max-width:600px){
${R} .tdh-aside{grid-template-columns:minmax(0,1fr)}
${R} .tdh-action{width:100%}
${R} .tdh-btn--hero{width:100%;padding:0 20px}
${R} .tdh-card{padding:20px}
${R} .tdh-today{flex-wrap:wrap}
${R} .tdh-tablist{-webkit-mask-image:linear-gradient(to right,currentColor calc(100% - 28px),transparent);mask-image:linear-gradient(to right,currentColor calc(100% - 28px),transparent)}
}
@media (max-width:480px){
${R} .tdh-opts--days{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:4px;margin:-4px}
${R} .tdh-opts--days::-webkit-scrollbar{display:none}
${R} .tdh-opts--days .tdh-chip{flex:0 0 auto;min-width:60px;scroll-snap-align:start}
${R} .tdh-opts--times{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){
${R} .tdh-progress{display:none}
${R} .tdh-panel,${R} .tdh-panel[data-on=false],${R} .tdh-ghost,${R} .tdh-ghost-body,${R} .tdh-btn,${R} .tdh-tab,${R} .tdh-chip,${R} .tdh-check,${R} .tdh-meter-bar i,${R} .tdh-promise,${R} .tdh-aside,${R} .tdh-stage{transition:none !important;animation:none !important}
}
`;
pieces/hero/tabbed-demo-hero/specimen.tsx 110 lines
import __studioImage69c1038a from "../assets/41811fcd170dfbc4.webp";
import TabbedDemoHero, { type TabbedDemoHeroProps, type TabbedDemoTab } from '../tabbed-demo-hero';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
const tabs: TabbedDemoTab[] = [
{
id: 'book',
label: 'Book online',
icon: 'calendar',
panel: {
type: 'booking',
title: 'Pick your visit',
lead: 'Real open times. Tap one to hold it.',
serviceLabel: 'What do you need?',
services: ['Cleaning & exam', 'Tooth pain', 'Whitening consult'],
dayLabel: 'Day',
days: [
{ label: 'Mon', sub: '9' },
{ label: 'Tue', sub: '10' },
{ label: 'Wed', sub: '11' },
{ label: 'Thu', sub: '12' },
{ label: 'Fri', sub: '13' },
],
timeLabel: 'Time',
times: ['7:30 am', '9:15 am', '12:00 pm', '3:45 pm', '5:30 pm', '6:45 pm'],
unavailable: ['9:15 am', '12:00 pm'],
actionLabel: 'Book my visit',
error: 'Choose a time to continue.',
},
},
{
id: 'forms',
label: 'New-patient forms',
icon: 'checklist',
panel: {
type: 'checklist',
title: 'Finish your forms from the couch',
lead: 'Four quick steps before your first visit.',
items: [
{ label: 'Contact details', detail: 'Name, phone and email', done: true },
{ label: 'Medical history', detail: 'Medications and allergies', done: true },
{ label: 'Insurance card', detail: 'Snap the front and back' },
{ label: 'Consent to treatment', detail: 'Read and sign on your phone' },
],
progress: '{done} of {total} done',
actionLabel: 'Finish my forms',
},
},
{
id: 'cost',
label: 'Cost estimate',
icon: 'receipt',
panel: {
type: 'ledger',
title: 'Know your cost before you book',
lead: 'Your new-patient visit, itemised.',
lines: [
{ label: 'New-patient exam', value: '$95' },
{ label: 'Full set of X-rays', value: '$140' },
{ label: 'Cleaning & polish', value: '$120' },
],
totalLabel: 'Booked separately',
total: '$355',
todayLabel: 'Your new-patient visit',
today: '$129',
note: 'Pay at your visit. Nothing is charged online.',
actionLabel: 'Book my $129 visit',
},
},
{
id: 'portal',
label: 'Patient portal',
icon: 'user',
panel: {
type: 'form',
title: 'Your visits in one place',
lead: 'See bookings, forms and receipts any time.',
fields: [
{ name: 'name', label: 'Full name', autoComplete: 'name', placeholder: 'Jane Smith' },
{ name: 'email', label: 'Email address', type: 'email', autoComplete: 'email', placeholder: 'you@example.com' },
],
actionLabel: 'Open my patient portal',
note: 'We’ll email you a secure sign-in link.',
},
},
];
export default function TabbedDemoHeroSpecimen({ state }: { state?: TabbedDemoHeroProps['state'] }) {
return (
<TabbedDemoHero
state={state}
headline='Book your cleaning tonight and walk in ready'
highlight='walk in ready'
lead='Pick a real open time, finish your forms on your phone and see your cost before you ever sit in the chair.'
actionLabel='Book my first visit'
reassurance='Choose your time online · No phone call needed'
facts={[
{ lead: 'Real open chairs.', text: 'Every time you see is one we can seat you in, mornings and evenings.' },
{ lead: 'Forms done at home.', text: 'Fill them once on your phone. We read them before you arrive.' },
{ lead: 'Your cost up front.', text: 'See your new-patient visit itemised before you book.' },
]}
sceneImage={slot('scene', __studioImage69c1038a)}
sceneAlt='A patient checking in on her phone at a bright dental front desk'
tabs={tabs}
cardBrand='Northgate Dental'
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalTabbedDemoHero |
React.ReactNode |
|
highlight OptionalTabbedDemoHero |
string |
|
lead OptionalTabbedDemoHero |
React.ReactNode |
|
actionLabel OptionalTabbedDemoHero |
string |
|
href OptionalTabbedDemoHero |
string |
|
reassurance OptionalTabbedDemoHero |
string |
|
facts OptionalTabbedDemoHero |
{ lead: string; text: string }[] |
|
sceneImage OptionalTabbedDemoHero |
string |
|
sceneAlt OptionalTabbedDemoHero |
string |
|
tabs OptionalTabbedDemoHero |
TabbedDemoTab[] |
|
cardBrand OptionalTabbedDemoHero |
string |
|
logoImage OptionalTabbedDemoHero |
string |
|
logoAlt OptionalTabbedDemoHero |
string |
|
autoAdvance OptionalTabbedDemoHero |
boolean |
|
autoAdvanceMs OptionalTabbedDemoHero |
number |
|
initialTab OptionalTabbedDemoHero |
number |
|
copy OptionalTabbedDemoHero |
{ tourLabel?: string; pause?: string; play?: string } |
|
onAction OptionalTabbedDemoHero |
(source: string) => void |
|
onSubmit OptionalTabbedDemoHero |
(values: Record<string, string>, tabId: string) => void |
|
state OptionalTabbedDemoHero |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalTabbedDemoHero |
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.
--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.
-
41811fcd170dfbc4.webp
image/webp · 39.2 KB