Expert Hero 2
On-air expert hero: on a dark spotlit stage the host answers the reader's three doubts in their own voice, then the listen action lands as the last answer.
Use it in a prompt
Use hero/expert-hero-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/hero/expert-hero-2.tsx. - Import it and pass your copy and images (Props tab):
import { ExpertHero2 } from "@/components/funneldna/hero/expert-hero-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/expert-hero-2/component.tsx 463 lines
// layout: interview-qa
// On-air expert hero: on a dark spotlit stage the host answers the reader's three doubts in their own voice, then the listen action lands as the last answer.
import * as React from 'react';
import { BadgeCheck, ChevronDown, Mic } from 'lucide-react';
import { FX_HOST, Spotlight } from '../fx/fx';
export type ExpertHero2Question = {
/** The reader's doubt, set bold on the tab and in the transcript. */
question: string;
/** The host's answer, written in the first person. */
answer: React.ReactNode;
/** Optional italic aside in the host's voice, under the answer. */
aside?: string;
};
export type ExpertHero2Copy = {
/** Accessible name of the question tabs; {host} is replaced with the host's short name. */
tablistLabel?: string;
/** Speaker label for the reader's questions. */
speakerYou?: string;
/** Speaker label when no host name is given. */
speakerHostFallback?: string;
/** Accessible name of the credentials list. */
credentialsLabel?: string;
/** Portrait alt template; {name} is replaced with hostName. */
hostAlt?: string;
/** Portrait alt when no host name is given. */
hostAltFallback?: string;
};
export type ExpertHero2Props = {
/** The show's name, set beside a microphone disc above the headline. */
showName?: string;
/** Short line beside the show name (episode number, length). Empty hides it. */
episode?: string;
/** The episode's promise; renders as the page h1. */
headline?: React.ReactNode;
/** A phrase inside a string headline, lifted in the accent colour. */
emphasis?: string;
/** One or two sentences under the headline. */
lead?: React.ReactNode;
/** Shown under the portrait. */
hostName?: string;
/** Speaker label in the transcript; defaults to the first word of hostName. */
hostShortName?: string;
/** Short role under the name. Empty hides it. */
hostRole?: string;
/** Supplied credentials only, one short line each. Empty by default. */
credentials?: string[];
/** Slot presenter-cutout: the host at a microphone on a transparent background. */
hostImage?: string;
/** Overrides the generated portrait alt (see copy.hostAlt). */
hostImageAlt?: string;
/** The reader's doubts and the host's answers (tabs on desktop, accordion on phones). */
questions?: ExpertHero2Question[];
/** Index of the answer shown first. */
defaultIndex?: number;
/** Bold question right above the button, so the action reads as the last answer. Empty hides it. */
closingQuestion?: string;
/** Main button label. */
label?: string;
/** Listen destination; the button renders as a link when set and not disabled. */
href?: string;
/** Click handler for the main button. */
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
/** Quiet secondary line under the button. Empty hides it. */
notesLabel?: string;
/** Show notes destination; renders the line as a link when set. */
notesHref?: string;
/** Click handler for the show notes line. */
onNotes?: (event: React.MouseEvent<HTMLElement>) => void;
/** Accessible names, speaker labels and alt templates. */
copy?: ExpertHero2Copy;
/** Forces a button state for previews. */
state?: 'default' | 'hover' | 'active' | 'disabled';
id?: string;
className?: string;
};
export function ExpertHero2(props: ExpertHero2Props) {
const {
showName = 'The Margin Show',
episode = '',
headline = 'Find the margin hiding in your stockroom',
emphasis = 'hiding in your stockroom',
lead = 'Before you raise a single price, hear the weekly checks most small shops skip and the fixes you can start on Monday.',
hostName = 'Priya Nandan',
hostShortName,
hostRole = 'Your host',
credentials = [],
hostImage,
hostImageAlt,
questions = DEFAULT_QUESTIONS,
defaultIndex = 0,
closingQuestion = 'So where do I start?',
label = 'Play the episode',
href,
onAction,
notesLabel = 'or read the show notes',
notesHref,
onNotes,
copy,
state = 'default',
id,
className,
} = props;
const text = { ...DEFAULT_COPY, ...copy };
const uid = React.useId().replace(/:/g, '');
const count = questions.length;
const start = Math.min(Math.max(defaultIndex, 0), Math.max(count - 1, 0));
const [active, setActive] = React.useState(start);
const [open, setOpen] = React.useState<number | null>(count ? start : null);
const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);
const current = Math.min(active, Math.max(count - 1, 0));
const disabled = state === 'disabled';
const speaker = hostShortName ?? (hostName.trim().split(' ')[0] || text.speakerHostFallback);
const alt = hostImageAlt ?? (hostName ? text.hostAlt.replace('{name}', hostName) : text.hostAltFallback);
const headingId = `${uid}-h`;
const onTabKey = (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {
let next = -1;
if (event.key === 'ArrowRight') next = (index + 1) % count;
else if (event.key === 'ArrowLeft') next = (index - 1 + count) % count;
else if (event.key === 'Home') next = 0;
else if (event.key === 'End') next = count - 1;
if (next < 0) return;
event.preventDefault();
setActive(next);
tabRefs.current[next]?.focus();
};
const renderAnswer = (item: ExpertHero2Question, withQuestion: boolean) => (
<div className='cf-eh2__lines'>
{withQuestion ? (
<>
<span className='cf-eh2__who'>{text.speakerYou}</span>
<p className='cf-eh2__q'>{item.question}</p>
</>
) : null}
<span className='cf-eh2__who cf-eh2__who--host'>{speaker}</span>
<div className='cf-eh2__a'>
<p className='cf-eh2__answer'>{item.answer}</p>
{item.aside ? <p className='cf-eh2__aside'>{item.aside}</p> : null}
</div>
</div>
);
const action =
href && !disabled ? (
<a className='cf-eh2__btn' data-state={state} href={href} onClick={onAction}>
{label}
</a>
) : (
<button type='button' className='cf-eh2__btn' data-state={state} disabled={disabled} onClick={onAction}>
{label}
</button>
);
const notes = notesLabel ? (
notesHref ? (
<a className='cf-eh2__notes' href={notesHref} onClick={onNotes}>
{notesLabel}
</a>
) : (
<button type='button' className='cf-eh2__notes' onClick={onNotes}>
{notesLabel}
</button>
)
) : null;
return (
<section
id={id}
className={['cf-eh2', className].filter(Boolean).join(' ')}
style={FX_HOST}
aria-labelledby={headingId}
data-has-image={hostImage ? 'true' : 'false'}
>
<style>{CSS}</style>
<Spotlight />
<div className='cf-eh2__wrap'>
{hostImage ? (
<figure className='cf-eh2__stage cf-eh2__in'>
<Waveform />
<img className='cf-eh2__img' src={hostImage} alt={alt} width={640} height={800} loading='eager' decoding='async' />
</figure>
) : null}
{hostName || hostRole ? (
<div className='cf-eh2__host cf-eh2__in' style={delay(1)}>
{hostName ? <p className='cf-eh2__name'>{hostName}</p> : null}
{hostRole ? <p className='cf-eh2__role'>{hostRole}</p> : null}
</div>
) : null}
{credentials.length ? (
<ul className='cf-eh2__creds' aria-label={text.credentialsLabel}>
{credentials.map((line) => (
<li key={line}>
<BadgeCheck className='cf-eh2__cred-icon' size={18} strokeWidth={2.5} aria-hidden='true' />
{line}
</li>
))}
</ul>
) : null}
<div className='cf-eh2__copy'>
<div className='cf-eh2__show cf-eh2__in'>
<span className='cf-eh2__disc' aria-hidden='true'>
<Mic size={20} strokeWidth={2.5} />
</span>
<span className='cf-eh2__show-text'>
<span className='cf-eh2__show-name'>{showName}</span>
{episode ? <span className='cf-eh2__episode'>{episode}</span> : null}
</span>
</div>
<h1 id={headingId} className='cf-eh2__h1 cf-eh2__in' style={delay(1)}>
{renderHeadline(headline, emphasis)}
</h1>
{lead ? (
<p className='cf-eh2__lead cf-eh2__in' style={delay(2)}>
{lead}
</p>
) : null}
{count ? (
<div className='cf-eh2__card cf-eh2__in' style={delay(3)}>
<div
className='cf-eh2__tabs'
role='tablist'
aria-label={text.tablistLabel.replace('{host}', speaker)}
style={{ '--n': count } as React.CSSProperties}
>
{questions.map((item, i) => (
<button
key={`tab-${i}`}
ref={(el) => {
tabRefs.current[i] = el;
}}
type='button'
role='tab'
id={`${uid}-tab-${i}`}
aria-selected={i === current}
aria-controls={`${uid}-panel-${i}`}
tabIndex={i === current ? 0 : -1}
className='cf-eh2__tab'
onClick={() => setActive(i)}
onKeyDown={(event) => onTabKey(event, i)}
>
{item.question}
</button>
))}
</div>
<div className='cf-eh2__panels'>
{questions.map((item, i) => (
<div
key={`panel-${i}`}
role='tabpanel'
id={`${uid}-panel-${i}`}
aria-labelledby={`${uid}-tab-${i}`}
tabIndex={i === current ? 0 : -1}
data-active={i === current ? 'true' : 'false'}
className='cf-eh2__panel'
>
{renderAnswer(item, true)}
</div>
))}
</div>
<div className='cf-eh2__acc'>
{questions.map((item, i) => {
const isOpen = open === i;
return (
<div key={`acc-${i}`} className='cf-eh2__acc-item' data-open={isOpen ? 'true' : 'false'}>
<h2 className='cf-eh2__acc-h'>
<button
type='button'
id={`${uid}-acc-${i}`}
aria-expanded={isOpen}
aria-controls={`${uid}-accp-${i}`}
className='cf-eh2__acc-btn'
onClick={() => setOpen(isOpen ? null : i)}
>
<span>{item.question}</span>
<ChevronDown className='cf-eh2__chev' size={20} strokeWidth={2.5} aria-hidden='true' />
</button>
</h2>
<div
id={`${uid}-accp-${i}`}
role='region'
aria-labelledby={`${uid}-acc-${i}`}
className='cf-eh2__acc-panel'
hidden={!isOpen}
>
{renderAnswer(item, false)}
</div>
</div>
);
})}
</div>
</div>
) : null}
<div className='cf-eh2__action cf-eh2__in' style={delay(4)}>
{closingQuestion ? <p className='cf-eh2__closing'>{closingQuestion}</p> : null}
{action}
{notes}
</div>
</div>
</div>
</section>
);
}
export default ExpertHero2;
const DEFAULT_QUESTIONS: ExpertHero2Question[] = [
{
question: 'Who is this for?',
answer:
'You run a shop with your name over the door. One store, maybe two, and you still sign off the stock order yourself. If you’ve had a busy month and a thin bank balance, start here.',
aside: '(Yes, I’ve had that month too.)',
},
{
question: 'What will I learn?',
answer:
'How to spot the lines that sell fast but earn you almost nothing, what to check on every supplier invoice, and the one weekly number I’d look at before any other.',
aside: '(It isn’t revenue. I know. I didn’t believe it either.)',
},
{
question: 'Why listen to you?',
answer:
'Because I’ve stood behind the counter. I ask every guest the question I needed answered back then: what actually changed on the shop floor?',
aside: '(I ask the awkward questions, so you don’t have to.)',
},
];
const DEFAULT_COPY: Required<ExpertHero2Copy> = {
tablistLabel: 'Your questions for {host}',
speakerYou: 'You',
speakerHostFallback: 'Host',
credentialsLabel: 'About the host',
hostAlt: '{name} at the microphone',
hostAltFallback: 'The host at the microphone',
};
const BARS = Array.from({ length: 40 }, (_, i) =>
Math.round(8 + 34 * Math.abs(Math.sin(i * 0.9) * Math.cos(i * 0.37 + 0.4))),
);
function delay(step: number): React.CSSProperties {
return { '--d': `${Math.min(step * 0.07, 0.28)}s` } as React.CSSProperties;
}
function renderHeadline(node: React.ReactNode, phrase: string): React.ReactNode {
if (typeof node !== 'string' || !phrase) return node;
const at = node.indexOf(phrase);
if (at < 0) return node;
return (
<>
{node.slice(0, at)}
<span className='cf-eh2__em'>{phrase}</span>
{node.slice(at + phrase.length)}
</>
);
}
// private
function Waveform() {
return (
<svg className='cf-eh2__wave' viewBox='0 0 240 48' aria-hidden='true' focusable='false'>
{BARS.map((h, i) => (
<rect key={i} x={i * 6 + 1} y={48 - h} width={4} height={h} rx={2} fill='currentColor' />
))}
</svg>
);
}
const CSS = `
.cf-eh2{position:relative;isolation:isolate;overflow:hidden;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-eh2 *,.cf-eh2 *::before,.cf-eh2 *::after{box-sizing:border-box}
.cf-eh2 :where(p,h1,h2,ul,figure){margin:0}
.cf-eh2__wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-areas:'stage copy' 'host copy' 'creds copy';grid-template-rows:auto auto 1fr;column-gap:clamp(32px,5vw,72px);align-items:start}
.cf-eh2[data-has-image=false] .cf-eh2__wrap{grid-template-columns:minmax(0,46rem);justify-content:center;grid-template-areas:'host' 'copy' 'creds';grid-template-rows:auto}
.cf-eh2[data-has-image=false] .cf-eh2__host{margin:0 0 24px}
.cf-eh2__stage{grid-area:stage;position:relative;display:flex;align-items:flex-end;justify-content:center;width:100%;aspect-ratio:4/5}
.cf-eh2__stage::after{content:'';position:absolute;left:0;right:0;bottom:0;height:1px;background:oklch(from var(--band-ink) l c h / .2)}
.cf-eh2__wave{position:absolute;left:0;bottom:0;width:100%;height:auto;color:var(--accent-fill,var(--accent));opacity:.45}
.cf-eh2__img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45)) drop-shadow(0 16px 20px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .4))}
.cf-eh2__host{grid-area:host;margin-top:20px}
.cf-eh2__name{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em}
.cf-eh2__role{margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:600;color:color-mix(in oklab,var(--band-ink) 80%,var(--band))}
.cf-eh2__creds{grid-area:creds;list-style:none;padding:0;margin-top:16px;display:grid;gap:8px;align-content:start}
.cf-eh2__creds li{font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty;color:var(--band-ink)}
.cf-eh2__cred-icon{display:inline-block;vertical-align:-0.2em;margin-inline-end:.45em;color:var(--band-ink)}
.cf-eh2__copy{grid-area:copy;min-width:0}
.cf-eh2__show{display:flex;align-items:center;gap:12px;margin-bottom:24px}
.cf-eh2__disc{flex:0 0 40px;width:40px;height:40px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-eh2__show-text{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:12px;row-gap:2px;min-width:0}
.cf-eh2__show-name{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2}
.cf-eh2__episode{font-size:.875rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;line-height:1.2;color:color-mix(in oklab,var(--band-ink) 80%,var(--band))}
.cf-eh2__h1{font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;text-wrap:balance;color:var(--band-ink)}
.cf-eh2__em{color:var(--band-ink);color:oklch(from var(--accent-fill,var(--accent)) max(l,0.82) min(c,0.15) h)}
.cf-eh2__lead{margin-top:20px;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;color:color-mix(in oklab,var(--band-ink) 88%,var(--band))}
.cf-eh2__card{margin-top:32px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));padding:clamp(20px,3vw,32px)}
.cf-eh2__tabs{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:4px;padding:4px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,var(--card))}
.cf-eh2__tab{position:relative;appearance:none;border:0;margin:0;min-height:52px;padding:8px 12px 14px;border-radius:8px;background:transparent;color:color-mix(in oklch,var(--ink) 80%,var(--card));font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.2;text-wrap:balance;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.cf-eh2__tab:hover{background:color-mix(in oklch,var(--ink) 9%,var(--card));color:var(--ink)}
.cf-eh2__tab[aria-selected=true]{background:var(--card);color:var(--ink);font-weight:800;box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / .18),0 1px 3px oklch(0.22 0.03 260 / .14))}
.cf-eh2__tab[aria-selected=true]::after{content:'';position:absolute;left:50%;bottom:6px;width:24px;height:3px;margin-left:-12px;border-radius:999px;background:var(--accent-fill,var(--accent))}
.cf-eh2__tab:focus-visible,.cf-eh2__acc-btn:focus-visible,.cf-eh2__panel:focus-visible{outline:2px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-eh2__panels{display:grid;margin-top:24px}
.cf-eh2__panel{grid-area:1/1;border-radius:8px}
.cf-eh2__panel[data-active=false]{visibility:hidden}
.cf-eh2__lines{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:16px;row-gap:16px;align-items:start}
.cf-eh2__who{justify-self:start;display:inline-flex;align-items:center;justify-content:center;min-height:28px;padding:4px 12px;border-radius:999px;font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink)}
.cf-eh2__who--host{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-eh2__q{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--ink)}
.cf-eh2__answer{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty;color:var(--ink)}
.cf-eh2__aside{margin-top:8px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-style:italic;text-wrap:pretty;color:var(--muted)}
.cf-eh2__acc{display:none}
.cf-eh2__acc-item + .cf-eh2__acc-item{border-top:1px solid oklch(from var(--ink) l c h / .12)}
.cf-eh2__acc-h{margin:0;font:inherit}
.cf-eh2__acc-btn{appearance:none;border:0;margin:0;width:100%;min-height:60px;padding:14px 8px;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;background:transparent;border-radius:8px;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.0625rem;line-height:1.25;color:var(--ink);cursor:pointer;transition:background .16s ease,color .16s ease}
.cf-eh2__acc-btn:hover{background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-eh2__acc-item[data-open=true] .cf-eh2__acc-btn{color:var(--accent)}
.cf-eh2__chev{flex:0 0 auto;transition:transform .16s ease}
.cf-eh2__acc-item[data-open=true] .cf-eh2__chev{transform:rotate(180deg)}
.cf-eh2__acc-panel{padding:0 8px 20px}
.cf-eh2__acc-panel .cf-eh2__lines{grid-template-columns:minmax(0,1fr);row-gap:8px}
.cf-eh2__action{margin-top:40px;display:flex;flex-direction:column;align-items:stretch;gap:16px}
.cf-eh2__closing{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--band-ink)}
.cf-eh2__btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:72px;min-width:0;padding:0 28px;border:0;margin:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;text-decoration:none;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .4),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .5));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-eh2__btn:not(:disabled):hover,.cf-eh2__btn[data-state=hover]{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.18) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45),0 10px 18px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .6))}
.cf-eh2__btn:not(:disabled):active,.cf-eh2__btn[data-state=active]{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h / .45),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 1px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .4)}
.cf-eh2__btn:disabled,.cf-eh2__btn[data-state=disabled]{background:var(--secondary);color:var(--secondary-ink);text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed;transform:none}
.cf-eh2__btn:focus-visible,.cf-eh2__notes:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-eh2__notes{align-self:center;text-align:center;appearance:none;border:0;margin:0;background:none;padding:4px 2px;border-radius:4px;font-family:var(--font-body);font-size:1.0625rem;font-weight:500;line-height:1.4;color:var(--band-ink);text-decoration:underline;text-decoration-thickness:1px;text-decoration-color:oklch(from var(--band-ink) l c h / .5);text-underline-offset:.18em;cursor:pointer}
.cf-eh2__notes:hover{text-decoration-color:var(--band-ink);text-decoration-thickness:2px}
@keyframes cf-eh2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
.cf-eh2__in{animation:cf-eh2-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.cf-eh2__panel[data-active=true],.cf-eh2__acc-panel:not([hidden]){animation:cf-eh2-rise .45s cubic-bezier(.2,.7,.2,1) both}
}
@media (prefers-reduced-motion:reduce){
.cf-eh2__btn,.cf-eh2__tab,.cf-eh2__acc-btn,.cf-eh2__chev{transition:none}
.cf-eh2__btn:not(:disabled):hover,.cf-eh2__btn:not(:disabled):active,.cf-eh2__btn[data-state]{transform:none}
}
@media (max-width:759px){
.cf-eh2__wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:'stage' 'host' 'copy' 'creds';grid-template-rows:auto}
.cf-eh2__stage{aspect-ratio:auto;height:300px;max-width:340px;margin-inline:auto}
.cf-eh2__host{margin:16px 0 32px;text-align:center}
.cf-eh2__creds{margin-top:40px;padding-top:24px;border-top:1px solid oklch(from var(--band-ink) l c h / .16);justify-items:center;text-align:center}
.cf-eh2__tabs,.cf-eh2__panels{display:none}
.cf-eh2__acc{display:block}
.cf-eh2__card{padding:4px 12px}
.cf-eh2__action{align-items:stretch}
.cf-eh2__closing{text-align:center}
.cf-eh2__btn{padding:0 20px}
}
`;
pieces/hero/expert-hero-2/specimen.tsx 33 lines
import __studioImage4b895f1f from "../assets/21a0bd6203861355.webp";
// Specimen: The Margin Show, a fictional podcast for independent retailers hosted by Priya Nandan.
import * as React from 'react';
import { ExpertHero2 } from '../expert-hero-2';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled';
export default function ExpertHero2Specimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<ExpertHero2
state={state}
showName='The Margin Show'
episode='Episode 42 · 38 min'
headline='Find the margin hiding in your stockroom'
emphasis='hiding in your stockroom'
lead='Before you raise a single price, hear the weekly checks most small shops skip and the fixes you can start on Monday.'
hostName='Priya Nandan'
hostRole='Your host, and a former shop owner'
credentials={['Ran an independent homeware shop for 11 years', 'Talks shop with a different owner every week']}
hostImage={slot(
'presenter-cutout',
__studioImage4b895f1f,
)}
label='Play the episode'
href='#listen'
notesLabel='or read the show notes'
notesHref='#show-notes'
/>
);
}
| Name | Type | Details |
|---|---|---|
showName OptionalExpertHero2 |
string |
|
episode OptionalExpertHero2 |
string |
|
headline OptionalExpertHero2 |
React.ReactNode |
|
emphasis OptionalExpertHero2 |
string |
|
lead OptionalExpertHero2 |
React.ReactNode |
|
hostName OptionalExpertHero2 |
string |
|
hostShortName OptionalExpertHero2 |
string |
|
hostRole OptionalExpertHero2 |
string |
|
credentials OptionalExpertHero2 |
string[] |
|
hostImage OptionalExpertHero2 |
string |
|
hostImageAlt OptionalExpertHero2 |
string |
|
questions OptionalExpertHero2 |
ExpertHero2Question[] |
|
defaultIndex OptionalExpertHero2 |
number |
|
closingQuestion OptionalExpertHero2 |
string |
|
label OptionalExpertHero2 |
string |
|
href OptionalExpertHero2 |
string |
|
onAction OptionalExpertHero2 |
(event: React.MouseEvent<HTMLElement>) => void |
|
notesLabel OptionalExpertHero2 |
string |
|
notesHref OptionalExpertHero2 |
string |
|
onNotes OptionalExpertHero2 |
(event: React.MouseEvent<HTMLElement>) => void |
|
copy OptionalExpertHero2 |
ExpertHero2Copy |
|
state OptionalExpertHero2 |
'default' | 'hover' | 'active' | 'disabled' |
|
id OptionalExpertHero2 |
string |
|
className OptionalExpertHero2 |
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-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.
presenter-cutout- The presenter on a transparent background.
-
21a0bd6203861355.webp
image/webp · 147 KB