Result Chart Case 1
Result-chart case: one customer result is the headline, proved beside it by a framed figure (a line chart that
Use it in a prompt
Use proof/result-chart-case 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/proof/result-chart-case.tsx. - Import it and pass your copy and images (Props tab):
import { ResultChartCase } from "@/components/funneldna/proof/result-chart-case"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/result-chart-case/component.tsx 588 lines
// layout: ledger-receipt
// Result-chart case: one customer result is the headline, proved beside it by a framed figure (a line chart that
// draws in, a callout on the key point and a before/after ledger whose bold total is the saving), then one action.
import React from "react";
import { BookOpen } from "lucide-react";
import { BackdropVideo, Divider, FX_HOST } from "../fx/fx";
import sweep from "../fx/loops/sweep";
export type ResultChartPoint = {
label: string;
value: number;
/** Short note in the callout strip, e.g. "Rebuild fully live". */
note?: string;
};
const DEFAULT_COPY = {
/** Ledger first row; {label} = the first point's label. */
before: "Before · {label}",
/** Ledger second row; {label} = the last point's label. */
after: "After · {label}",
totalDown: "Saved per result",
totalUp: "Gained per result",
/** {amount} = absolute change, {percent} = change against the first point. */
valueDown: "{amount} less ({percent})",
valueUp: "{amount} more ({percent})",
/** Callout change line; {change} = signed percent, {label} = the first point's label. */
change: "{change} vs {label}",
start: "Starting point",
/** Accessible name of each chart point. */
point: "{label}: {value} {metric}",
/** Accessible summary of the chart. */
summary: "{metric} from {first} in {firstLabel} to {last} in {lastLabel}.",
};
export type ResultChartCaseCopy = typeof DEFAULT_COPY;
export type ResultChartCaseProps = {
/** The result as the headline. Proof: empty by default. */
headline?: React.ReactNode;
/** Two short lines on how the result happened. */
lead?: React.ReactNode;
/** Italic aside in the author's voice. */
aside?: React.ReactNode;
/** Chart data in order. Proof: empty by default; the figure hides with fewer than two points. */
points?: ResultChartPoint[];
/** Index of the point that carries the callout (defaults to the last point). */
highlight?: number;
/** Figure number shown before the caption. */
figureLabel?: string;
caption?: string;
/** What the chart measures, e.g. "Cost per lead". */
metricLabel?: string;
valuePrefix?: string;
valueSuffix?: string;
/** Which direction counts as an improvement. */
better?: "down" | "up";
linkLabel?: string;
/** Destination of the full case study; the link hides without it. */
linkHref?: string;
onLink?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
/** Plain instruction above the button. */
instruction?: string;
actionLabel?: string;
href?: string;
onAction?: () => void;
disabled?: boolean;
/** Background loop (an imported fx loop module); null for a plain band. */
loop?: typeof sweep | null;
copy?: Partial<ResultChartCaseCopy>;
state?: "default" | "hover" | "active" | "disabled";
className?: string;
};
export function ResultChartCase(props: ResultChartCaseProps) {
const {
headline = "",
lead = "",
aside = "",
points = [],
highlight,
figureLabel = "Fig. 1",
caption = "",
metricLabel = "",
valuePrefix = "",
valueSuffix = "",
better = "down",
linkLabel = "Read the full case study",
linkHref,
onLink,
instruction = "Click the button below to see if we can do the same for you.",
actionLabel = "Apply now",
href,
onAction,
disabled = false,
loop = sweep,
copy,
state = "default",
className = "",
} = props;
const c: ResultChartCaseCopy = { ...DEFAULT_COPY, ...copy };
const data = points.filter((p) => Number.isFinite(p.value));
const hasChart = data.length >= 2;
const uid = "rcc" + React.useId().replace(/[^a-zA-Z0-9_-]/g, "");
const figRef = React.useRef<HTMLElement>(null);
const [phase, setPhase] = React.useState<"idle" | "pending" | "drawn">("idle");
React.useEffect(() => {
const el = figRef.current;
if (!el || typeof window === "undefined" || typeof IntersectionObserver === "undefined") return;
if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
setPhase("pending");
const io = new IntersectionObserver(
(entries) => {
if (entries.some((entry) => entry.isIntersecting)) {
setPhase("drawn");
io.disconnect();
}
},
{ threshold: 0.35 },
);
io.observe(el);
return () => io.disconnect();
}, [hasChart]);
if (!headline && !hasChart) return null;
const isDisabled = disabled || state === "disabled";
const fmt = (v: number) => `${valuePrefix}${v.toLocaleString("en-US", { maximumFractionDigits: 2 })}${valueSuffix}`;
const btnClass = ["cf-rcc-btn", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""].filter(Boolean).join(" ");
const headingId = `${uid}-h`;
const highlightIndex = hasChart ? Math.min(Math.max(highlight ?? data.length - 1, 0), data.length - 1) : 0;
let ledger: React.ReactNode = null;
if (hasChart) {
const first = data[0];
const last = data[data.length - 1];
const diff = last.value - first.value;
const fell = diff < 0;
const improved = better === "down" ? diff < 0 : diff > 0;
const percent = first.value !== 0 ? `${Math.round((Math.abs(diff) / Math.abs(first.value)) * 100)}%` : "";
ledger = (
<div className="cf-rcc-ledger">
<div className="cf-rcc-row">
<span className="cf-rcc-rl">{fill(c.before, { label: first.label })}</span>
<span className="cf-rcc-leader" aria-hidden="true" />
<span className="cf-rcc-rv">{fmt(first.value)}</span>
</div>
<div className="cf-rcc-row">
<span className="cf-rcc-rl">{fill(c.after, { label: last.label })}</span>
<span className="cf-rcc-leader" aria-hidden="true" />
<span className="cf-rcc-rv">{fmt(last.value)}</span>
</div>
<div className={improved ? "cf-rcc-total is-good" : "cf-rcc-total"}>
<span>{fell ? c.totalDown : c.totalUp}</span>
<strong>{tidy(fill(fell ? c.valueDown : c.valueUp, { amount: fmt(Math.abs(diff)), percent }))}</strong>
</div>
</div>
);
}
return (
<section
className={`cf-rcc ${className}`.trim()}
style={{ ...FX_HOST }}
aria-labelledby={headline ? headingId : undefined}
>
{loop ? <BackdropVideo video={loop} treatment="scrim-dark" side="left" control="top-right" /> : null}
<Divider shape="angle" tone="surface" height={48} />
<div className={hasChart ? "cf-rcc-in" : "cf-rcc-in is-solo"}>
<div className="cf-rcc-copy">
{headline ? (
<h2 className="cf-rcc-h" id={headingId}>
{headline}
</h2>
) : null}
{lead ? <p className="cf-rcc-lead">{lead}</p> : null}
{aside ? <p className="cf-rcc-aside">{aside}</p> : null}
{linkLabel && linkHref ? (
<a className="cf-rcc-link" href={linkHref} onClick={onLink}>
<BookOpen size={18} strokeWidth={2.5} aria-hidden="true" />
{linkLabel}
</a>
) : null}
{actionLabel ? (
<div className="cf-rcc-act">
{instruction ? <p className="cf-rcc-ins">{instruction}</p> : null}
{href ? (
<a
className={btnClass}
href={isDisabled ? undefined : href}
aria-disabled={isDisabled || undefined}
onClick={(event) => {
if (isDisabled) {
event.preventDefault();
return;
}
onAction?.();
}}
>
{actionLabel}
</a>
) : (
<button type="button" className={btnClass} disabled={isDisabled} onClick={() => onAction?.()}>
{actionLabel}
</button>
)}
</div>
) : null}
</div>
{hasChart ? (
<figure
ref={figRef}
className={`cf-rcc-fig${phase === "pending" ? " is-pending" : phase === "drawn" ? " is-drawn" : ""}`}
>
<figcaption className="cf-rcc-figh">
<span className="cf-rcc-fign">
<strong>{figureLabel}</strong>
{caption ? ` · ${caption}` : null}
</span>
{metricLabel ? (
<span className="cf-rcc-chip">
<span className="cf-rcc-chip-dot" aria-hidden="true" />
{metricLabel}
</span>
) : null}
</figcaption>
<CaseChart
data={data}
highlight={highlightIndex}
forced={state === "hover" ? 0 : null}
fmt={fmt}
metricLabel={metricLabel}
copy={c}
uid={uid}
/>
{ledger}
</figure>
) : null}
</div>
<style>{CSS}</style>
</section>
);
}
export default ResultChartCase;
type CaseChartProps = {
data: ResultChartPoint[];
highlight: number;
forced: number | null;
fmt: (v: number) => string;
metricLabel: string;
copy: ResultChartCaseCopy;
uid: string;
};
function CaseChart({ data, highlight, forced, fmt, metricLabel, copy, uid }: CaseChartProps) {
const plotRef = React.useRef<HTMLDivElement>(null);
const callRef = React.useRef<HTMLDivElement>(null);
const [width, setWidth] = React.useState(560);
const [active, setActive] = React.useState<number | null>(null);
// Measured callout heights, keyed by callout width and point index.
const [heights, setHeights] = React.useState<Record<string, number>>({});
React.useEffect(() => {
const el = plotRef.current;
if (!el) return;
const measure = () => setWidth(Math.max(240, Math.round(el.clientWidth)));
measure();
if (typeof ResizeObserver === "undefined") return;
const ro = new ResizeObserver(measure);
ro.observe(el);
return () => ro.disconnect();
}, []);
const W = width;
const compact = W < 480;
const H = compact ? 280 : 300;
const values = data.map((d) => d.value);
const axis = niceScale(Math.min(0, ...values), Math.max(...values));
const span = axis.max - axis.min || 1;
const padL = Math.max(...axis.ticks.map((t) => fmt(t).length)) * 8.5 + 18;
const padR = 16;
const padB = 40;
const plotW = W - padL - padR;
const n = data.length;
const inset = Math.min(28, plotW / (2 * n));
const step = (plotW - 2 * inset) / (n - 1);
const cw = compact ? 176 : 200;
const heightOf = (i: number) => heights[`${cw}:${i}`] ?? (76 + (data[i].note ? 30 : 0));
const geom = (topPad: number) => {
const plotH = H - topPad - padB;
const yAtPad = (v: number) => topPad + plotH - ((v - axis.min) / span) * plotH;
const ptsPad = data.map((d, i) => [padL + inset + i * step, yAtPad(d.value)] as [number, number]);
return { yAt: yAtPad, pts: ptsPad, baseY: topPad + plotH, samples: curveSamples(ptsPad) };
};
// Reserve headroom so the key callout floats clear of the line instead of covering the data it explains.
let padT = 20;
let g = geom(padT);
while (!placeCallout(g.samples, g.pts[highlight], cw, heightOf(highlight), W, g.baseY, padL - 4).fits && padT < H * 0.4) {
padT += 12;
g = geom(padT);
}
const { yAt, pts, baseY } = g;
const line = smoothPath(pts);
const area = `${line} L${round1(pts[n - 1][0])},${round1(baseY)} L${round1(pts[0][0])},${round1(baseY)} Z`;
const stride = Math.max(1, Math.ceil((Math.max(...data.map((d) => d.label.length)) * 8.5 + 12) / step));
const shown = forced ?? active ?? highlight;
const point = data[shown];
const [cx, cy] = pts[shown];
const ch = heightOf(shown);
const place = placeCallout(g.samples, pts[shown], cw, ch, W, baseY, padL - 4);
const guideTop = place.above ? Math.min(place.top + ch, cy) : cy;
useIsoLayoutEffect(() => {
const el = callRef.current;
if (!el) return;
const h = el.offsetHeight;
const key = `${cw}:${shown}`;
if (h && Math.abs((heights[key] ?? 0) - h) > 1) setHeights((prev) => ({ ...prev, [key]: h }));
});
const first = data[0];
const last = data[n - 1];
const change =
shown === 0 ? copy.start : fill(copy.change, { change: signedPercent(point.value, first.value, fmt), label: first.label });
const summary = tidy(
fill(copy.summary, {
metric: metricLabel,
first: fmt(first.value),
firstLabel: first.label,
last: fmt(last.value),
lastLabel: last.label,
}),
);
const gid = `${uid}-area`;
return (
<div className="cf-rcc-plot" ref={plotRef} style={{ height: H }}>
<svg className="cf-rcc-svg" width={W} height={H} viewBox={`0 0 ${W} ${H}`} role="img" aria-label={summary}>
<defs>
<linearGradient id={gid} x1="0" y1="0" x2="0" y2="1">
<stop offset="0" className="cf-rcc-s" stopOpacity={0.3} />
<stop offset="1" className="cf-rcc-s" stopOpacity={0} />
</linearGradient>
</defs>
{axis.ticks.map((t) => (
<g key={`t${t}`}>
<line
className={t === axis.min ? "cf-rcc-grid is-base" : "cf-rcc-grid"}
x1={round1(padL)}
x2={W - padR}
y1={round1(yAt(t))}
y2={round1(yAt(t))}
/>
<text className="cf-rcc-ax" x={round1(padL - 10)} y={round1(yAt(t))} textAnchor="end" dominantBaseline="middle">
{fmt(t)}
</text>
</g>
))}
{data.map((d, i) =>
(n - 1 - i) % stride === 0 ? (
<text key={`x${i}`} className="cf-rcc-ax" x={round1(pts[i][0])} y={H - 12} textAnchor="middle">
{d.label}
</text>
) : null,
)}
<line className="cf-rcc-guide" x1={round1(cx)} x2={round1(cx)} y1={round1(guideTop)} y2={round1(baseY)} />
<path className="cf-rcc-area" d={area} fill={`url(#${gid})`} />
<path className="cf-rcc-line" d={line} pathLength={1} />
{pts.map(([x, y], i) => (
<circle
key={`d${i}`}
className={["cf-rcc-dot", i === highlight ? "is-hl" : "", i === shown && i !== highlight ? "is-on" : ""]
.filter(Boolean)
.join(" ")}
cx={round1(x)}
cy={round1(y)}
r={i === highlight ? 8 : i === shown ? 7 : 5}
style={{ ["--d" as string]: `${Math.min(i * 0.07, 0.28)}s` } as React.CSSProperties}
/>
))}
</svg>
<div className="cf-rcc-hits">
{pts.map(([x, y], i) => {
const d = data[i];
const name = tidy(fill(copy.point, { label: d.label, value: fmt(d.value), metric: metricLabel })) + (d.note ? `. ${d.note}` : "");
return (
<button
key={`h${i}`}
type="button"
className="cf-rcc-hit"
style={{ left: round1(x - 22), top: round1(y - 22) }}
aria-label={name}
onMouseEnter={() => setActive(i)}
onMouseLeave={() => setActive(null)}
onFocus={() => setActive(i)}
onBlur={() => setActive(null)}
/>
);
})}
</div>
<div
ref={callRef}
className={place.above ? "cf-rcc-call is-above" : "cf-rcc-call is-below"}
style={{ left: round1(place.left), top: round1(place.top), width: cw }}
aria-hidden="true"
>
<div className="cf-rcc-call-b">
<p className="cf-rcc-call-l">{metricLabel ? `${point.label} · ${metricLabel}` : point.label}</p>
<p className="cf-rcc-call-v">
<span className="cf-rcc-call-num">{fmt(point.value)}</span>
<span className="cf-rcc-call-c">{change}</span>
</p>
</div>
{point.note ? <p className="cf-rcc-call-n">{point.note}</p> : null}
</div>
</div>
);
}
function round1(v: number) {
return Math.round(v * 10) / 10;
}
const useIsoLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
/** Points along the drawn curve (same cubic segments as smoothPath), for collision checks. */
function curveSamples(pts: [number, number][]) {
const out: [number, number][] = [pts[0]];
for (let i = 1; i < pts.length; i++) {
const [px, py] = pts[i - 1];
const [x, y] = pts[i];
const mx = (px + x) / 2;
for (let s = 1; s <= 12; s++) {
const t = s / 12;
const u = 1 - t;
out.push([
u * u * u * px + 3 * u * u * t * mx + 3 * u * t * t * mx + t * t * t * x,
u * u * u * py + 3 * u * u * t * py + 3 * u * t * t * y + t * t * t * y,
]);
}
}
return out;
}
/** Places the callout above or below the line so it never covers the curve or its points. */
function placeCallout(
samples: [number, number][],
at: [number, number],
cw: number,
ch: number,
W: number,
baseY: number,
minLeft: number,
) {
const [cx, cy] = at;
const GAP = 14;
const EDGE = 6;
const clampLeft = (l: number) => Math.min(Math.max(l, minLeft), W - cw - 8);
const lefts = [clampLeft(cx - cw / 2), clampLeft(cx - 24), clampLeft(cx - cw + 24)];
for (const left of lefts) {
const ys = samples.filter(([x]) => x >= left - 10 && x <= left + cw + 10).map(([, y]) => y);
const minY = Math.min(cy, ...ys);
const maxY = Math.max(cy, ...ys);
if (minY - GAP - ch >= EDGE) return { left, top: minY - GAP - ch, above: true, fits: true };
if (maxY + GAP + ch <= baseY - EDGE) return { left, top: maxY + GAP, above: false, fits: true };
}
return { left: lefts[0], top: Math.max(EDGE, cy - GAP - ch), above: true, fits: false };
}
function smoothPath(pts: [number, number][]) {
return pts
.map(([x, y], i) => {
if (i === 0) return `M${round1(x)},${round1(y)}`;
const [px, py] = pts[i - 1];
const mx = round1((px + x) / 2);
return `C${mx},${round1(py)} ${mx},${round1(y)} ${round1(x)},${round1(y)}`;
})
.join(" ");
}
function niceScale(lo: number, hi: number) {
const range = (hi - lo) * 1.12 || Math.abs(hi) || 1;
const raw = range / 4;
const mag = Math.pow(10, Math.floor(Math.log10(raw)));
const norm = raw / mag;
const unit = (norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 2.5 ? 2.5 : norm <= 5 ? 5 : 10) * mag;
const min = Math.floor(lo / unit) * unit;
const max = Math.ceil((lo + range) / unit) * unit;
const ticks: number[] = [];
for (let t = min; t <= max + unit / 2 && ticks.length < 9; t += unit) ticks.push(Number(t.toFixed(6)));
return { min, max, ticks };
}
function signedPercent(value: number, base: number, fmt: (v: number) => string) {
const diff = value - base;
const sign = diff < 0 ? "−" : "+";
if (base === 0) return `${sign}${fmt(Math.abs(diff))}`;
return `${sign}${Math.round((Math.abs(diff) / Math.abs(base)) * 100)}%`;
}
function fill(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match: string, key: string) => (key in values ? values[key] : match));
}
function tidy(text: string) {
return text.replace(/\s*\(\)/g, "").replace(/\s+/g, " ").trim();
}
const SHADOW = "var(--shadow, oklch(0.22 0.03 260))";
const CSS = `
.cf-rcc{position:relative;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) 0 calc(clamp(64px,8.5vw,120px) + 48px);overflow:hidden}
.cf-rcc *{box-sizing:border-box}
.cf-rcc-in{position:relative;z-index:1;width:min(1120px,calc(100% - 2 * clamp(16px,5vw,48px)));margin-inline:auto;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-rcc-in.is-solo{grid-template-columns:minmax(0,46rem);justify-content:center}
.cf-rcc-copy{padding-top:clamp(0px,2.4vw,32px);min-width:0}
.cf-rcc-h{margin:0 0 16px;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;text-wrap:balance;color:var(--band-ink)}
.cf-rcc-lead{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty;max-width:60ch}
.cf-rcc-aside{margin:12px 0 0;font-style:italic;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-rcc-link{display:inline-block;margin-top:24px;color:var(--band-ink);font-weight:700;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;text-wrap:pretty;text-decoration:underline;text-decoration-thickness:1px;text-decoration-color:oklch(from var(--band-ink) l c h / .5);text-underline-offset:.22em;border-radius:4px;transition:text-decoration-color .16s ease}
.cf-rcc-link:hover{text-decoration-color:var(--band-ink);text-decoration-thickness:2px}
.cf-rcc-link:focus-visible{outline:3px solid oklch(from var(--band-ink) l c h / .85);outline-offset:4px}
.cf-rcc-link svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-rcc-act{margin-top:32px}
.cf-rcc-ins{margin:0 0 12px;font-weight:600;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-rcc-btn{display:inline-flex;align-items:center;justify-content:center;min-height:64px;min-width:min(100%,260px);padding:0 28px;border:0;cursor:pointer;text-decoration:none;white-space:nowrap;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);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from ${SHADOW} l c h / .35),0 8px 16px -6px oklch(from ${SHADOW} l c h / .5));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-rcc-btn:hover,.cf-rcc-btn.is-hover{transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from ${SHADOW} l c h / .4),0 12px 20px -8px oklch(from ${SHADOW} l c h / .55))}
.cf-rcc-btn:active,.cf-rcc-btn.is-active{transform:translateY(1px);box-shadow:var(--button-shadow,inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h / .45),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from ${SHADOW} l c h / .35))}
.cf-rcc-btn:focus-visible{outline:3px solid oklch(from var(--band-ink) l c h / .85);outline-offset:3px}
.cf-rcc-btn:disabled,.cf-rcc-btn[aria-disabled="true"]{cursor:not-allowed;transform:none;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))}
.cf-rcc-fig{margin:0;min-width:0;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-rcc-figh{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px}
.cf-rcc-fign{font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;text-wrap:pretty}
.cf-rcc-fign strong{color:var(--ink);font-weight:800}
.cf-rcc-chip{display:inline-flex;align-items:center;gap:8px;min-height:30px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:14px;font-weight:800;line-height:1.2;white-space:nowrap}
.cf-rcc-chip-dot{width:10px;height:10px;border-radius:999px;background:var(--accent-fill,var(--accent))}
.cf-rcc-plot{position:relative;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-rcc-svg{display:block;width:100%;height:100%;overflow:visible}
.cf-rcc-ax{font-family:var(--font-body);font-size:14px;font-weight:600;fill:var(--muted);font-variant-numeric:tabular-nums}
.cf-rcc-grid{stroke:oklch(from var(--ink) l c h / .1);stroke-width:1}
.cf-rcc-grid.is-base{stroke:oklch(from var(--ink) l c h / .24)}
.cf-rcc-guide{stroke:oklch(from var(--accent) l c h / .4);stroke-width:1.5;transition:opacity .3s ease .9s}
.cf-rcc-s{stop-color:var(--accent-fill,var(--accent))}
.cf-rcc-line{fill:none;stroke:var(--accent);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 1;stroke-dashoffset:0;transition:stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1)}
.cf-rcc-area{transition:opacity .6s ease .45s}
.cf-rcc-dot{fill:var(--card);stroke:var(--accent);stroke-width:2.5;transform-box:fill-box;transform-origin:center;transition:opacity .3s ease,transform .3s cubic-bezier(.2,.7,.2,1);transition-delay:calc(.6s + var(--d,0s))}
.cf-rcc-dot.is-on{fill:var(--accent)}
.cf-rcc-dot.is-hl{fill:var(--accent-fill,var(--accent));stroke:var(--card);stroke-width:3}
.cf-rcc-fig.is-pending .cf-rcc-line{stroke-dashoffset:1;transition:none}
.cf-rcc-fig.is-pending .cf-rcc-area,.cf-rcc-fig.is-pending .cf-rcc-guide{opacity:0;transition:none}
.cf-rcc-fig.is-pending .cf-rcc-dot{opacity:0;transform:scale(.6);transition:none}
.cf-rcc-hits{position:absolute;inset:0}
.cf-rcc-hit{position:absolute;width:44px;height:44px;margin:0;padding:0;border:0;border-radius:999px;background:transparent;cursor:pointer}
.cf-rcc-hit:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:-6px}
.cf-rcc-call{position:absolute;z-index:2;pointer-events:none;background:var(--band);color:var(--band-ink);border-radius:10px;overflow:hidden;box-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));transition:left .16s ease,top .16s ease}
.cf-rcc-call.is-above{transform-origin:50% 100%}
.cf-rcc-call.is-below{transform-origin:50% 0}
.cf-rcc-fig.is-pending .cf-rcc-call{opacity:0}
.cf-rcc-fig.is-drawn .cf-rcc-call{animation:cf-rcc-pop .3s cubic-bezier(.2,.7,.2,1) .95s both}
@keyframes cf-rcc-pop{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}
.cf-rcc-call-b{padding:10px 14px 12px}
.cf-rcc-call p{margin:0}
.cf-rcc-call .cf-rcc-call-l{font-size:14px;font-weight:700;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cf-rcc-call .cf-rcc-call-v{margin-top:4px;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;font-variant-numeric:tabular-nums}
.cf-rcc-call .cf-rcc-call-num{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}
.cf-rcc-call .cf-rcc-call-c{font-size:15px;font-weight:600;line-height:1.3}
.cf-rcc-call .cf-rcc-call-n{padding:6px 14px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-size:14px;font-weight:800;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cf-rcc-ledger{margin-top:20px;display:grid;gap:4px}
.cf-rcc-row{display:flex;align-items:baseline;gap:12px;padding:8px 4px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4}
.cf-rcc-rl{color:var(--muted);font-weight:600}
.cf-rcc-leader{flex:1;min-width:24px;border-bottom:1px solid oklch(from var(--ink) l c h / .16);transform:translateY(-.3em)}
.cf-rcc-rv{font-family:var(--font-display);font-weight:800;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-rcc-total{margin-top:8px;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--ink)}
.cf-rcc-total.is-good{background:var(--success-soft,color-mix(in oklch,var(--success) 14%,var(--card)));color:var(--success)}
.cf-rcc-total span{font-weight:700;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4}
.cf-rcc-total strong{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;font-variant-numeric:tabular-nums}
@media (max-width:899px){.cf-rcc-in{grid-template-columns:minmax(0,1fr)}.cf-rcc-copy{padding-top:0}}
@media (max-width:560px){.cf-rcc-btn{width:100%}}
@media (prefers-reduced-motion:reduce){
.cf-rcc .cf-rcc-line,.cf-rcc .cf-rcc-area,.cf-rcc .cf-rcc-dot,.cf-rcc .cf-rcc-guide,.cf-rcc .cf-rcc-call,.cf-rcc .cf-rcc-btn,.cf-rcc .cf-rcc-link{transition:none;animation:none}
.cf-rcc .cf-rcc-fig .cf-rcc-call{animation:none;opacity:1;transform:none}
.cf-rcc .cf-rcc-fig.is-pending .cf-rcc-line{stroke-dashoffset:0}
.cf-rcc .cf-rcc-fig.is-pending .cf-rcc-area,.cf-rcc .cf-rcc-fig.is-pending .cf-rcc-dot,.cf-rcc .cf-rcc-fig.is-pending .cf-rcc-guide{opacity:1;transform:none}
.cf-rcc .cf-rcc-btn:hover,.cf-rcc .cf-rcc-btn:active{transform:none}
}
`;
pieces/proof/result-chart-case/specimen.tsx 37 lines
import React from "react";
import { ResultChartCase } from "../result-chart-case";
export const states = ["default", "hover", "active", "disabled"];
type SpecimenState = "default" | "hover" | "active" | "disabled";
export default function ResultChartCaseSpecimen({ state = "default" }: { state?: SpecimenState }) {
return (
<ResultChartCase
state={state}
headline="Brightside Solar cut its cost per lead from $80 to $30"
lead="We rebuilt their application funnel around one qualifying question, then moved the ad budget to the two ads that actually booked calls."
aside="(Honestly? We expected half that drop.)"
figureLabel="Fig. 1"
caption="Brightside Solar cost per lead, Jan–Jun"
metricLabel="Cost per lead"
valuePrefix="$"
better="down"
points={[
{ label: "Jan", value: 80 },
{ label: "Feb", value: 74 },
{ label: "Mar", value: 63 },
{ label: "Apr", value: 49 },
{ label: "May", value: 37 },
{ label: "Jun", value: 30, note: "Rebuild fully live" },
]}
highlight={5}
copy={{ totalDown: "Saved on every lead" }}
linkLabel="Read the full Brightside Solar case study"
linkHref="#brightside-solar-case"
instruction="Click the button below to apply for a free funnel audit."
actionLabel="Apply now"
href="#apply"
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalResultChartCase |
React.ReactNode |
|
lead OptionalResultChartCase |
React.ReactNode |
|
aside OptionalResultChartCase |
React.ReactNode |
|
points OptionalResultChartCase |
ResultChartPoint[] |
|
highlight OptionalResultChartCase |
number |
|
figureLabel OptionalResultChartCase |
string |
|
caption OptionalResultChartCase |
string |
|
metricLabel OptionalResultChartCase |
string |
|
valuePrefix OptionalResultChartCase |
string |
|
valueSuffix OptionalResultChartCase |
string |
|
better OptionalResultChartCase |
"down" | "up" |
|
linkLabel OptionalResultChartCase |
string |
|
linkHref OptionalResultChartCase |
string |
|
onLink OptionalResultChartCase |
(event: React.MouseEvent<HTMLAnchorElement>) => void |
|
instruction OptionalResultChartCase |
string |
|
actionLabel OptionalResultChartCase |
string |
|
href OptionalResultChartCase |
string |
|
onAction OptionalResultChartCase |
() => void |
|
disabled OptionalResultChartCase |
boolean |
|
loop OptionalResultChartCase |
typeof sweep | null |
|
copy OptionalResultChartCase |
Partial<ResultChartCaseCopy> |
|
state OptionalResultChartCase |
"default" | "hover" | "active" | "disabled" |
|
className OptionalResultChartCase |
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-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.
This piece reads no image slots.
- 3f53d2ed889fcb35.mp4 video/mp4 · 188 KB
-
4b8007624c8cad38.webp
image/webp · 12.9 KB
- 77f5156a8b9c01c4.webm video/webm · 113 KB