Headline Ladder 1
Headline ladder: one statement climbs rung by rung on ruled ledger lines, from a whisper to a shout, and lands on a heavy accent "total" rule.
Use it in a prompt
Use content/headline-ladder 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/content/headline-ladder.tsx. - Import it and pass your copy and images (Props tab):
import { HeadlineLadder } from "@/components/funneldna/content/headline-ladder"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/headline-ladder/component.tsx 226 lines
// layout: ledger-receipt
// Headline ladder: one statement climbs rung by rung on ruled ledger lines, from a whisper to a shout, and lands on a heavy accent "total" rule.
// One belief hits with the weight of the whole section. There is no button: the type is the device.
import React, { useEffect, useLayoutEffect, useRef } from "react";
import { Backdrop, Divider, FX_HOST } from "../fx/fx";
export type HeadlineLadderProps = {
/** The statement, one rung per entry (4–5 reads best). Each rung is set larger and heavier than the one before. */
lines?: string[];
/** One-sentence paragraphs under the ladder. */
coda?: string[];
/** Optional single-word line that closes the coda ("Done."). */
punch?: string;
/** Ground: the theme's dark band or the light page surface. */
tone?: "band" | "surface";
/** Scene photo behind the band (fills the scene slot through Backdrop). Omit it for a flat band. */
sceneImage?: string;
/** Wave edge flowing into the next section. */
edge?: boolean;
/** Colour token of the section below, which the wave flows into. */
edgeTone?: "surface" | "band" | "card";
className?: string;
};
const DEFAULT_LINES = ["You don’t need", "more motivation.", "You need", "A SYSTEM."];
const DEFAULT_CODA = ["Motivation comes and goes.", "A system shows up every single day."];
const useIsoLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
export function HeadlineLadder(props: HeadlineLadderProps) {
const {
lines = DEFAULT_LINES,
coda = DEFAULT_CODA,
punch,
tone = "band",
sceneImage,
edge = true,
edgeTone = "surface",
className,
} = props;
const rootRef = useRef<HTMLElement | null>(null);
const ladderRef = useRef<HTMLDivElement | null>(null);
const rungs = ladder(lines);
const notes = (coda || []).map((s) => (s || "").trim()).filter(Boolean);
const closer = (punch || "").trim();
const key = rungs.map((r) => r.text).join("|");
// Arm the entrance only when motion is allowed and the observer exists. Otherwise the finished ladder simply stays.
useIsoLayoutEffect(() => {
const root = rootRef.current;
const target = ladderRef.current;
if (!root || !target) return;
if (typeof IntersectionObserver === "undefined") return;
if (typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
root.removeAttribute("data-in");
root.setAttribute("data-armed", "");
const io = new IntersectionObserver(
(entries) => {
for (const entry of entries) {
if (entry.isIntersecting) {
root.removeAttribute("data-armed");
root.setAttribute("data-in", "");
io.disconnect();
}
}
},
{ threshold: 0.15, rootMargin: "0px 0px -12% 0px" }
);
io.observe(target);
return () => {
io.disconnect();
root.removeAttribute("data-armed");
};
}, [key]);
if (!rungs.length) return null;
const showEdge = edge && !(tone === "surface" && edgeTone === "surface");
return (
<section
ref={rootRef}
className={["cf-hl", className].filter(Boolean).join(" ")}
data-tone={tone}
data-edge={showEdge ? "" : undefined}
style={FX_HOST}
>
<style>{CSS}</style>
{sceneImage ? (
<Backdrop
src={sceneImage}
treatment={tone === "band" ? "duotone" : "scrim-light"}
side="left"
position="70% 50%"
/>
) : null}
<div className="cf-hl-inner">
<div className="cf-hl-ladder" ref={ladderRef}>
<h2 className="cf-hl-h">
{rungs.map((r, i) => (
<React.Fragment key={i}>
{i > 0 ? " " : null}
<span
className="cf-hl-rung"
data-last={r.last ? "" : undefined}
style={
{
"--i": i,
"--s": r.size,
"--w": r.weight,
"--mix": `${r.mix}%`,
"--t": r.track,
"--rule": `${r.rule}px`,
} as React.CSSProperties
}
>
<span className="cf-hl-text">{r.text}</span>
</span>
</React.Fragment>
))}
</h2>
</div>
{notes.length || closer ? (
<div className="cf-hl-coda" style={{ "--i": rungs.length } as React.CSSProperties}>
{notes.map((n, i) => (
<p key={i}>{n}</p>
))}
{closer ? <p className="cf-hl-punch">{closer}</p> : null}
</div>
) : null}
</div>
{showEdge ? (
<div className="cf-hl-edge" aria-hidden="true">
<Divider shape="wave" tone={edgeTone} height={56} />
</div>
) : null}
</section>
);
}
export default HeadlineLadder;
type Rung = {
text: string;
size: number; // cqi of the ladder container
weight: number; // fraction of --display-weight
mix: number; // % of ink against the ground (whisper to full)
track: number; // multiplier on --display-tracking
rule: number; // ledger rule thickness in px
last: boolean;
};
// Size every rung from the container. A geometric climb is capped by a fit for the line's own length, so the biggest line
// always fits the width. A backward pass keeps each rung at most 86% of the next, so the climb stays visible.
function ladder(input: string[]): Rung[] {
const texts = (input || []).map((s) => (s || "").trim()).filter(Boolean);
const n = texts.length;
if (!n) return [];
const lo = 5.2;
const hi = 14.5;
const sizes = texts.map((t, i) => {
const step = n === 1 ? hi : lo * Math.pow(hi / lo, i / (n - 1));
return Math.min(step, 97 / emWidth(t));
});
for (let i = n - 2; i >= 0; i--) sizes[i] = Math.min(sizes[i], sizes[i + 1] * 0.86);
return texts.map((text, i) => {
const t = n === 1 ? 1 : i / (n - 1);
return {
text,
size: round(sizes[i]),
weight: round(0.55 + 0.45 * t),
mix: Math.round(82 + 18 * t),
track: round(0.3 + 1.1 * t),
rule: Math.round(1 + t * 1.6),
last: i === n - 1,
};
});
}
// A conservative advance estimate in em for heavy display faces (wide grotesks included).
function emWidth(s: string): number {
let w = 0;
for (const ch of s) {
if (ch === " ") w += 0.28;
else if (ch === "M" || ch === "W") w += 1;
else if (ch === "m" || ch === "w") w += 0.9;
else if (/[A-Z0-9]/.test(ch)) w += 0.8;
else if (/[.,'’!?:;\-–—"“”()]/.test(ch)) w += 0.32;
else w += 0.62;
}
return Math.max(w, 1);
}
function round(v: number): number {
return Math.round(v * 1000) / 1000;
}
const CSS = `
.cf-hl{--hl-ground:var(--band);--hl-ink:var(--band-ink);position:relative;isolation:isolate;overflow:clip;background:var(--hl-ground);color:var(--hl-ink);font-family:var(--font-body);padding-block:clamp(56px,8vw,112px) calc(clamp(64px,8.5vw,120px) + var(--hl-edge,0px));padding-inline:clamp(16px,5vw,48px)}
.cf-hl[data-tone="surface"]{--hl-ground:var(--surface);--hl-ink:var(--ink)}
.cf-hl[data-edge]{--hl-edge:56px}
.cf-hl-inner{position:relative;z-index:1;max-inline-size:1120px;margin-inline:auto;min-width:0}
.cf-hl-ladder{container-type:inline-size;min-width:0}
.cf-hl-h{margin:0;font-family:var(--font-display);text-transform:var(--display-case,none);font-synthesis-weight:none;font-kerning:normal}
.cf-hl-rung{display:block;position:relative;min-width:0;font-size:clamp(1.25rem,calc(var(--s) * 1cqi),12rem);line-height:1.04;font-weight:calc(var(--display-weight,800) * var(--w));letter-spacing:calc(var(--display-tracking,-0.025em) * var(--t));color:color-mix(in oklch,var(--hl-ink) var(--mix),var(--hl-ground));padding-block:.04em .2em;overflow-wrap:anywhere;hyphens:auto;text-wrap:balance;font-variant-numeric:tabular-nums}
.cf-hl-rung+.cf-hl-rung{margin-top:max(12px,.16em)}
.cf-hl-rung::after{content:"";position:absolute;inset-inline:0;bottom:0;height:var(--rule);background:oklch(from var(--hl-ink) l c h / .24);transform-origin:0 50%}
.cf-hl-rung[data-last]{color:var(--hl-ink);padding-bottom:.3em}
.cf-hl-rung[data-last]::after{height:max(4px,.05em);background:var(--accent-fill,var(--accent));border-radius:999px}
.cf-hl-text{display:block}
.cf-hl-coda{display:grid;gap:8px;margin-top:clamp(32px,4vw,48px);max-inline-size:40rem;min-width:0}
.cf-hl-coda p{margin:0;min-width:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--hl-ink) 90%,var(--hl-ground));text-wrap:pretty;overflow-wrap:anywhere}
.cf-hl-coda .cf-hl-punch{margin-top:12px;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--hl-ink)}
.cf-hl-edge{position:absolute;inset-inline:0;bottom:-1px;height:56px;z-index:1;pointer-events:none}
.cf-hl[data-armed] .cf-hl-text{opacity:.82;transform:translateY(8px)}
.cf-hl[data-armed] .cf-hl-rung::after{transform:scaleX(0)}
.cf-hl[data-armed] .cf-hl-coda{opacity:.82;transform:translateY(8px)}
.cf-hl[data-in] .cf-hl-text{transition:transform .45s cubic-bezier(.2,.7,.2,1) min(calc(var(--i) * .07s),.28s),opacity .45s cubic-bezier(.2,.7,.2,1) min(calc(var(--i) * .07s),.28s)}
.cf-hl[data-in] .cf-hl-rung::after{transition:transform .6s cubic-bezier(.2,.7,.2,1) min(calc(var(--i) * .07s + .1s),.38s)}
.cf-hl[data-in] .cf-hl-coda{transition:opacity .45s cubic-bezier(.2,.7,.2,1) .28s,transform .45s cubic-bezier(.2,.7,.2,1) .28s}
@media (prefers-reduced-motion:reduce){
.cf-hl[data-armed] .cf-hl-text,.cf-hl[data-armed] .cf-hl-coda{opacity:1;transform:none}
.cf-hl[data-armed] .cf-hl-rung::after{transform:none}
.cf-hl[data-in] .cf-hl-text,.cf-hl[data-in] .cf-hl-rung::after,.cf-hl[data-in] .cf-hl-coda{transition:none}
}
`;
pieces/content/headline-ladder/specimen.tsx 20 lines
import __studioImagebe88bf14 from "../assets/84c5fa58774c3c99.webp";
import HeadlineLadder from "../headline-ladder";
export const states = ["default"];
// Fictional sample business: Sourdough at Scale.
export default function HeadlineLadderSpecimen({ state }: { state?: string }) {
void state;
return (
<HeadlineLadder
lines={["You don’t need", "a better starter.", "You need", "a bake system", "THAT SCALES."]}
coda={[
"Same starter. Same oven. Same two hands.",
"A schedule that tells every batch what happens next.",
]}
punch="Scaled."
sceneImage={__studioImagebe88bf14}
/>
);
}
| Name | Type | Details |
|---|---|---|
lines OptionalHeadlineLadder |
string[] |
|
coda OptionalHeadlineLadder |
string[] |
|
punch OptionalHeadlineLadder |
string |
|
tone OptionalHeadlineLadder |
"band" | "surface" |
|
sceneImage OptionalHeadlineLadder |
string |
|
edge OptionalHeadlineLadder |
boolean |
|
edgeTone OptionalHeadlineLadder |
"surface" | "band" | "card" |
|
className OptionalHeadlineLadder |
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.
--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.
This piece reads no image slots.
-
84c5fa58774c3c99.webp
image/webp · 84.3 KB