Interactive Type Hero 1
Interactive type hero: the promise’s key words are buttons that reveal their supplied proof beside the headline, one at a time, so the claim feels true before the one action.
Use it in a prompt
Use hero/interactive-type-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/interactive-type-hero.tsx. - Import it and pass your copy and images (Props tab):
import { InteractiveTypeHero } from "@/components/funneldna/hero/interactive-type-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/interactive-type-hero/component.tsx 574 lines
// layout: spotlight-row
// Interactive type hero: the promise’s key words are buttons that reveal their supplied proof beside the headline, one at a time, so the claim feels true before the one action.
import React, { useCallback, useId, useMemo, useRef, useState } from 'react';
import { motion, useReducedMotion } from 'motion/react';
import { MousePointerClick, ShieldCheck, Users, X } from 'lucide-react';
import { FX_HOST, Mesh } from '../fx/fx';
export type InteractiveWord = {
/** The word as written inside {braces} in the headline (matched without case). */
word: string;
/** One-line fact revealed for the word; supplied facts only. */
proof: string;
/** Optional short sentence under the proof. */
detail?: string;
/** Picture of the word in action (item-n slot). */
image?: string;
imageAlt?: string;
};
export type InteractiveTypeHeroCopy = {
/** Line above the revealed proof; {word} becomes the word. */
panelLead?: string;
/** Shown in the reveal area while no word is open. */
hint?: string;
/** Accessible label of the close control. */
close?: string;
/** Accessible label of each word key; {word} becomes the word. */
showWord?: string;
};
export type InteractiveTypeHeroProps = {
/** The promise; wrap 2-3 key words in {braces} that match words[].word. */
headline?: string;
/** Proof per interactive word; defaults empty so a page shows only facts it supplies. */
words?: InteractiveWord[];
lead?: string;
/** Phrase inside the lead swiped with the marker. */
leadHighlight?: string;
ctaLabel?: string;
/** One reassurance line under the action. */
actionNote?: string;
price?: string;
pricePeriod?: string;
/** Per-day breakdown under the price. */
priceBreakdown?: string;
/** Small proof line; nothing renders when empty. */
proof?: string;
/** Index into words opened on load; null starts closed. */
defaultOpen?: number | null;
href?: string;
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
state?: 'default' | 'hover' | 'active' | 'disabled';
copy?: InteractiveTypeHeroCopy;
className?: string;
};
type Part = { kind: 'text'; text: string } | { kind: 'word'; text: string; index: number };
type OpenWord = { i: number; x: number; y: number; animate: boolean };
export function InteractiveTypeHero(props: InteractiveTypeHeroProps) {
const {
headline = 'Show visitors why your offer is {simpler}, {faster} and {safer}.',
words = [],
lead = 'Tell visitors exactly what you promise, then give them one clear next step.',
leadHighlight,
ctaLabel = 'Yes! I want to get started',
actionNote,
price,
pricePeriod,
priceBreakdown,
proof,
defaultOpen = 0,
href,
onAction,
state = 'default',
copy,
className,
} = props;
const text = {
panelLead: copy?.panelLead ?? '{word} means',
hint: copy?.hint ?? 'Tap a highlighted word to see what it means.',
close: copy?.close ?? 'Hide this proof',
showWord: copy?.showWord ?? 'Show what {word} means',
};
const { parts, present } = useMemo(() => parseHeadline(headline, words), [headline, words]);
const reduce = useReducedMotion();
const panelId = useId();
const wordRefs = useRef<(HTMLButtonElement | null)[]>([]);
const slotRef = useRef<HTMLDivElement | null>(null);
const lastPointer = useRef('');
const quietFocus = useRef(false);
const [open, setOpen] = useState<OpenWord | null>(() =>
defaultOpen !== null && present.includes(defaultOpen) ? { i: defaultOpen, x: 0, y: 0, animate: false } : null,
);
const openRef = useRef(open);
openRef.current = open;
const show = useCallback((i: number) => {
if (openRef.current && openRef.current.i === i) return;
const word = wordRefs.current[i];
const slot = slotRef.current;
let x = 0;
let y = 0;
if (word && slot) {
const a = word.getBoundingClientRect();
const b = slot.getBoundingClientRect();
x = a.left - b.left;
y = a.top - b.top;
}
setOpen({ i, x, y, animate: true });
}, []);
const focusWord = (i: number) => {
quietFocus.current = true;
wordRefs.current[i]?.focus({ preventScroll: true });
quietFocus.current = false;
};
const close = (refocus: boolean) => {
const current = openRef.current;
setOpen(null);
if (refocus && current) focusWord(current.i);
};
const controls = (i: number) => ({
'aria-controls': panelId,
'aria-expanded': open !== null && open.i === i,
onPointerEnter: (e: React.PointerEvent<HTMLButtonElement>) => {
if (e.pointerType === 'mouse') show(i);
},
onPointerDown: (e: React.PointerEvent<HTMLButtonElement>) => {
lastPointer.current = e.pointerType;
},
onFocus: (e: React.FocusEvent<HTMLButtonElement>) => {
if (!quietFocus.current && focusVisible(e.currentTarget)) show(i);
},
onClick: () => {
const pointer = lastPointer.current;
lastPointer.current = '';
if (pointer === 'mouse') show(i);
else if (openRef.current && openRef.current.i === i) close(false);
else show(i);
},
});
const onKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {
if (e.key !== 'Escape' || !openRef.current) return;
const inside = !!slotRef.current && slotRef.current.contains(document.activeElement);
close(inside);
};
const active = open && present.includes(open.i) ? words[open.i] : null;
const disabled = state === 'disabled';
const ctaClass = 'cf-itype__cta' + (state === 'hover' ? ' is-hover' : '') + (state === 'active' ? ' is-active' : '');
const handleAction = (e: React.MouseEvent<HTMLElement>) => {
if (disabled) {
e.preventDefault();
return;
}
onAction?.(e);
};
return (
<section
className={'cf-itype' + (className ? ' ' + className : '')}
style={FX_HOST}
data-solo={present.length ? undefined : ''}
onKeyDown={onKeyDown}
>
<Mesh variant='dark' />
<style>{CSS}</style>
<div className='cf-itype__inner'>
<h1 className='cf-itype__h'>
{parts.map((p, k) =>
p.kind === 'text' ? (
<React.Fragment key={k}>{p.text}</React.Fragment>
) : (
<button
key={k}
ref={(el) => {
wordRefs.current[p.index] = el;
}}
type='button'
className='cf-itype__w'
{...controls(p.index)}
>
{p.text}
</button>
),
)}
</h1>
{present.length > 0 ? (
<div className='cf-itype__stage'>
<div className='cf-itype__slot' id={panelId} ref={slotRef} aria-live='polite'>
{open && active ? (
<motion.div
key={open.i}
className='cf-itype__panel'
data-noimg={active.image ? undefined : ''}
initial={open.animate && !reduce ? { x: open.x, y: open.y, scale: 0.4, opacity: 0.4 } : false}
animate={{ x: 0, y: 0, scale: 1, opacity: 1 }}
transition={{ duration: 0.45, ease: [0.2, 0.7, 0.2, 1] }}
style={{ transformOrigin: '0 0' }}
>
{active.image ? (
<figure className='cf-itype__media'>
<img src={active.image} alt={active.imageAlt ?? ''} width={640} height={400} decoding='async' />
</figure>
) : null}
<div className='cf-itype__body'>
<p className='cf-itype__plead'>{capitalise(text.panelLead.split('{word}').join(active.word))}</p>
<p className='cf-itype__proof'>{active.proof}</p>
{active.detail ? <p className='cf-itype__detail'>{active.detail}</p> : null}
</div>
<button type='button' className='cf-itype__close' aria-label={text.close} onClick={() => close(true)}>
<X size={20} strokeWidth={2.5} aria-hidden='true' />
</button>
</motion.div>
) : (
<p className='cf-itype__hint'>
<MousePointerClick className='cf-itype__ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{text.hint}
</p>
)}
</div>
{present.length > 1 ? (
<ul className='cf-itype__keys' role='list'>
{present.map((i) => {
const w = words[i];
return (
<li key={i}>
<button
type='button'
className='cf-itype__key'
data-noimg={w.image ? undefined : ''}
aria-label={text.showWord.split('{word}').join(w.word)}
{...controls(i)}
>
{w.image ? <img src={w.image} alt='' width={40} height={40} decoding='async' /> : null}
<span>{w.word}</span>
</button>
</li>
);
})}
</ul>
) : null}
</div>
) : null}
{lead ? <p className='cf-itype__lead'>{withMarker(lead, leadHighlight)}</p> : null}
<div className='cf-itype__act'>
<div className='cf-itype__row'>
{href ? (
<a
className={ctaClass}
href={disabled ? undefined : href}
aria-disabled={disabled || undefined}
onClick={handleAction}
>
{ctaLabel}
</a>
) : (
<button type='button' className={ctaClass} disabled={disabled} onClick={handleAction}>
{ctaLabel}
</button>
)}
{price ? (
<p className='cf-itype__price'>
<span className='cf-itype__pline'>
<span className='cf-itype__amt'>{price}</span>
{pricePeriod ? <span className='cf-itype__per'>{pricePeriod}</span> : null}
</span>
{priceBreakdown ? <span className='cf-itype__day'>{priceBreakdown}</span> : null}
</p>
) : null}
</div>
{actionNote ? (
<p className='cf-itype__note'>
<ShieldCheck className='cf-itype__ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{actionNote}
</p>
) : null}
{proof ? (
<p className='cf-itype__note'>
<Users className='cf-itype__ico' size={16} strokeWidth={2.5} aria-hidden='true' />
{proof}
</p>
) : null}
</div>
</div>
</section>
);
}
export default InteractiveTypeHero;
function parseHeadline(headline: string, words: InteractiveWord[]) {
const parts: Part[] = [];
const present: number[] = [];
let rest = headline;
while (rest.length) {
const start = rest.indexOf('{');
const end = start < 0 ? -1 : rest.indexOf('}', start + 1);
if (start < 0 || end < 0) {
parts.push({ kind: 'text', text: rest });
break;
}
if (start > 0) parts.push({ kind: 'text', text: rest.slice(0, start) });
const word = rest.slice(start + 1, end);
const key = word.trim().toLowerCase();
const index = words.findIndex((w) => !!w.proof && w.word.trim().toLowerCase() === key);
if (index >= 0 && !present.includes(index)) {
present.push(index);
parts.push({ kind: 'word', text: word, index });
} else {
parts.push({ kind: 'text', text: word });
}
rest = rest.slice(end + 1);
}
return { parts, present };
}
function capitalise(value: string) {
return value ? value.charAt(0).toUpperCase() + value.slice(1) : value;
}
function focusVisible(el: Element) {
try {
return el.matches(':focus-visible');
} catch {
return true;
}
}
function withMarker(value: string, phrase?: string): React.ReactNode {
if (!phrase) return value;
const at = value.indexOf(phrase);
if (at < 0) return value;
return (
<>
{value.slice(0, at)}
<mark className='cf-itype__mark'>{phrase}</mark>
{value.slice(at + phrase.length)}
</>
);
}
const CSS = `
.cf-itype{
--itype-hl: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
--itype-hl-ink: var(--accent-fill-ink, var(--card, oklch(1 0 0)));
--itype-line: oklch(from var(--itype-hl) max(l, 0.68) c h);
--itype-marker: oklch(from var(--marker, #fae37c) l c h / 1);
--itype-marker-ink: var(--field-ink, oklch(0.21 0.034 263));
--itype-soft: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.86);
--itype-shadow: var(--shadow, oklch(0.22 0.03 256));
position: relative;
overflow: clip;
isolation: isolate;
container: itype / inline-size;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, oklch(1 0 0));
font-family: var(--font-body);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-itype *, .cf-itype *::before, .cf-itype *::after{ box-sizing: border-box; }
.cf-itype__inner{
position: relative; z-index: 1;
max-inline-size: 1120px; margin-inline: auto;
display: grid; grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'head' 'stage' 'lead' 'act';
row-gap: 24px; align-items: start;
}
.cf-itype__inner > *{ min-width: 0; }
.cf-itype[data-solo] .cf-itype__inner{ grid-template-areas: 'head' 'lead' 'act'; max-inline-size: 52rem; }
@container itype (min-width: 880px){
.cf-itype:not([data-solo]) .cf-itype__inner{
grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
grid-template-rows: auto auto 1fr;
grid-template-areas: 'head stage' 'lead stage' 'act stage';
column-gap: clamp(32px, 5vw, 72px);
}
}
.cf-itype__h{
grid-area: head; margin: 0;
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.25rem, 1rem + 5.4cqi, 4.5rem);
line-height: 1.06;
text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
color: var(--band-ink, oklch(1 0 0));
}
@container itype (min-width: 880px){
.cf-itype__h{ font-size: clamp(2.5rem, 1rem + 4.4cqi, 4.875rem); }
}
.cf-itype__w{
font: inherit; letter-spacing: inherit; text-transform: inherit; line-height: inherit;
color: inherit; text-align: inherit;
margin: 0; padding: 0 0.07em; border: 0; border-radius: min(0.1em, var(--button-radius, var(--radius, 12px)));
display: inline; vertical-align: baseline; white-space: normal;
overflow-wrap: anywhere; max-inline-size: 100%;
cursor: pointer; -webkit-tap-highlight-color: transparent;
background-color: transparent;
background-image: linear-gradient(var(--itype-hl), var(--itype-hl));
background-repeat: no-repeat; background-position: 0 58%; background-size: 0% 78%;
text-decoration-line: underline; text-decoration-thickness: 0.07em;
text-underline-offset: 0.12em; text-decoration-color: var(--itype-line);
transition: background-size 0.32s cubic-bezier(.2,.7,.2,1), color 0.16s ease 0.1s, text-decoration-color 0.16s ease, transform 0.16s ease;
}
@media (hover: hover){
.cf-itype__w:hover{ text-decoration-color: var(--band-ink, oklch(1 0 0)); }
}
.cf-itype__w[aria-expanded='true']{
background-size: 100% 78%;
color: var(--itype-hl-ink);
text-decoration-color: transparent;
}
.cf-itype__w:active{ transform: translateY(1px); }
.cf-itype__w:focus-visible{ outline: 3px solid var(--band-ink, oklch(1 0 0)); outline-offset: 0.06em; }
.cf-itype__stage{ grid-area: stage; display: grid; gap: 16px; align-content: start; }
@container itype (min-width: 880px){
.cf-itype__stage{ justify-self: end; inline-size: 100%; max-inline-size: 30rem; padding-top: 0.4rem; }
}
.cf-itype__slot{ position: relative; min-width: 0; }
.cf-itype__panel{
position: relative; z-index: 2;
background: var(--card, oklch(1 0 0)); color: var(--ink, oklch(0.21 0.034 263));
border: 1px solid color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 30%, var(--card, oklch(1 0 0)));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 256 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 256 / 0.32)));
padding: 12px;
}
.cf-itype__media{
margin: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 6%, var(--card, oklch(1 0 0)));
}
.cf-itype__media img{ display: block; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: center 40%; }
.cf-itype__body{ display: grid; gap: 8px; padding: 16px 12px 12px; min-width: 0; }
.cf-itype__panel[data-noimg] .cf-itype__body{ padding-top: 12px; padding-inline-end: 56px; }
.cf-itype__plead{ margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 700; color: var(--accent, oklch(0.5 0.17 257)); }
.cf-itype__proof{
margin: 0; 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-wrap: balance; overflow-wrap: anywhere; color: var(--ink, oklch(0.21 0.034 263));
}
.cf-itype__detail{
margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5;
color: var(--muted, oklch(0.45 0.03 258)); text-wrap: pretty;
}
.cf-itype__close{
position: absolute; top: 20px; right: 20px; z-index: 1;
inline-size: 40px; block-size: 40px; border: 0; border-radius: 999px;
display: grid; place-items: center; cursor: pointer;
background: var(--card, oklch(1 0 0)); color: var(--ink, oklch(0.21 0.034 263));
box-shadow: var(--shadow-sm, 0 1px 2px oklch(0.22 0.03 256 / 0.25));
transition: transform 0.16s ease, background 0.16s ease;
}
.cf-itype__panel[data-noimg] .cf-itype__close{ top: 12px; right: 12px; }
.cf-itype__close:hover{ background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 7%, var(--card, oklch(1 0 0))); }
.cf-itype__close:active{ transform: scale(0.94); }
.cf-itype__close:focus-visible{ outline: 3px solid oklch(from var(--field-focus, var(--accent, oklch(0.5 0.17 257))) l c h / 0.6); outline-offset: 2px; }
.cf-itype__hint{
margin: 0; padding: 14px 16px;
font-size: 0.9375rem; line-height: 1.4; font-weight: 600; text-wrap: pretty;
color: var(--itype-soft);
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.08);
border: 1px solid oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.16);
border-radius: var(--radius, 12px);
}
.cf-itype__ico{ display: inline-block; inline-size: 1.05em; block-size: 1.05em; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-itype__keys{ display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cf-itype__keys > li{ min-width: 0; }
.cf-itype__key{
display: inline-flex; align-items: center; gap: 10px;
min-height: 48px; max-inline-size: 100%; padding: 4px 14px 4px 4px;
border-radius: var(--button-radius, var(--radius, 12px));
text-transform: var(--button-case, none);
border: 1px solid oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.18);
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.1);
color: var(--band-ink, oklch(1 0 0));
font-family: var(--font-body); font-size: 0.9375rem; font-weight: 700; line-height: 1.2;
cursor: pointer; -webkit-tap-highlight-color: transparent;
transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.cf-itype__key[data-noimg]{ padding-inline-start: 14px; }
.cf-itype__key img{ inline-size: 40px; block-size: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.cf-itype__key span{ min-width: 0; overflow-wrap: anywhere; }
.cf-itype__key:hover{ background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.16); }
.cf-itype__key:active{ transform: translateY(1px); }
.cf-itype__key[aria-expanded='true']{ background: var(--itype-hl); color: var(--itype-hl-ink); border-color: transparent; }
.cf-itype__key:focus-visible{ outline: 3px solid var(--band-ink, oklch(1 0 0)); outline-offset: 2px; }
@container itype (max-width: 559px){
.cf-itype__keys{ display: none; }
}
.cf-itype__lead{
grid-area: lead; margin: 0; max-inline-size: 40rem;
font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.45; font-weight: 500;
text-wrap: pretty; color: var(--band-ink, oklch(1 0 0));
}
.cf-itype__mark{
color: var(--itype-marker-ink);
background: linear-gradient(transparent 8%, var(--itype-marker) 8% 92%, transparent 92%);
padding: 0 0.2em; margin: 0 -0.05em;
border-radius: 0.2em 0.35em 0.25em 0.4em;
-webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.cf-itype__act{ grid-area: act; display: grid; gap: 12px; margin-top: 8px; justify-items: start; }
.cf-itype__row{ display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; max-inline-size: 100%; }
.cf-itype__cta{
--b: var(--button-bg, var(--cta, oklch(0.58 0.21 29)));
--b2: var(--button-bg-2, var(--cta-2, oklch(0.51 0.21 29)));
display: inline-flex; align-items: center; justify-content: center; text-align: center;
min-height: 72px; max-inline-size: 100%; padding: 12px 32px;
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; letter-spacing: -0.005em;
white-space: normal; text-wrap: balance; text-decoration: none; cursor: pointer;
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--b) calc(l + 0.04) c h), oklch(from var(--b2) calc(l - 0.02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--itype-shadow) l c h / 0.45), 0 8px 16px -6px oklch(from var(--itype-shadow) l c h / 0.55));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-itype__cta:hover, .cf-itype__cta.is-hover{
background: linear-gradient(oklch(from var(--b) calc(l - 0.01) c h), oklch(from var(--b2) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--b) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--itype-shadow) l c h / 0.5), 0 10px 18px -6px oklch(from var(--itype-shadow) l c h / 0.6);
}
.cf-itype__cta:active, .cf-itype__cta.is-active{
transform: translateY(1px);
background: linear-gradient(oklch(from var(--b) calc(l - 0.06) c h), oklch(from var(--b2) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--itype-shadow) l c h / 0.45), inset 0 -2px 0 oklch(from var(--b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--itype-shadow) l c h / 0.45);
}
.cf-itype__cta:focus-visible{ outline: 3px solid var(--band-ink, oklch(1 0 0)); outline-offset: 3px; }
.cf-itype__cta:disabled, .cf-itype__cta[aria-disabled='true']{
cursor: not-allowed; transform: none; text-shadow: none;
background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263)));
box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 2px oklch(0.22 0.03 256 / 0.25)));
}
.cf-itype__price{ margin: 0; display: grid; gap: 2px; line-height: 1.2; min-width: 0; }
.cf-itype__pline{ display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cf-itype__amt{
font-family: var(--font-display); font-weight: var(--display-weight, 800);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
color: var(--band-ink, oklch(1 0 0));
}
.cf-itype__per{ font-size: 0.9375rem; font-weight: 600; color: var(--band-ink, oklch(1 0 0)); }
.cf-itype__day{ font-size: 0.9375rem; font-weight: 500; color: var(--itype-soft); }
.cf-itype__note{ margin: 0; font-size: 0.9375rem; line-height: 1.4; font-weight: 600; color: var(--itype-soft); text-wrap: pretty; }
@container itype (max-width: 559px){
.cf-itype__act{ justify-items: stretch; }
.cf-itype__row{ display: grid; gap: 16px; }
.cf-itype__cta{ inline-size: 100%; padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce){
.cf-itype__w, .cf-itype__key, .cf-itype__cta, .cf-itype__close{ transition: none; }
.cf-itype__w:active, .cf-itype__key:active, .cf-itype__close:active{ transform: none; }
}
`;
pieces/hero/interactive-type-hero/specimen.tsx 51 lines
import __studioImage54d6c028 from "../assets/356208177187847d.webp";
import __studioImage6ed63d2b from "../assets/9eb62d564dff38f0.webp";
import __studioImage12d49f98 from "../assets/ca3b522302d5b070.webp";
// Specimen: Northpaw, a fictional dog-walk planning app; three tappable words in the promise reveal their proof.
import { InteractiveTypeHero } from '../interactive-type-hero';
import { slot } from '../../slots';
import defaults from '../../studio-defaults.json';
export const states = ['default', 'hover', 'active', 'disabled'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled';
export default function InteractiveTypeHeroSpecimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<InteractiveTypeHero
state={state}
headline='Your dog’s walks, planned {faster}, routed {safer}, shared {together}.'
words={[
{
word: 'faster',
proof: 'A full week of walks set up in 12 minutes.',
detail: 'Enter your work hours once. Northpaw fits each walk around them and moves it when your day changes.',
image: slot('item-1', __studioImage54d6c028),
imageAlt: 'A woman clipping a leash onto her golden retriever at the front door in the morning',
},
{
word: 'safer',
proof: 'Routes skip the busiest roads before you leave the door.',
detail: 'Choose quiet, shady or off-leash friendly and Northpaw draws the walk to match.',
image: slot('item-2', __studioImage6ed63d2b),
imageAlt: 'A border collie trotting along a quiet tree-lined footpath',
},
{
word: 'together',
proof: 'One schedule shared with up to 5 people in your home.',
detail: 'Everyone sees who is walking next, so nobody doubles up and nobody forgets.',
image: slot('item-3', __studioImage12d49f98),
imageAlt: 'A family walking their beagle together through a park at golden hour',
},
]}
lead='Northpaw plans every walk around your schedule, picks calmer streets and keeps the whole household in step.'
leadHighlight='around your schedule'
ctaLabel='Yes! I want Northpaw'
price='$36'
pricePeriod='a year'
priceBreakdown='about 10¢ a day'
actionNote={defaults.sample.guarantee}
proof='Used by 3,100 dog owners during the beta'
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalInteractiveTypeHero |
string |
|
words OptionalInteractiveTypeHero |
InteractiveWord[] |
|
lead OptionalInteractiveTypeHero |
string |
|
leadHighlight OptionalInteractiveTypeHero |
string |
|
ctaLabel OptionalInteractiveTypeHero |
string |
|
actionNote OptionalInteractiveTypeHero |
string |
|
price OptionalInteractiveTypeHero |
string |
|
pricePeriod OptionalInteractiveTypeHero |
string |
|
priceBreakdown OptionalInteractiveTypeHero |
string |
|
proof OptionalInteractiveTypeHero |
string |
|
defaultOpen OptionalInteractiveTypeHero |
number | null |
|
href OptionalInteractiveTypeHero |
string |
|
onAction OptionalInteractiveTypeHero |
(event: React.MouseEvent<HTMLElement>) => void |
|
state OptionalInteractiveTypeHero |
'default' | 'hover' | 'active' | 'disabled' |
|
copy OptionalInteractiveTypeHero |
InteractiveTypeHeroCopy |
|
className OptionalInteractiveTypeHero |
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--field-ink- 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.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
356208177187847d.webp
image/webp · 131 KB
-
9eb62d564dff38f0.webp
image/webp · 78.3 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
ca3b522302d5b070.webp
image/webp · 212 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB