Type Wall Hero 1
Type wall hero: the promise is fitted edge to edge as the whole first screen, then one slim hello-strip carries the subhead, the price, a single Add To Cart action, proof and a P.S.
Use it in a prompt
Use hero/type-wall-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/type-wall-hero.tsx. - Import it and pass your copy and images (Props tab):
import { TypeWallHero } from "@/components/funneldna/hero/type-wall-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/type-wall-hero/component.tsx 309 lines
// layout: hello-strip
// Type wall hero: the promise is fitted edge to edge as the whole first screen, then one slim hello-strip carries the subhead, the price, a single Add To Cart action, proof and a P.S.
import * as React from 'react';
import { ShoppingCart } from 'lucide-react';
import { BackdropVideo, FX_HOST } from '../fx/fx';
import sweep from '../fx/loops/sweep';
type LoopAsset = React.ComponentProps<typeof BackdropVideo>['video'];
export type HeadlineLine = {
// One display line. Each line is fitted to the full column width.
text: React.ReactNode;
// true = the whole line takes the accent role; a string = only that phrase inside the line.
accent?: boolean | string;
};
export type TypeWallHeroProps = {
// 2 to 4 headline lines, fitted edge to edge.
lines?: HeadlineLine[];
// Optional re-break of the same headline used when the column is under 600px wide (phones).
narrowLines?: HeadlineLine[];
// One-line supporting promise in the strip.
subhead?: React.ReactNode;
price?: string;
// Price sentence; '{price}' is replaced with the price.
priceLine?: string;
// Small line under the price sentence.
priceNote?: React.ReactNode;
actionLabel?: string;
href?: string;
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
// Small proof line; renders nothing when missing.
proof?: React.ReactNode;
// P.S. line under the action; renders nothing when missing.
ps?: React.ReactNode;
psLabel?: string;
// Slot 'product'. The slim right rail shows only when an image is supplied (wide screens).
productImage?: string;
productAlt?: string;
productCaption?: React.ReactNode;
// fx loop played behind the band (poster first, own pause button).
backdrop?: LoopAsset;
// A short line may grow to at most this multiple of the smallest fitted line.
maxLineScale?: number;
state?: 'default' | 'hover' | 'active' | 'disabled';
disabled?: boolean;
className?: string;
};
export function TypeWallHero(props: TypeWallHeroProps) {
const {
lines = DEFAULT_LINES,
narrowLines,
subhead = 'Plan your funnel, write your page copy and check every step before you launch.',
price = '$47',
priceLine = '{price} today. One payment.',
priceNote = 'Lifetime access, yours to keep.',
actionLabel = 'Add To Cart',
href,
onAction,
proof,
ps,
psLabel = 'P.S.',
productImage,
productAlt = '',
productCaption,
backdrop = sweep,
maxLineScale = 1.5,
state = 'default',
disabled: disabledProp,
className,
} = props;
const id = React.useId();
const headRef = React.useRef<HTMLHeadingElement>(null);
const [narrow, setNarrow] = React.useState(false);
const [sizes, setSizes] = React.useState<number[] | null>(null);
const hasNarrow = !!narrowLines && narrowLines.length > 0;
const active = narrow && hasNarrow && narrowLines ? narrowLines : lines;
const linesKey = active
.map((l, i) => (typeof l.text === 'string' ? l.text : '#' + i) + '~' + String(l.accent ?? ''))
.join('|');
const fitted = !!sizes && sizes.length === active.length;
useIsoLayoutEffect(() => {
const h = headRef.current;
if (!h) return;
let live = true;
const run = () => {
if (!live) return;
const w = h.clientWidth;
if (!w) return;
const wantNarrow = hasNarrow && w < NARROW_AT;
if (wantNarrow !== narrow) {
setNarrow(wantNarrow);
return;
}
const els = Array.from(h.querySelectorAll<HTMLElement>('[data-twh-line]'));
if (!els.length) return;
const fits = els.map((el) => {
const fs = el.style.fontSize;
const ws = el.style.whiteSpace;
const mi = el.style.maxInlineSize;
el.style.fontSize = '100px';
el.style.whiteSpace = 'nowrap';
el.style.maxInlineSize = 'none';
const lw = el.getBoundingClientRect().width;
el.style.fontSize = fs;
el.style.whiteSpace = ws;
el.style.maxInlineSize = mi;
return lw > 0 ? (100 * w * SAFETY) / lw : Infinity;
});
const finite = fits.filter((f) => Number.isFinite(f));
if (!finite.length) return;
const base = Math.min(...finite);
let next = fits.map((f) => Math.min(Number.isFinite(f) ? f : base, base * maxLineScale));
const total = next.reduce((sum, s) => sum + s * LINE_HEIGHT, 0);
const room = Math.max(220, window.innerHeight * 0.62);
if (total > room) next = next.map((s) => s * (room / total));
const done = next.map((s) => Math.floor(s * 10) / 10);
setSizes((prev) =>
prev && prev.length === done.length && prev.every((p, i) => Math.abs(p - done[i]) < 0.2) ? prev : done,
);
};
run();
const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(() => run()) : null;
ro?.observe(h);
window.addEventListener('resize', run);
const fonts = typeof document !== 'undefined' ? document.fonts : undefined;
fonts?.ready.then(run).catch(() => undefined);
fonts?.addEventListener?.('loadingdone', run);
return () => {
live = false;
ro?.disconnect();
window.removeEventListener('resize', run);
fonts?.removeEventListener?.('loadingdone', run);
};
}, [narrow, hasNarrow, linesKey, maxLineScale]);
const disabled = !!disabledProp || state === 'disabled';
const inner = (
<>
<ShoppingCart className='cf-twh__cart' size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='cf-twh__label'>{actionLabel}</span>
{price ? (
<>
<span className='cf-twh__rule' aria-hidden='true' />
<span className='cf-twh__btnprice'>{price}</span>
</>
) : null}
</>
);
const action =
href && !disabled ? (
<a className='cf-twh__btn' href={href} onClick={onAction}>
{inner}
</a>
) : (
<button type='button' className='cf-twh__btn' disabled={disabled} onClick={onAction}>
{inner}
</button>
);
const hasPrice = !!(priceLine || priceNote);
return (
<section
className={['cf-twh', className].filter(Boolean).join(' ')}
style={FX_HOST}
data-state={state}
aria-labelledby={id + '-h'}
>
<style>{CSS}</style>
<BackdropVideo video={backdrop} treatment='duotone' side='left' control='top-right' />
<div className='cf-twh__wrap'>
<div className={'cf-twh__stage' + (productImage ? ' cf-twh__stage--rail' : '')}>
<h1 className='cf-twh__h1' id={id + '-h'} ref={headRef} data-fit={fitted ? '' : undefined}>
{active.map((line, i) => (
<React.Fragment key={i}>
{i > 0 ? ' ' : null}
<span className='cf-twh__mask' style={fitted && sizes ? { fontSize: sizes[i] + 'px' } : undefined}>
<span
className='cf-twh__line'
data-twh-line=''
style={{ ['--twh-d' as string]: Math.min(i * 0.08, 0.28) + 's' } as React.CSSProperties}
>
{renderLine(line)}
</span>
</span>
</React.Fragment>
))}
</h1>
{productImage ? (
<figure className='cf-twh__rail cf-twh__rise'>
<img src={productImage} alt={productAlt} width={600} height={600} decoding='async' />
{productCaption ? <figcaption>{productCaption}</figcaption> : null}
</figure>
) : null}
</div>
<div className='cf-twh__strip cf-twh__rise'>
<div className='cf-twh__stripin'>
{subhead ? <p className='cf-twh__sub'>{subhead}</p> : null}
<div className='cf-twh__act'>
{hasPrice ? (
<div className='cf-twh__price'>
{priceLine ? <p className='cf-twh__priceline'>{renderPriceLine(priceLine, price)}</p> : null}
{priceNote ? <p className='cf-twh__note'>{priceNote}</p> : null}
</div>
) : null}
{action}
</div>
{proof ? <p className='cf-twh__proof'>{proof}</p> : null}
{ps ? (
<p className='cf-twh__ps'>
<strong>{psLabel}</strong> {ps}
</p>
) : null}
</div>
</div>
</div>
</section>
);
}
export default TypeWallHero;
const DEFAULT_LINES: HeadlineLine[] = [
{ text: 'Build your first' },
{ text: 'funnel with a' },
{ text: 'clear plan.', accent: true },
];
const NARROW_AT = 600;
const SAFETY = 0.985;
// Line box (1.04) plus the gap between fitted lines (0.12em), used to keep the wall inside the first screen.
const LINE_HEIGHT = 1.16;
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
function renderLine(line: HeadlineLine): React.ReactNode {
const { text, accent } = line;
if (accent === true) return <span className='cf-twh__key'>{text}</span>;
if (typeof accent === 'string' && accent && typeof text === 'string') {
const at = text.indexOf(accent);
if (at >= 0) {
return (
<>
{text.slice(0, at)}
<span className='cf-twh__key'>{accent}</span>
{text.slice(at + accent.length)}
</>
);
}
}
return text;
}
function renderPriceLine(template: string, price: string): React.ReactNode {
return template.split('{price}').map((part, i) => (
<React.Fragment key={i}>
{i > 0 && price ? <strong className='cf-twh__num'>{price}</strong> : null}
{part}
</React.Fragment>
));
}
const CSS = `
.cf-twh{position:relative;isolation:isolate;overflow:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);--twh-key:color-mix(in oklch,var(--accent-fill,var(--accent)) 50%,var(--band-ink));--twh-soft:color-mix(in oklch,var(--band-ink) 86%,var(--band));--twh-gutter:clamp(16px,5vw,48px);--twh-shadow:var(--shadow,oklch(0.22 0.03 260))}
.cf-twh *,.cf-twh *::before,.cf-twh *::after{box-sizing:border-box}
.cf-twh__wrap{position:relative;z-index:1;container-type:inline-size;display:flex;flex-direction:column;min-block-size:min(100svh,960px);padding-block:clamp(56px,7vw,112px) 0}
.cf-twh__stage{flex:1 0 auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:center;align-items:start;column-gap:clamp(32px,4cqi,72px);inline-size:100%;max-inline-size:1600px;margin-inline:auto;padding-inline:var(--twh-gutter);padding-block-end:clamp(40px,5cqi,72px)}
.cf-twh__stage>*{min-width:0}
.cf-twh__h1{margin:0;min-width:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.025em);line-height:1.04;font-size:clamp(2.5rem,11cqi,10rem);color:var(--band-ink);text-wrap:balance;overflow-wrap:anywhere;hyphens:auto}
.cf-twh__mask{display:block;margin:0;padding:0}
.cf-twh__mask+.cf-twh__mask{margin-block-start:max(16px,.12em)}
.cf-twh__line{display:inline-block;max-inline-size:100%;vertical-align:top;animation:cf-twh-in .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--twh-d,0s)}
.cf-twh__h1[data-fit] .cf-twh__line{white-space:nowrap;max-inline-size:none}
.cf-twh__key{color:var(--twh-key)}
.cf-twh__rail{display:none;margin:0}
.cf-twh__rail img{display:block;inline-size:100%;block-size:auto;max-block-size:52svh;object-fit:contain;object-position:center top;border-radius:0;filter:drop-shadow(0 2px 3px oklch(from var(--twh-shadow) l c h / .45)) drop-shadow(0 14px 18px oklch(from var(--twh-shadow) l c h / .4))}
.cf-twh__rail figcaption{font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--twh-soft);text-wrap:pretty}
@container (min-width:1024px){.cf-twh__stage--rail{grid-template-columns:minmax(0,1fr) clamp(200px,19cqi,300px)}.cf-twh__rail{display:flex;flex-direction:column;gap:12px}}
.cf-twh__strip{background:oklch(from var(--band) calc(l - 0.06) c h / .9);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.cf-twh__stripin{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:'sub' 'act' 'proof' 'ps';row-gap:16px;inline-size:100%;max-inline-size:1600px;margin-inline:auto;padding:clamp(24px,3vw,40px) var(--twh-gutter) clamp(32px,3.6vw,48px)}
.cf-twh__stripin>*{min-width:0}
.cf-twh__sub{grid-area:sub;margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--band-ink);text-wrap:pretty}
.cf-twh__act{grid-area:act;display:flex;flex-direction:column;align-items:stretch;gap:16px;min-width:0}
.cf-twh__price{display:flex;flex-direction:column;gap:4px;min-width:0}
.cf-twh__priceline{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.2;font-weight:600;color:var(--band-ink);text-wrap:pretty}
.cf-twh__num{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.cf-twh__note,.cf-twh__proof,.cf-twh__ps{margin:0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--twh-soft);text-wrap:pretty}
.cf-twh__proof{grid-area:proof}
.cf-twh__ps{grid-area:ps}
.cf-twh__ps strong{color:var(--band-ink);font-weight:800}
.cf-twh__btn{--twh-b:var(--button-bg,var(--cta));--twh-b2:var(--button-bg-2,var(--cta-2));position:relative;display:inline-flex;align-items:center;justify-content:center;gap:12px;inline-size:100%;min-width:0;min-block-size:72px;padding:12px 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;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);text-decoration:none;cursor:pointer;background:linear-gradient(oklch(from var(--twh-b) calc(l + 0.04) c h),oklch(from var(--twh-b2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--twh-b) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--twh-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--twh-shadow) l c h / .45),0 8px 16px -6px oklch(from var(--twh-shadow) l c h / .55));transition:transform .16s ease,box-shadow .16s ease,background .16s ease;-webkit-tap-highlight-color:transparent}
.cf-twh__btn:hover:not(:disabled),.cf-twh[data-state='hover'] .cf-twh__btn:not(:disabled){background:linear-gradient(oklch(from var(--twh-b) calc(l - 0.01) c h),oklch(from var(--twh-b2) calc(l - 0.07) c h));transform:translateY(-1px);box-shadow:inset 0 1px 0 oklch(from var(--twh-b) calc(l + 0.12) c h / .6),inset 0 -3px 0 oklch(from var(--twh-b) calc(l - 0.2) c h),0 1px 2px oklch(from var(--twh-shadow) l c h / .5),0 10px 18px -6px oklch(from var(--twh-shadow) l c h / .65)}
.cf-twh__btn:active:not(:disabled),.cf-twh[data-state='active'] .cf-twh__btn:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--twh-b) calc(l - 0.04) c h),oklch(from var(--twh-b2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--twh-b) calc(l - 0.22) c h / .55),inset 0 -2px 0 oklch(from var(--twh-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--twh-shadow) l c h / .4)}
.cf-twh__btn:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-twh__btn:disabled{cursor:not-allowed;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));transform:none}
.cf-twh__label{min-width:0;text-wrap:balance;text-align:center}
.cf-twh__rule{flex:none;inline-size:1px;block-size:1.1em;background:currentColor;opacity:.45}
.cf-twh__btnprice{flex:none;white-space:nowrap;font-variant-numeric:tabular-nums}
.cf-twh__cart{flex:none}
@container (min-width:640px){.cf-twh__act{flex-direction:row;align-items:center;gap:24px}.cf-twh__btn{inline-size:auto}}
@container (min-width:1080px){.cf-twh__stripin{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'sub act' 'proof ps';column-gap:clamp(32px,5cqi,72px);row-gap:12px;align-items:center}.cf-twh__price{text-align:right}.cf-twh__proof,.cf-twh__ps{align-self:start}.cf-twh__ps{contain:inline-size}}
.cf-twh__rise{animation:cf-twh-in .45s cubic-bezier(.2,.7,.2,1) .28s both}
@keyframes cf-twh-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.cf-twh__line,.cf-twh__rise{animation:none}.cf-twh__btn{transition:none}.cf-twh__btn:hover:not(:disabled),.cf-twh__btn:active:not(:disabled){transform:none}}
`;
pieces/hero/type-wall-hero/specimen.tsx 41 lines
import __studioImageae24f7c9 from "../assets/aee157951302ca5b.webp";
import * as React from 'react';
import { TypeWallHero, type TypeWallHeroProps } from '../type-wall-hero';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
export default function TypeWallHeroSpecimen({ state }: { state?: TypeWallHeroProps['state'] }) {
const sample = defaults.sample;
return (
<TypeWallHero
state={state}
lines={[
{ text: 'Know where every' },
{ text: 'dollar went. In ten', accent: 'In ten' },
{ text: 'minutes a month.', accent: true },
]}
narrowLines={[
{ text: 'Know where' },
{ text: 'every dollar' },
{ text: 'went. In ten', accent: 'In ten' },
{ text: 'minutes a month.', accent: true },
]}
subhead='One page, three piles, every charge sorted before your coffee cools.'
price={sample.price}
priceLine='{price} today. That’s it.'
priceNote='No subscription, no upsell to unlock it.'
actionLabel='Add To Cart'
href='#checkout'
proof='“Ten minutes and one coffee. I finally knew where March went.” Dana R., Austin'
ps='Try Tallywise for 30 days. If it doesn’t show you where your money went, ask for a full refund.'
productImage={slot(
'product',
__studioImageae24f7c9,
)}
productAlt='Tallywise Monthly Review planner with a slim pen clipped to the spiral'
productCaption='The Tallywise Monthly Review: the one page you fill in each month.'
/>
);
}
| Name | Type | Details |
|---|---|---|
lines OptionalTypeWallHero |
HeadlineLine[] |
|
narrowLines OptionalTypeWallHero |
HeadlineLine[] |
|
subhead OptionalTypeWallHero |
React.ReactNode |
|
price OptionalTypeWallHero |
string |
|
priceLine OptionalTypeWallHero |
string |
|
priceNote OptionalTypeWallHero |
React.ReactNode |
|
actionLabel OptionalTypeWallHero |
string |
|
href OptionalTypeWallHero |
string |
|
onAction OptionalTypeWallHero |
(event: React.MouseEvent<HTMLElement>) => void |
|
proof OptionalTypeWallHero |
React.ReactNode |
|
ps OptionalTypeWallHero |
React.ReactNode |
|
psLabel OptionalTypeWallHero |
string |
|
productImage OptionalTypeWallHero |
string |
|
productAlt OptionalTypeWallHero |
string |
|
productCaption OptionalTypeWallHero |
React.ReactNode |
|
backdrop OptionalTypeWallHero |
LoopAsset |
|
maxLineScale OptionalTypeWallHero |
number |
|
state OptionalTypeWallHero |
'default' | 'hover' | 'active' | 'disabled' |
|
disabled OptionalTypeWallHero |
boolean |
|
className OptionalTypeWallHero |
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.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
- 3f53d2ed889fcb35.mp4 video/mp4 · 188 KB
-
4b8007624c8cad38.webp
image/webp · 12.9 KB
- 77f5156a8b9c01c4.webm video/webm · 113 KB
-
aee157951302ca5b.webp
image/webp · 57.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB