Big Number Hero 1
Big number hero: one supplied number leads the first screen. It counts up once and, when a comparison is supplied, a thin bar shows it against that comparison before the headline and the one action.
Use it in a prompt
Use hero/big-number-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/big-number-hero.tsx. - Import it and pass your copy and images (Props tab):
import { BigNumberHero } from "@/components/funneldna/hero/big-number-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/big-number-hero/component.tsx 279 lines
// layout: classic-centred-stack
// Big number hero: one supplied number leads the first screen. It counts up once and, when a comparison is supplied, a thin bar shows it against that comparison before the headline and the one action.
import React, { useEffect, useLayoutEffect, useMemo, useState } from "react";
import { Clock, Users } from "lucide-react";
import { Divider, FX_HOST, Spotlight } from "../fx/fx";
import torn from "../fx/dividers/torn";
type EdgeTone = React.ComponentProps<typeof Divider>["tone"];
export type BigNumberHeroProps = {
/** The one supplied number, e.g. "47" or "1,200". Empty means a headline-led hero with no number and no bar. */
number?: string;
/** Unit beside the number, e.g. "minutes". */
unit?: string;
/** What the number is, in one line. */
caption?: string;
/** The comparison in the same unit as the number (e.g. 360 for 6 hours). The bar renders only with compareLabel too. */
compareValue?: number;
/** The comparison in words, e.g. "vs 6 hours by hand". */
compareLabel?: string;
/** Left bar label. Placeholders: {number}, {unit}. */
barLabel?: string;
headline?: React.ReactNode;
subhead?: React.ReactNode;
/** Italic aside in the author's voice, under the subhead. */
aside?: React.ReactNode;
/** The button says the outcome, e.g. "Start planning my funnel". */
actionLabel?: string;
href?: string;
onAction?: () => void;
/** One short reassurance line under the button. */
note?: string;
/** Small proof line. Defaults empty and renders nothing when missing. */
proof?: string;
disabled?: boolean;
/** Count the number up once on load. Always the final value under reduced motion. */
animate?: boolean;
/** Torn paper edge into the next section. */
showEdge?: boolean;
/** Token of the section below, for the torn edge (default surface). */
edgeTone?: EdgeTone;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
const useIsoLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
export function BigNumberHero(props: BigNumberHeroProps) {
const {
number = "",
unit = "",
caption = "",
compareValue,
compareLabel = "",
barLabel = "{number} {unit}",
headline = "Build your first funnel with a clear plan",
subhead = "Plan your funnel, write your page copy, and check every step before you launch.",
aside,
actionLabel = "Start planning my funnel",
href,
onAction,
note = "",
proof = "",
disabled = false,
animate = true,
showEdge = true,
edgeTone,
state = "default",
className = "",
} = props;
const shown = number.trim();
const parsed = useMemo(() => parseNumber(shown), [shown]);
const [progress, setProgress] = useState(1);
useIsoLayoutEffect(() => {
if (!parsed || !animate || typeof window === "undefined") return;
if (!window.matchMedia || window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
let raf = 0;
let start = 0;
setProgress(0);
const tick = (t: number) => {
if (!start) start = t;
const e = Math.min(1, Math.max(0, (t - start - DELAY) / DURATION));
setProgress(1 - Math.pow(1 - e, 3));
if (e < 1) raf = window.requestAnimationFrame(tick);
};
raf = window.requestAnimationFrame(tick);
return () => {
window.cancelAnimationFrame(raf);
setProgress(1);
};
}, [parsed?.value, animate]);
const hasNumber = shown.length > 0;
const finalText = parsed ? formatNumber(parsed, parsed.value) : shown;
const liveText = parsed ? formatNumber(parsed, parsed.value * progress) : shown;
const ratio =
parsed && compareLabel.trim() && typeof compareValue === "number" && compareValue > 0
? Math.min(1, Math.max(0.02, parsed.value / compareValue))
: null;
const chars = Math.max(2, glyphWidth(finalText));
const isDisabled = disabled || state === "disabled";
const forced = state !== "default" ? state : undefined;
const leftLabel = barLabel.replace("{number}", finalText).replace("{unit}", unit).trim();
const handle = (e: React.MouseEvent) => {
if (isDisabled) {
e.preventDefault();
return;
}
onAction?.();
};
const rise = (i: number) => ({ animationDelay: `${Math.min(i * 0.07, 0.28)}s` });
const rootClass = ["cf-big-number-hero", hasNumber ? "" : "cf-bnh--lead", showEdge ? "cf-bnh--edge" : "", className]
.filter(Boolean)
.join(" ");
return (
<section className={rootClass} style={FX_HOST}>
<Spotlight />
<div className="cf-bnh__inner">
{hasNumber && (
<div className="cf-bnh__stage">
<p className="cf-bnh__figure">
<span className="cf-bnh__sr">{[finalText, unit].filter(Boolean).join(" ")}</span>
<span className="cf-bnh__num" aria-hidden="true" style={{ ["--bnh-chars" as string]: chars } as React.CSSProperties}>
<span className="cf-bnh__digits">
<span className="cf-bnh__ghost">{finalText}</span>
<span className="cf-bnh__live">{liveText}</span>
</span>
</span>
{unit && (
<span className="cf-bnh__unit" aria-hidden="true">
{unit}
</span>
)}
</p>
{caption && <p className="cf-bnh__caption">{caption}</p>}
{ratio !== null && (
<div className="cf-bnh__bar">
<p className="cf-bnh__bar-labels">
<strong>{leftLabel}</strong>
<span>{compareLabel}</span>
</p>
<div className="cf-bnh__track" aria-hidden="true">
<span
className="cf-bnh__fill"
style={{ ["--bnh-ratio" as string]: ratio, ["--bnh-p" as string]: progress } as React.CSSProperties}
/>
</div>
</div>
)}
</div>
)}
<div className="cf-bnh__copy">
<h1 className="cf-bnh__headline cf-bnh__rise" style={rise(0)}>
{headline}
</h1>
{subhead && (
<p className="cf-bnh__sub cf-bnh__rise" style={rise(1)}>
{subhead}
</p>
)}
{aside && (
<p className="cf-bnh__aside cf-bnh__rise" style={rise(2)}>
{aside}
</p>
)}
<div className="cf-bnh__action cf-bnh__rise" style={rise(3)}>
{href && !isDisabled ? (
<a className="cf-bnh__cta" href={href} onClick={handle} data-state={forced}>
{actionLabel}
</a>
) : (
<button type="button" className="cf-bnh__cta" onClick={handle} disabled={isDisabled} data-state={forced}>
{actionLabel}
</button>
)}
{note && (
<p className="cf-bnh__note">
<Clock className="cf-bnh__icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{note}
</p>
)}
{proof && (
<p className="cf-bnh__proof">
<Users className="cf-bnh__icon" size={16} strokeWidth={2.5} aria-hidden="true" />
{proof}
</p>
)}
</div>
</div>
</div>
{showEdge && <Divider shape="torn" src={torn} tone={(edgeTone ?? "surface") as EdgeTone} height={56} />}
<style>{CSS}</style>
</section>
);
}
export default BigNumberHero;
const DELAY = 180;
const DURATION = 1400;
type Parsed = { prefix: string; value: number; suffix: string; decimals: number; grouped: boolean };
function parseNumber(text: string): Parsed | null {
const m = text.match(/^([^0-9]*?)([0-9][0-9,]*(?:[.][0-9]+)?)(.*)$/);
if (!m) return null;
const value = parseFloat(m[2].replace(/,/g, ""));
if (!Number.isFinite(value)) return null;
return {
prefix: m[1],
value,
suffix: m[3],
decimals: (m[2].split(".")[1] || "").length,
grouped: m[2].indexOf(",") >= 0,
};
}
function formatNumber(p: Parsed, v: number) {
const fixed = v.toFixed(p.decimals);
if (!p.grouped) return p.prefix + fixed + p.suffix;
const parts = fixed.split(".");
const grouped = parts[0].replace(/(?=(?:[0-9]{3})+$)(?!^)/g, ",");
return p.prefix + grouped + (parts[1] ? "." + parts[1] : "") + p.suffix;
}
function glyphWidth(text: string) {
return text.split("").reduce((w, ch) => w + (ch === "," || ch === "." ? 0.4 : 1), 0);
}
const CSS = `
.cf-big-number-hero{position:relative;isolation:isolate;overflow-x:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);text-align:center;padding-block:clamp(56px,8vw,112px) clamp(64px,8.5vw,120px);padding-inline:clamp(16px,5vw,48px)}
.cf-big-number-hero.cf-bnh--edge{padding-bottom:calc(clamp(64px,8.5vw,120px) + 56px)}
.cf-bnh__inner{position:relative;z-index:1;margin-inline:auto;max-inline-size:1120px;min-width:0;display:flex;flex-direction:column;align-items:center}
.cf-bnh__stage{inline-size:100%;max-inline-size:64rem;min-width:0;container-type:inline-size;overflow-x:clip;padding-bottom:8px}
.cf-bnh__figure{margin:0;display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:8px 20px;min-width:0}
.cf-bnh__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.cf-bnh__num{position:relative;display:inline-block;min-width:0;max-inline-size:100%;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.03em;line-height:.92;white-space:nowrap;font-variant-numeric:tabular-nums lining-nums;font-feature-settings:"tnum" 1,"lnum" 1;font-size:clamp(2.5rem,calc(110vw / var(--bnh-chars,3)),16rem);font-size:clamp(2.5rem,calc(130cqi / var(--bnh-chars,3)),16rem)}
.cf-bnh__num::after{content:"";position:absolute;z-index:-1;left:50%;bottom:-.05em;inline-size:96%;block-size:.12em;transform:translateX(-50%);background:radial-gradient(closest-side,oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - 0.1) c h / 0.9),transparent);pointer-events:none}
.cf-bnh__digits{display:inline-grid;padding-block:.12em;margin-block:-.12em;color:var(--band-ink)}
.cf-bnh__ghost,.cf-bnh__live{grid-area:1/1}
.cf-bnh__ghost{visibility:hidden}
.cf-bnh__live{justify-self:end}
@supports ((-webkit-background-clip:text) or (background-clip:text)){.cf-bnh__digits{background:linear-gradient(180deg,var(--band-ink) 35%,color-mix(in oklch,var(--band-ink) 72%,var(--band)));-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent}}
.cf-bnh__unit{min-width: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(2rem,3.6vw,3.25rem);line-height:1.06;color:color-mix(in oklch,var(--band-ink) 86%,var(--band));overflow-wrap:break-word;hyphens:manual}
@container (max-width: 36rem){.cf-bnh__figure{flex-direction:column;align-items:center;gap:8px}}
.cf-bnh__caption{margin:16px auto 0;max-inline-size:36rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--band-ink) 86%,var(--band));text-wrap:balance;overflow-wrap:anywhere}
.cf-bnh__bar{margin:32px auto 0;inline-size:100%;max-inline-size:36rem;min-width:0}
.cf-bnh__bar-labels{margin:0;display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 16px;font-size:.9375rem;line-height:1.4;font-weight:600;text-align:left;color:color-mix(in oklch,var(--band-ink) 84%,var(--band))}
.cf-bnh__bar-labels strong{min-width:0;color:var(--band-ink);font-weight:800}
.cf-bnh__bar-labels span{min-width:0;margin-inline-start:auto;text-align:right}
.cf-bnh__track{position:relative;margin-top:12px;block-size:8px;border-radius:999px;overflow:hidden;background:oklch(from var(--band-ink) l c h / 0.16)}
.cf-bnh__fill{position:absolute;inset-block:0;inset-inline-start:0;inline-size:calc(var(--bnh-ratio,1) * 100%);border-radius:inherit;background:var(--band-ink);transform-origin:left center;transform:scaleX(var(--bnh-p,1))}
.cf-bnh__copy{inline-size:100%;max-inline-size:46rem;min-width:0;margin-top:clamp(48px,5vw,64px);display:flex;flex-direction:column;align-items:center}
.cf-bnh--lead .cf-bnh__copy{margin-top:0;max-inline-size:56rem}
.cf-bnh__headline{margin:0;max-inline-size:100%;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(2rem,3.6vw,3.25rem);line-height:1.06;color:var(--band-ink);text-wrap:balance;overflow-wrap:break-word;hyphens:manual}
.cf-bnh--lead .cf-bnh__headline{font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04}
.cf-bnh__sub{margin:clamp(20px,1.8vw,24px) 0 0;max-inline-size:40rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:color-mix(in oklch,var(--band-ink) 88%,var(--band));text-wrap:pretty;overflow-wrap:anywhere}
.cf-bnh__aside{margin:16px 0 0;max-inline-size:36rem;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;font-style:italic;font-weight:500;color:color-mix(in oklch,var(--band-ink) 84%,var(--band));text-wrap:pretty;overflow-wrap:anywhere}
.cf-bnh__action{margin-top:clamp(32px,3.4vw,40px);inline-size:100%;min-width:0;display:flex;flex-direction:column;align-items:center;gap:12px}
.cf-bnh__action > .cf-bnh__cta + p{margin-top:4px}
.cf-bnh__cta{display:inline-flex;align-items:center;justify-content:center;max-inline-size:100%;min-height:72px;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;text-align:center;text-wrap:balance;text-decoration:none;cursor:pointer;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 + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.14) c h / 0.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)) calc(l - 0.08) c h / 0.5),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - 0.08) c h / 0.55));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-bnh__cta:hover:not(:disabled),.cf-bnh__cta[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));box-shadow:inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) c h / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - 0.08) c h / 0.55),0 10px 18px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - 0.08) c h / 0.65)}
.cf-bnh__cta:active:not(:disabled),.cf-bnh__cta[data-state="active"]{transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.08) c h));box-shadow:inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - 0.22) c h / 0.6),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) calc(l - 0.08) c h / 0.5)}
.cf-bnh__cta:focus-visible{outline:3px solid var(--band-ink);outline-offset:4px}
.cf-bnh__cta:disabled{cursor:not-allowed;transform:none;text-shadow:none;color:var(--button-2-ink,var(--secondary-ink));background:var(--button-2-bg,var(--secondary));box-shadow:var(--button-2-shadow,var(--shadow-sm))}
.cf-bnh__note,.cf-bnh__proof{margin:0;max-inline-size:34rem;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty;overflow-wrap:anywhere;color:color-mix(in oklch,var(--band-ink) 84%,var(--band))}
.cf-bnh__proof{color:var(--band-ink)}
.cf-bnh__icon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-bnh__rise{animation:cf-bnh-rise .45s cubic-bezier(.2,.7,.2,1) both}
@keyframes cf-bnh-rise{from{opacity:.82;transform:translateY(8px)}}
@media (max-width: 30rem){.cf-bnh__cta{inline-size:100%;padding-inline:24px}}
@media (prefers-reduced-motion: reduce){.cf-bnh__rise{animation:none}.cf-bnh__fill{transform:none}.cf-bnh__cta{transition:none}.cf-bnh__cta:active:not(:disabled),.cf-bnh__cta[data-state="active"]{transform:none}}
`;
pieces/hero/big-number-hero/specimen.tsx 23 lines
import React from "react";
import { BigNumberHero, type BigNumberHeroProps } from "../big-number-hero";
export const states = ["default", "hover", "active", "disabled"];
export default function BigNumberHeroSpecimen({ state = "default" }: { state?: BigNumberHeroProps["state"] }) {
return (
<BigNumberHero
number="47"
unit="minutes"
caption="the average time a new client takes to set up in Ledgerline"
compareValue={360}
compareLabel="vs 6 hours by hand"
headline="Your next bookkeeping client is fully set up before lunch"
subhead="Ledgerline pulls bank feeds, the chart of accounts and last year’s files into one guided checklist, so you stop chasing documents and start on the books."
aside="(I know. I used to block out a whole Friday for every new client.)"
actionLabel="Set up my next client"
note="Free 14-day trial · No card needed"
proof="Used by 1,200 small accounting firms"
state={state}
/>
);
}
| Name | Type | Details |
|---|---|---|
number OptionalBigNumberHero |
string |
|
unit OptionalBigNumberHero |
string |
|
caption OptionalBigNumberHero |
string |
|
compareValue OptionalBigNumberHero |
number |
|
compareLabel OptionalBigNumberHero |
string |
|
barLabel OptionalBigNumberHero |
string |
|
headline OptionalBigNumberHero |
React.ReactNode |
|
subhead OptionalBigNumberHero |
React.ReactNode |
|
aside OptionalBigNumberHero |
React.ReactNode |
|
actionLabel OptionalBigNumberHero |
string |
|
href OptionalBigNumberHero |
string |
|
onAction OptionalBigNumberHero |
() => void |
|
note OptionalBigNumberHero |
string |
|
proof OptionalBigNumberHero |
string |
|
disabled OptionalBigNumberHero |
boolean |
|
animate OptionalBigNumberHero |
boolean |
|
showEdge OptionalBigNumberHero |
boolean |
|
edgeTone OptionalBigNumberHero |
EdgeTone |
|
state OptionalBigNumberHero |
"default" | "hover" | "active" | "disabled" |
|
className OptionalBigNumberHero |
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.
This piece reads no image slots.
-
9a2ebdab5ff4fcc4.webp
image/webp · 3.64 KB