Case Study Cards 1
Mini case studies set as a magazine spread: one featured before → action → after story and two shorter ones,
Use it in a prompt
Use proof/case-study-cards 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/case-study-cards.tsx. - Import it and pass your copy and images (Props tab):
import { CaseStudyCards } from "@/components/funneldna/proof/case-study-cards"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/proof/case-study-cards/component.tsx 623 lines
// layout: magazine-spread
// Mini case studies set as a magazine spread: one featured before → action → after story and two shorter ones,
// each landing on a big result number, then an Add To Cart close so the proof turns straight into the sale.
import React from 'react';
import { Loader2, ShieldCheck, ShoppingCart } from 'lucide-react';
export type CaseStudy = {
name: string; // shown as the customer agreed, e.g. Maya R.
role?: string; // who and where, e.g. Yoga studio owner, Portland
image?: string; // customer photo src (slot customer-n)
imageAlt?: string; // photo alt; falls back to copy.photoAlt
before: React.ReactNode; // the situation before
did: React.ReactNode; // what they did
result: string; // the result as a short figure: 38, 3×, $4,200
resultLabel: React.ReactNode; // what the figure counts
href?: string; // full story page
};
export type CaseStudyCardsCopy = {
beforeLabel: string; // lead-in before the situation, e.g. Before:
didLabel: string; // lead-in before the action, e.g. What they did:
readLabel: string; // visible text of each story link
readAriaLabel: string; // accessible name of each story link; placeholders {label} and {name}
photoAlt: string; // fallback image alt; placeholder {name}
busyLabel: string; // button text while busy
};
export type CaseStudyCardsProps = {
headline?: React.ReactNode;
headlineHighlight?: React.ReactNode; // phrase after the headline, set on one marker stroke
lead?: React.ReactNode; // intro paragraph, opens with a drop cap
stories?: CaseStudy[]; // proof: empty by default; the block renders nothing without stories
closeLine?: React.ReactNode; // line above the close button
ctaLabel?: string; // an empty string hides the close
price?: string; // supplied price, shown on the button
reassurance?: React.ReactNode; // supplied guarantee or access line under the button
href?: string; // checkout destination; the button renders as a link when set and enabled
onAction?: (event: React.MouseEvent<HTMLElement>) => void; // button click; not called while disabled or busy
onReadStory?: (index: number, story: CaseStudy) => void; // story link click (renders a button when a story has no href)
tone?: 'light' | 'band'; // band sets the block on the dark band colours
state?: 'default' | 'hover' | 'active' | 'disabled'; // forced button state for previews
busy?: boolean; // shows the loader on the button while the builder adds to cart
disabled?: boolean;
copy?: Partial<CaseStudyCardsCopy>; // overrides for labels and accessible text
className?: string;
id?: string; // section id for in-page anchors
};
export function CaseStudyCards(props: CaseStudyCardsProps) {
const {
headline = 'They started exactly where you are.',
headlineHighlight = 'Here’s what one funnel changed.',
lead = 'Every story starts the same way: one owner, one offer and no clear plan. See what they changed, then use the same steps on your own funnel.',
stories = [],
closeLine = 'Your before looks like theirs. Start your after today.',
ctaLabel = 'Add To Cart',
price,
reassurance,
href,
onAction,
onReadStory,
tone = 'light',
state = 'default',
busy = false,
disabled = false,
copy,
className,
id,
} = props;
const c: CaseStudyCardsCopy = { ...DEFAULT_COPY, ...copy };
const uid = React.useId();
const titleId = uid + 'title';
if (stories.length === 0) return null;
const isDisabled = disabled || busy || state === 'disabled';
const handleAction = (event: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
event.preventDefault();
return;
}
onAction?.(event);
};
const buttonBody = (
<>
{busy ? (
<Loader2 className='ccs-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
) : (
<ShoppingCart size={20} strokeWidth={2.5} aria-hidden='true' />
)}
<span className='ccs-btn-label'>{busy ? c.busyLabel : ctaLabel}</span>
{price ? <span className='ccs-price'>{price}</span> : null}
</>
);
return (
<section
id={id}
className={['cf-case-study-cards', className].filter(Boolean).join(' ')}
data-tone={tone}
aria-labelledby={titleId}
>
<style>{CSS}</style>
<div className='ccs-wrap'>
<header className='ccs-head'>
<h2 id={titleId} className='ccs-title'>
{headline}
{headlineHighlight ? (
<>
{' '}
<span className='ccs-mark'>{headlineHighlight}</span>
</>
) : null}
</h2>
{lead ? <p className='ccs-lead'>{lead}</p> : null}
</header>
<div className='ccs-grid'>
{stories.map((story, index) => (
<StoryCard
key={story.name + '-' + index}
story={story}
index={index}
copy={c}
uid={uid}
onReadStory={onReadStory}
/>
))}
</div>
{ctaLabel ? (
<div className='ccs-close'>
{closeLine ? <p className='ccs-close-line'>{closeLine}</p> : null}
{href && !isDisabled ? (
<a className='ccs-btn' data-state={state} href={href} onClick={handleAction}>
{buttonBody}
</a>
) : (
<button
type='button'
className='ccs-btn'
data-state={state}
aria-disabled={isDisabled || undefined}
aria-busy={busy || undefined}
onClick={handleAction}
>
{buttonBody}
</button>
)}
{reassurance ? (
<p className='ccs-note'>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden='true' />
{reassurance}
</p>
) : null}
</div>
) : null}
</div>
</section>
);
}
export default CaseStudyCards;
const DEFAULT_COPY: CaseStudyCardsCopy = {
beforeLabel: 'Before:',
didLabel: 'What they did:',
readLabel: 'Read the story',
readAriaLabel: '{label}: {name}',
photoAlt: 'Photo of {name}',
busyLabel: 'Adding to cart…',
};
type StoryCardProps = {
story: CaseStudy;
index: number; // 0 is the featured story
copy: CaseStudyCardsCopy;
uid: string; // React.useId() prefix for heading ids
onReadStory?: (index: number, story: CaseStudy) => void;
};
function StoryCard({ story, index, copy, uid, onReadStory }: StoryCardProps) {
const featured = index === 0;
const nameId = uid + 'story' + index;
const linkName = fill(copy.readAriaLabel, { label: copy.readLabel, name: story.name });
const read = () => onReadStory?.(index, story);
return (
<article
className={'ccs-card ' + (featured ? 'ccs-card--featured' : 'ccs-card--compact')}
style={{ '--i': index } as React.CSSProperties}
aria-labelledby={nameId}
>
<div className={'ccs-inner' + (story.image ? '' : ' ccs-inner--noimg')}>
{story.image ? (
<figure className='ccs-photo'>
<img
src={story.image}
alt={story.imageAlt ?? fill(copy.photoAlt, { name: story.name })}
loading={featured ? 'eager' : 'lazy'}
decoding='async'
/>
</figure>
) : null}
<div className='ccs-person'>
<h3 id={nameId} className='ccs-name'>{story.name}</h3>
{story.role ? <p className='ccs-role'>{story.role}</p> : null}
</div>
<div className='ccs-story'>
<p className='ccs-line ccs-line--before'>
<strong>{copy.beforeLabel}</strong> {story.before}
</p>
<p className='ccs-line'>
<strong>{copy.didLabel}</strong> {story.did}
</p>
<div className='ccs-result'>
<div className='ccs-result-row'>
<p className='ccs-num'>{story.result}</p>
<p className='ccs-num-label'>{story.resultLabel}</p>
</div>
</div>
{story.href ? (
<a className='ccs-read' href={story.href} aria-label={linkName} onClick={onReadStory ? read : undefined}>
{copy.readLabel}
</a>
) : onReadStory ? (
<button type='button' className='ccs-read' aria-label={linkName} onClick={read}>
{copy.readLabel}
</button>
) : null}
</div>
</div>
</article>
);
}
// Replaces each {key} placeholder in a copy template with its value, as plain text.
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((text, key) => text.split('{' + key + '}').join(vars[key]), template);
}
// Colours are tokens or OKLCH recipes on tokens; hex appears only as the last var() fallback.
// Documented exception: the yellow marker default (#fae37c). The marker is drawn opaque, and its ink is picked from
// the marker's own lightness (near-black on a light marker, near-white on a dark one), so the highlighted phrase stays
// readable under every theme's --marker. Cards read the card role tokens (featured card included); the disabled
// button reads the secondary-button role tokens (bg, ink, border, shadow). The "Read the story" control is a text
// link (it may render as a <button> when only onReadStory is wired): its colour follows --link, and its zero-width
// border reset reads the secondary-button border role so it stays a plain link under every theme.
const CSS = `
.cf-case-study-cards {
--_bg: var(--surface, #ffffff);
--_head: var(--ink, #101828);
--_soft: var(--muted, #475467);
--_shadow: var(--shadow, oklch(0.22 0.03 260));
--_marker: oklch(from var(--marker, #fae37c) l c h / 1);
--_marker-ink: oklch(from var(--_marker) clamp(0.18, (0.62 - l) * 100, 0.97) 0.02 h);
background: var(--_bg);
color: var(--_head);
font-family: var(--font-body, system-ui, sans-serif);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-case-study-cards[data-tone='band'] {
--_bg: var(--band, #1d2939);
--_head: var(--band-ink, #ffffff);
--_soft: var(--band-ink, #ffffff);
}
.cf-case-study-cards, .cf-case-study-cards * { box-sizing: border-box; }
.cf-case-study-cards .ccs-wrap { max-width: 1120px; margin: 0 auto; }
.cf-case-study-cards .ccs-head { display: grid; gap: 16px; }
@media (min-width: 880px) {
.cf-case-study-cards .ccs-head {
grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
column-gap: clamp(32px, 5vw, 72px);
align-items: start;
}
}
.cf-case-study-cards .ccs-title {
margin: 0;
min-width: 0;
font-family: var(--font-display, inherit);
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(--_head);
}
.cf-case-study-cards .ccs-mark {
color: var(--_marker-ink);
background: linear-gradient(transparent 8%, var(--_marker) 8%, var(--_marker) 94%, transparent 94%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 0.1em;
margin: 0 -0.04em;
border-radius: 0.1em 0.3em 0.14em 0.26em;
}
.cf-case-study-cards .ccs-lead {
margin: 0;
min-width: 0;
max-width: 60ch;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--_head);
text-wrap: pretty;
}
.cf-case-study-cards .ccs-grid {
margin-top: clamp(40px, 5vw, 56px);
display: grid;
gap: clamp(20px, 2.5vw, 32px);
}
@media (min-width: 880px) {
.cf-case-study-cards .ccs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.cf-case-study-cards .ccs-card--featured { grid-column: 1 / -1; }
.cf-case-study-cards .ccs-card--compact:last-child:nth-child(even) { grid-column: 1 / -1; }
}
.cf-case-study-cards .ccs-card {
container-type: inline-size;
min-width: 0;
background: var(--card, #ffffff);
color: var(--ink, #101828);
border: 1px solid var(--card-border, oklch(from var(--ink, #101828) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--_shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--_shadow) l c h / 0.2)));
padding: clamp(20px, 3vw, 32px);
animation: ccs-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
animation-delay: min(calc(var(--i, 0) * 0.07s), 0.28s);
}
.cf-case-study-cards .ccs-card--featured {
border-color: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 38%, var(--card, #ffffff));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--_shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--_shadow) l c h / 0.32)));
}
.cf-case-study-cards .ccs-inner {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'photo' 'person' 'story';
gap: 16px 20px;
}
.cf-case-study-cards .ccs-card--compact .ccs-inner {
grid-template-columns: 88px minmax(0, 1fr);
grid-template-areas: 'photo person' 'story story';
}
.cf-case-study-cards .ccs-card--compact .ccs-person { align-self: center; }
.cf-case-study-cards .ccs-photo {
grid-area: photo;
position: relative;
margin: 0;
overflow: hidden;
border-radius: 12px;
background: color-mix(in oklch, var(--ink, #101828) 6%, var(--card, #ffffff));
}
.cf-case-study-cards .ccs-photo img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
object-fit: cover;
object-position: 50% 28%;
}
.cf-case-study-cards .ccs-card--featured .ccs-photo { aspect-ratio: 4 / 3; }
.cf-case-study-cards .ccs-card--compact .ccs-photo { aspect-ratio: 1 / 1; border-radius: 10px; }
@container (min-width: 720px) {
.cf-case-study-cards .ccs-card--featured .ccs-inner {
grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
grid-template-rows: auto 1fr;
grid-template-areas: 'photo person' 'photo story';
column-gap: clamp(24px, 3.5vw, 40px);
}
.cf-case-study-cards .ccs-card--featured .ccs-photo { aspect-ratio: auto; min-height: 380px; }
}
@container (min-width: 480px) {
.cf-case-study-cards .ccs-card--compact .ccs-inner {
grid-template-columns: 152px minmax(0, 1fr);
grid-template-rows: auto 1fr;
grid-template-areas: 'photo person' 'photo story';
}
.cf-case-study-cards .ccs-card--compact .ccs-photo { aspect-ratio: auto; min-height: 220px; border-radius: 12px; }
.cf-case-study-cards .ccs-card--compact .ccs-person { align-self: start; }
}
.cf-case-study-cards .ccs-card .ccs-inner.ccs-inner--noimg {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto;
grid-template-areas: 'person' 'story';
}
.cf-case-study-cards .ccs-person { grid-area: person; min-width: 0; }
.cf-case-study-cards .ccs-name {
margin: 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
color: var(--ink, #101828);
}
.cf-case-study-cards .ccs-role {
margin: 4px 0 0;
font-size: 0.9375rem;
line-height: 1.4;
font-weight: 600;
color: var(--muted, #475467);
text-wrap: pretty;
}
.cf-case-study-cards .ccs-story {
grid-area: story;
min-width: 0;
display: flex;
flex-direction: column;
gap: 12px;
}
.cf-case-study-cards .ccs-line {
margin: 0;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.5;
color: var(--ink, #101828);
text-wrap: pretty;
}
.cf-case-study-cards .ccs-line--before { color: var(--muted, #475467); }
.cf-case-study-cards .ccs-line strong { color: var(--ink, #101828); font-weight: 800; }
.cf-case-study-cards .ccs-result {
container-type: inline-size;
margin-top: 4px;
padding: 16px 20px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff));
}
.cf-case-study-cards .ccs-card--featured .ccs-result {
background: color-mix(in oklch, var(--accent-fill, var(--accent, #2563eb)) 9%, var(--card, #ffffff));
}
.cf-case-study-cards .ccs-num {
margin: 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
letter-spacing: -0.03em;
line-height: 1;
font-variant-numeric: tabular-nums;
white-space: nowrap;
color: var(--accent, #2563eb);
font-size: clamp(2.5rem, 22cqi, 3.75rem);
}
.cf-case-study-cards .ccs-card--featured .ccs-num { font-size: clamp(2.5rem, 24cqi, 4.875rem); }
.cf-case-study-cards .ccs-num-label {
margin: 20px 0 0;
min-width: 0;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.4;
font-weight: 600;
color: var(--ink, #101828);
text-wrap: pretty;
}
@container (min-width: 420px) {
.cf-case-study-cards .ccs-card--featured .ccs-result-row { display: flex; align-items: center; gap: 20px; }
.cf-case-study-cards .ccs-card--featured .ccs-num-label { margin: 0; flex: 1 1 auto; }
}
.cf-case-study-cards .ccs-read {
align-self: flex-start;
display: inline-flex;
align-items: center;
justify-content: flex-start;
text-align: left;
margin-top: 4px;
min-height: 44px;
padding: 0;
border: 0 solid var(--button-2-border, transparent);
background: none;
font: inherit;
font-size: 1.0625rem;
font-weight: 700;
color: var(--link, var(--accent, #2563eb));
text-decoration: underline;
text-decoration-thickness: 1.5px;
text-decoration-color: oklch(from var(--link, var(--accent, #2563eb)) l c h / 0.45);
text-underline-offset: 0.18em;
cursor: pointer;
transition: color 0.16s ease, text-decoration-color 0.16s ease;
}
.cf-case-study-cards .ccs-read:hover {
color: oklch(from var(--link, var(--accent, #2563eb)) calc(l - 0.08) c h);
text-decoration-color: currentColor;
}
.cf-case-study-cards .ccs-read:focus-visible {
outline: 3px solid oklch(from var(--field-focus, var(--accent, #2563eb)) l c h / 0.4);
outline-offset: 2px;
border-radius: 4px;
}
.cf-case-study-cards .ccs-close {
margin-top: clamp(48px, 6vw, 64px);
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.cf-case-study-cards .ccs-close-line {
margin: 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
color: var(--_head);
}
.cf-case-study-cards .ccs-btn {
--_b: var(--button-bg, var(--cta, #d92d20));
--_b2: var(--button-bg-2, var(--cta-2, #b42318));
--_bi: var(--button-ink, var(--cta-ink, #ffffff));
margin-top: 24px;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 12px;
width: min(100%, 26rem);
min-height: 72px;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display, inherit));
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(--_bi);
text-decoration: none;
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(--_shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--_shadow) l c h / 0.45));
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-case-study-cards .ccs-btn svg { flex: 0 0 auto; }
.cf-case-study-cards .ccs-btn-label { text-wrap: balance; }
.cf-case-study-cards .ccs-price {
display: inline-flex;
align-items: center;
min-height: 32px;
padding: 4px 12px;
border-radius: 999px;
background: oklch(from var(--_b2) calc(l - 0.06) c h);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.cf-case-study-cards .ccs-btn:hover:not([aria-disabled='true']),
.cf-case-study-cards .ccs-btn[data-state='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: var(--button-shadow, inset 0 1px 0 oklch(from var(--_b) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--_b) calc(l - 0.18) c h), 0 1px 2px oklch(from var(--_shadow) l c h / 0.32), 0 10px 18px -6px oklch(from var(--_shadow) l c h / 0.52));
}
.cf-case-study-cards .ccs-btn:active:not([aria-disabled='true']),
.cf-case-study-cards .ccs-btn[data-state='active'] {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--_b) calc(l - 0.05) c h), oklch(from var(--_b2) calc(l - 0.08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--_b) calc(l - 0.22) c h / 0.6), inset 0 -2px 0 oklch(from var(--_b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--_shadow) l c h / 0.3);
}
.cf-case-study-cards .ccs-btn:focus-visible {
outline: 3px solid oklch(from var(--_b) l c h / 0.5);
outline-offset: 3px;
}
.cf-case-study-cards .ccs-btn[aria-disabled='true'],
.cf-case-study-cards .ccs-btn[data-state='disabled'] {
--_s: var(--button-2-bg, var(--secondary, #e4e7ec));
cursor: not-allowed;
transform: none;
color: var(--button-2-ink, var(--secondary-ink, #101828));
text-shadow: none;
background: var(--_s);
box-shadow: inset 0 0 0 1px var(--button-2-border, transparent), var(--button-2-shadow, var(--shadow-sm));
}
.cf-case-study-cards .ccs-btn[aria-disabled='true'] .ccs-price,
.cf-case-study-cards .ccs-btn[data-state='disabled'] .ccs-price {
background: oklch(from var(--_s) calc(l - 0.06) c h);
}
.cf-case-study-cards .ccs-spin { animation: ccs-spin 0.8s linear infinite; }
.cf-case-study-cards .ccs-note {
margin: 12px 0 0;
font-size: 0.9375rem;
line-height: 1.4;
font-weight: 600;
color: var(--_soft);
text-wrap: pretty;
}
.cf-case-study-cards .ccs-note svg {
display: inline-block;
vertical-align: -0.15em;
margin-inline-end: 0.4em;
color: var(--success, #067647);
}
.cf-case-study-cards[data-tone='band'] .ccs-note svg { color: currentColor; }
@supports (animation-timeline: view()) {
.cf-case-study-cards .ccs-card {
animation-delay: 0s;
animation-timeline: view();
animation-range: entry 0% entry 35%;
}
}
@keyframes ccs-rise {
from { opacity: 0.82; transform: translateY(8px); }
to { opacity: 1; transform: none; }
}
@keyframes ccs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.cf-case-study-cards .ccs-card,
.cf-case-study-cards .ccs-spin { animation: none; }
.cf-case-study-cards .ccs-btn,
.cf-case-study-cards .ccs-read { transition: none; }
.cf-case-study-cards .ccs-btn[data-state='active'],
.cf-case-study-cards .ccs-btn:active { transform: none; }
}
`;
pieces/proof/case-study-cards/specimen.tsx 59 lines
import __studioImagef3ca3182 from "../assets/888a23cf64b0e50d.webp";
import __studioImage61e0fe36 from "../assets/6ab900244f4d01fe.webp";
import __studioImageff8961a5 from "../assets/b5c4b2543fd91ffd.webp";
import React from 'react';
import { CaseStudyCards } from '../case-study-cards';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled';
export default function CaseStudyCardsSpecimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample;
// Clearly fictional sample stories; slot() is called during render so theme images apply live.
const stories = [
{
name: 'Maya R.',
role: 'Yoga studio owner, Portland',
image: slot('customer-1', __studioImagef3ca3182),
imageAlt: 'Maya in her yoga studio',
before: 'Posted class times on Instagram and hoped people would book.',
did: 'Mapped a free-first-class opt-in with the Funnel Planning Guide, then wrote three follow-up emails.',
result: '38',
resultLabel: 'new trial members in her first month',
},
{
name: 'Theo M.',
role: 'Bookkeeper, Leeds',
image: slot('customer-2', __studioImage61e0fe36),
imageAlt: 'Theo at his home office desk',
before: 'Waited on referrals, about two new clients a quarter.',
did: 'Wrote one page with the Page Copy Workbook and offered a free year-end checklist.',
result: '214',
resultLabel: 'email sign-ups in six weeks',
},
{
name: 'Priya S.',
role: 'Home baker, Denver',
image: slot('customer-3', __studioImageff8961a5),
imageAlt: 'Priya holding a tray of cupcakes in her kitchen',
before: 'Took cake orders by DM and lost track of half of them.',
did: 'Built a simple pre-order funnel and ran every link through the Launch Checklist.',
result: '3×',
resultLabel: 'more weekend pre-orders',
},
];
return (
<CaseStudyCards
stories={stories}
price={sample.price}
reassurance={sample.reassurance[0] + ' · ' + sample.guarantee}
state={state}
onAction={() => {}}
onReadStory={() => {}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCaseStudyCards |
React.ReactNode |
|
headlineHighlight OptionalCaseStudyCards |
React.ReactNode |
|
lead OptionalCaseStudyCards |
React.ReactNode |
|
stories OptionalCaseStudyCards |
CaseStudy[] |
|
closeLine OptionalCaseStudyCards |
React.ReactNode |
|
ctaLabel OptionalCaseStudyCards |
string |
|
price OptionalCaseStudyCards |
string |
|
reassurance OptionalCaseStudyCards |
React.ReactNode |
|
href OptionalCaseStudyCards |
string |
|
onAction OptionalCaseStudyCards |
(event: React.MouseEvent<HTMLElement>) => void |
|
onReadStory OptionalCaseStudyCards |
(index: number, story: CaseStudy) => void |
|
tone OptionalCaseStudyCards |
'light' | 'band' |
|
state OptionalCaseStudyCards |
'default' | 'hover' | 'active' | 'disabled' |
|
busy OptionalCaseStudyCards |
boolean |
|
disabled OptionalCaseStudyCards |
boolean |
|
copy OptionalCaseStudyCards |
Partial<CaseStudyCardsCopy> |
|
className OptionalCaseStudyCards |
string |
|
id OptionalCaseStudyCards |
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-border--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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
customer-1- An image this piece places.
customer-2- An image this piece places.
customer-3- An image this piece places.
-
6ab900244f4d01fe.webp
image/webp · 91.8 KB
-
888a23cf64b0e50d.webp
image/webp · 151 KB
-
b5c4b2543fd91ffd.webp
image/webp · 185 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB