Comparison Us Them 1
Us-vs-them comparison that makes the offer the obvious pick: its column rises as the tallest step and ticks every row,
Use it in a prompt
Use content/comparison-us-them 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/comparison-us-them.tsx. - Import it and pass your copy and images (Props tab):
import { ComparisonUsThem } from "@/components/funneldna/content/comparison-us-them"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/comparison-us-them/component.tsx 860 lines
// layout: price-staircase
// Us-vs-them comparison that makes the offer the obvious pick: its column rises as the tallest step and ticks every row,
// then a short letter, a commit tick and the action close the sale under it.
import * as React from 'react';
import { AlertCircle, Check, Lock, Wrench, X } from 'lucide-react';
export type ComparisonUsThemRow = {
/** What the visitor needs (the row header). */
feature: React.ReactNode;
/** One short line under the feature (hidden on phones). */
detail?: React.ReactNode;
/** Product photo for the row (slot item-n). */
image?: string;
imageAlt?: string;
/** Icon shown in the thumbnail spot when the row has no photo. */
icon?: React.ReactNode;
/** The do-it-yourself answer. */
them: React.ReactNode;
/** Your offer's answer. */
us: React.ReactNode;
/** Small line under your answer, e.g. a supplied value. */
usNote?: React.ReactNode;
};
export type ComparisonUsThemProps = {
/** Headline over the feature column. Empty hides it. */
title?: React.ReactNode;
/** Accessible table name, used when no title is shown. */
tableLabel?: string;
/** Header of the feature column (the low step). */
featureLabel?: React.ReactNode;
/** Header of the do-it-yourself column (the middle step). */
themLabel?: React.ReactNode;
/** Offer name in the head of the tallest column. */
usLabel?: React.ReactNode;
/** Short line under the offer name (hidden on phones). */
usTagline?: React.ReactNode;
/** Up to three product photos fanned in the offer column head (slots item-1…3). */
productImages?: string[];
rows?: ComparisonUsThemRow[];
/** Opening line of the letter. */
salutation?: React.ReactNode;
/** Letter paragraphs, one entry per paragraph. */
letter?: React.ReactNode[];
/** Closing line above the signature. */
signOff?: React.ReactNode;
/** Name written in the signature face. Empty hides it. */
signature?: string;
/** Line under the signature, e.g. the writer's role. */
signatureRole?: React.ReactNode;
/** Small line above the price. */
priceLabel?: React.ReactNode;
price?: React.ReactNode;
/** Word after the price, e.g. once. */
priceSuffix?: React.ReactNode;
/** Supplied per-day breakdown shown under the price. */
perDay?: React.ReactNode;
/** Small terms line under the price. */
priceNote?: React.ReactNode;
/** Require the commit tick before the action fires. */
requireCommit?: boolean;
/** Text beside the commit tick box. */
commitLabel?: React.ReactNode;
/** Message shown when the action is pressed before the box is ticked. */
commitError?: React.ReactNode;
/** Start with the commit box ticked. */
defaultCommitted?: boolean;
/** Action button text. */
label?: React.ReactNode;
/** Reassurance line under the action. */
sublabel?: React.ReactNode;
/** Navigation destination; renders the action as a link. */
href?: string;
/** Called on an action click once the commit box is ticked. */
onAction?: () => void;
disabled?: boolean;
/** Preview state: forces the hover, pressed, disabled or missing-tick error look. */
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
/** Root class for page-level placement. */
className?: string;
};
export function ComparisonUsThem(props: ComparisonUsThemProps) {
const {
title = 'Two ways to build your first funnel',
tableLabel = 'DIY from scratch compared with The Funnel Starter Kit',
featureLabel = 'What you need',
themLabel = 'DIY from scratch',
usLabel = 'The Funnel Starter Kit',
usTagline = 'Everything in one download',
productImages = [],
rows = DEFAULT_ROWS,
salutation = 'Dear friend,',
letter = DEFAULT_LETTER,
signOff = 'To your first launch,',
signature = '',
signatureRole,
priceLabel = 'Get the complete kit for',
price = '$47',
priceSuffix = 'once',
perDay = 'That’s about $1.57 a day over a month.',
priceNote = 'One payment · Lifetime access',
requireCommit = true,
commitLabel = 'I understand I’m covered by the 30-day money-back guarantee.',
commitError = 'Tick the box above to continue.',
defaultCommitted = false,
label = 'Send Me The Complete Kit',
sublabel = 'Secure checkout · Instant download',
href,
onAction,
disabled = false,
state = 'default',
className,
} = props;
const uid = React.useId();
const forcedError = state === 'error';
const [committed, setCommitted] = React.useState<boolean>(forcedError ? false : defaultCommitted);
const [showError, setShowError] = React.useState<boolean>(forcedError);
const commitRef = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
if (forcedError) {
setCommitted(false);
setShowError(true);
}
}, [forcedError]);
const isDisabled = disabled || state === 'disabled';
const count = rows.length;
const titleId = `${uid}-title`;
const commitId = `${uid}-commit`;
const errorId = `${uid}-error`;
const hasMedia = rows.some((row) => Boolean(row.image || row.icon));
const hasLetter = Boolean(salutation) || letter.length > 0 || Boolean(signOff) || Boolean(signature);
const rootStyle = {
'--r-foot': String(count + 3),
'--r-foot2': String(count + 4),
'--r-end': String(count + 4),
} as React.CSSProperties;
const handleAction = (event: React.MouseEvent<HTMLElement>) => {
if (isDisabled) {
event.preventDefault();
return;
}
if (requireCommit && !committed) {
event.preventDefault();
setShowError(true);
commitRef.current?.focus();
return;
}
onAction?.();
};
const ctaClass = cx(
'cf-comparison-us-them__cta',
state === 'hover' && 'is-hover',
state === 'active' && 'is-active',
);
const action = href ? (
<a
className={ctaClass}
href={isDisabled ? undefined : href}
role={isDisabled ? 'link' : undefined}
aria-disabled={isDisabled || undefined}
onClick={handleAction}
>
{label}
</a>
) : (
<button type='button' className={ctaClass} disabled={isDisabled} onClick={handleAction}>
{label}
</button>
);
return (
<div className={cx('cf-comparison-us-them', className)} style={rootStyle}>
<style>{CSS}</style>
{signature ? (
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Mrs+Saint+Delafield&display=swap' />
) : null}
<div className='cf-comparison-us-them__tower-bg cf-comparison-us-them__tower' aria-hidden='true' />
<div className='cf-comparison-us-them__body-bg' aria-hidden='true' />
{title ? (
<h3 className='cf-comparison-us-them__title' id={titleId}>
{title}
</h3>
) : null}
<div
className='cf-comparison-us-them__table'
role='table'
aria-labelledby={title ? titleId : undefined}
aria-label={title ? undefined : tableLabel}
>
<div className='cf-comparison-us-them__row cf-comparison-us-them__row--head' role='row'>
<div className='cf-comparison-us-them__step cf-comparison-us-them__step--one' role='columnheader'>
<span>{featureLabel}</span>
</div>
<div className='cf-comparison-us-them__step cf-comparison-us-them__step--two' role='columnheader'>
<Wrench className='cf-comparison-us-them__step-icon' aria-hidden='true' />
<span>{themLabel}</span>
</div>
<div className='cf-comparison-us-them__head cf-comparison-us-them__tower' role='columnheader'>
{productImages.length > 0 ? (
<span className='cf-comparison-us-them__fan' aria-hidden='true'>
{productImages.slice(0, 3).map((src, i) => (
<img key={i} className='cf-comparison-us-them__fan-img' src={src} alt='' width={76} height={76} decoding='async' />
))}
</span>
) : null}
<span className='cf-comparison-us-them__head-name'>{usLabel}</span>
{usTagline ? <span className='cf-comparison-us-them__head-tag'>{usTagline}</span> : null}
</div>
</div>
{rows.map((row, i) => {
const gridRow = i + 3;
const usStyle = { gridRow, '--d': `${300 + i * 70}ms` } as React.CSSProperties;
return (
<div className={cx('cf-comparison-us-them__row', i === count - 1 && 'is-last')} role='row' key={i}>
<div className='cf-comparison-us-them__cell cf-comparison-us-them__cell--feature' role='rowheader' style={{ gridRow }}>
{row.image ? (
<img
className='cf-comparison-us-them__thumb'
src={row.image}
alt={row.imageAlt ?? ''}
width={56}
height={56}
loading='lazy'
decoding='async'
/>
) : hasMedia ? (
<span className='cf-comparison-us-them__thumb cf-comparison-us-them__thumb--icon' aria-hidden='true'>
{row.icon ?? null}
</span>
) : null}
<span className='cf-comparison-us-them__feature-text'>
<span className='cf-comparison-us-them__feature'>{row.feature}</span>
{row.detail ? <span className='cf-comparison-us-them__detail'>{row.detail}</span> : null}
</span>
</div>
<div className='cf-comparison-us-them__cell cf-comparison-us-them__cell--them' role='cell' style={{ gridRow }}>
<span className='cf-comparison-us-them__badge cf-comparison-us-them__badge--no' aria-hidden='true'>
<X />
</span>
<span className='cf-comparison-us-them__them'>{row.them}</span>
</div>
<div className='cf-comparison-us-them__cell cf-comparison-us-them__cell--us cf-comparison-us-them__tower' role='cell' style={usStyle}>
<span className='cf-comparison-us-them__badge cf-comparison-us-them__badge--yes' aria-hidden='true'>
<Check />
</span>
<span className='cf-comparison-us-them__us-text'>
<span className='cf-comparison-us-them__us'>{row.us}</span>
{row.usNote ? <span className='cf-comparison-us-them__us-note'>{row.usNote}</span> : null}
</span>
</div>
</div>
);
})}
</div>
{hasLetter ? (
<div className='cf-comparison-us-them__letter'>
{salutation ? <p className='cf-comparison-us-them__salutation'>{salutation}</p> : null}
{letter.map((paragraph, i) => (
<p className='cf-comparison-us-them__para' key={i}>
{paragraph}
</p>
))}
{signOff || signature || signatureRole ? (
<div className='cf-comparison-us-them__sign'>
{signOff ? <p className='cf-comparison-us-them__signoff'>{signOff}</p> : null}
{signature ? <p className='cf-comparison-us-them__signature'>{signature}</p> : null}
{signatureRole ? <p className='cf-comparison-us-them__role'>{signatureRole}</p> : null}
</div>
) : null}
</div>
) : null}
<div className='cf-comparison-us-them__close cf-comparison-us-them__tower'>
<div className='cf-comparison-us-them__price'>
{priceLabel ? <p className='cf-comparison-us-them__price-label'>{priceLabel}</p> : null}
<p className='cf-comparison-us-them__price-figure'>
<span className='cf-comparison-us-them__amount'>{price}</span>
{priceSuffix ? <span className='cf-comparison-us-them__suffix'>{priceSuffix}</span> : null}
</p>
{perDay ? <p className='cf-comparison-us-them__perday'>{perDay}</p> : null}
{priceNote ? <p className='cf-comparison-us-them__note'>{priceNote}</p> : null}
</div>
{requireCommit ? (
<div className='cf-comparison-us-them__commit-wrap'>
<label
htmlFor={commitId}
className={cx(
'cf-comparison-us-them__commit',
committed && 'is-checked',
showError && 'is-error',
isDisabled && 'is-disabled',
)}
>
<input
ref={commitRef}
id={commitId}
type='checkbox'
className='cf-comparison-us-them__commit-input'
checked={committed}
disabled={isDisabled}
aria-invalid={showError || undefined}
aria-describedby={showError ? errorId : undefined}
onChange={(event) => {
const next = event.target.checked;
setCommitted(next);
if (next) setShowError(false);
}}
/>
<span className='cf-comparison-us-them__box' aria-hidden='true'>
<Check />
</span>
<span className='cf-comparison-us-them__commit-text'>{commitLabel}</span>
</label>
{showError ? (
<p id={errorId} className='cf-comparison-us-them__error' role='alert'>
<AlertCircle aria-hidden='true' />
<span>{commitError}</span>
</p>
) : null}
</div>
) : null}
{action}
{sublabel ? (
<p className='cf-comparison-us-them__sub'>
<Lock aria-hidden='true' />
<span>{sublabel}</span>
</p>
) : null}
</div>
</div>
);
}
export default ComparisonUsThem;
const DEFAULT_ROWS: ComparisonUsThemRow[] = [
{ feature: 'Funnel Planning Guide', detail: 'Map your offer and the pages your funnel needs.', them: 'Create your own plan', us: 'Included', usNote: '$49 value' },
{ feature: 'Page Copy Workbook', detail: 'Draft your headline, offer, and call to action.', them: 'Start from a blank page', us: 'Included', usNote: '$29 value' },
{ feature: 'Launch Checklist', detail: 'Review the links, forms, and next steps before launch.', them: 'Build your own list', us: 'Included', usNote: '$19 value' },
{ feature: 'One complete download', detail: 'Guide, workbook, and checklist together.', them: 'Assemble it yourself', us: 'Ready to use' },
];
const DEFAULT_LETTER: React.ReactNode[] = [
'You could build every piece of this yourself, one blank page at a time.',
'Or you could start with the plan, the page copy and the launch check already laid out, in the order you’ll use them.',
'That’s the whole difference in this table. Tick the box, grab the kit, and start building today.',
];
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ');
}
const CSS = `
.cf-comparison-us-them {
--cmp-radius: var(--card-radius, var(--radius, 12px));
--cmp-ink: var(--ink, oklch(0.21 0.034 263));
--cmp-card: var(--card, oklch(1 0 0));
--cmp-line: var(--card-border, color-mix(in oklch, var(--cmp-ink) 12%, transparent));
--cmp-us: var(--accent, oklch(0.5 0.17 257));
--cmp-us-fill: var(--accent-fill, var(--cmp-us));
--cmp-us-bg: color-mix(in oklch, var(--cmp-us-fill) 8%, var(--cmp-card));
--cmp-us-hover: color-mix(in oklch, var(--cmp-us-fill) 7%, transparent);
--cmp-us-line: color-mix(in oklch, var(--cmp-us-fill) 24%, transparent);
--cmp-quiet: color-mix(in oklch, var(--cmp-ink) 3%, var(--cmp-card));
--cmp-quiet-2: color-mix(in oklch, var(--cmp-ink) 6%, var(--cmp-card));
--cmp-shade: var(--shadow, oklch(0.22 0.03 256));
--cmp-sh-sm: var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 256 / 0.18), 0 1px 3px oklch(0.22 0.03 256 / 0.14));
--cmp-sh-md: var(--shadow-md, 0 1px 2px oklch(0.22 0.03 256 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 256 / 0.2));
--cmp-sh-lg: var(--shadow-lg, 0 2px 4px oklch(0.22 0.03 256 / 0.22), 0 12px 24px -8px oklch(0.22 0.03 256 / 0.32));
--cmp-btn: var(--button-bg, var(--cta, oklch(0.58 0.21 29.5)));
--cmp-btn-2: var(--button-bg-2, var(--cta-2, oklch(0.51 0.21 29.5)));
--cmp-focus: var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
/* integral signature face (documented exception, loaded from Google Fonts): a theme replaces it through --signature-face */
--signature-font: var(--signature-face, 'Mrs Saint Delafield', var(--font-display, cursive));
/* solid status badges: fill held dark enough (L <= 0.55) that the white glyph reads on every theme */
--cmp-yes: oklch(from var(--success, oklch(0.5 0.138 150)) min(l, 0.55) c h);
--cmp-no: oklch(from var(--danger, oklch(0.5 0.17 27)) min(l, 0.55) c h);
/* white glyph on the solid status badge (documented exception, contract: status icon badges) */
--cmp-glyph: var(--badge-glyph, #fff);
display: grid;
grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr) minmax(0, 1.12fr);
width: 100%;
max-width: 1120px;
margin-inline: auto;
font-family: var(--font-body, system-ui, sans-serif);
color: var(--cmp-ink);
-webkit-font-smoothing: antialiased;
}
.cf-comparison-us-them *, .cf-comparison-us-them *::before, .cf-comparison-us-them *::after { box-sizing: border-box; }
.cf-comparison-us-them :where(p, h3) { margin: 0; }
.cf-comparison-us-them img { display: block; max-width: 100%; }
.cf-comparison-us-them__table, .cf-comparison-us-them__row { display: contents; }
/* the raised offer column: one surface from head to action */
.cf-comparison-us-them__tower-bg {
grid-column: 3;
grid-row: 1 / var(--r-end);
position: relative;
z-index: 0;
background: var(--cmp-us-bg);
border: 2px solid var(--cmp-us-fill);
border-radius: calc(var(--cmp-radius) + 4px);
box-shadow: var(--card-shadow, var(--cmp-sh-lg));
}
.cf-comparison-us-them__body-bg {
grid-column: 1 / 3;
grid-row: 3 / var(--r-foot);
position: relative;
z-index: 0;
background: var(--cmp-card);
border: 1px solid var(--cmp-line);
border-right: 0;
border-radius: 0 0 0 var(--cmp-radius);
}
.cf-comparison-us-them__title {
grid-column: 1;
grid-row: 1;
align-self: end;
position: relative;
z-index: 1;
padding: 0 28px 22px 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.02em);
font-size: clamp(1.6rem, 2.3vw, 2.125rem);
line-height: 1.08;
text-wrap: balance;
color: var(--cmp-ink);
}
/* the staircase: low step, mid step, then the offer tower */
.cf-comparison-us-them__step {
grid-row: 2;
align-self: end;
position: relative;
z-index: 1;
display: flex;
align-items: center;
gap: 10px;
padding: 14px 20px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.0625rem;
line-height: 1.2;
text-wrap: balance;
border: 1px solid var(--cmp-line);
border-bottom: 0;
border-right: 0;
}
.cf-comparison-us-them__step--one {
grid-column: 1;
min-height: 64px;
background: var(--cmp-quiet-2);
color: var(--cmp-ink);
border-top-left-radius: var(--cmp-radius);
}
.cf-comparison-us-them__step--two {
grid-column: 2;
min-height: 108px;
flex-direction: column;
justify-content: flex-end;
text-align: center;
padding-bottom: 18px;
background: var(--secondary, oklch(0.93 0.015 263));
color: var(--secondary-ink, var(--cmp-ink));
border-top-left-radius: var(--cmp-radius);
}
.cf-comparison-us-them__step-icon { width: 22px; height: 22px; stroke-width: 2.25; }
.cf-comparison-us-them__head {
grid-column: 3;
grid-row: 1 / 3;
position: relative;
z-index: 1;
margin: 2px 2px 0;
min-height: 176px;
padding: 24px 20px 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 10px;
text-align: center;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, oklch(1 0 0));
border-radius: calc(var(--cmp-radius) + 2px) calc(var(--cmp-radius) + 2px) 0 0;
}
.cf-comparison-us-them__fan { display: flex; justify-content: center; padding: 4px 0 6px; }
.cf-comparison-us-them__fan-img {
width: 76px;
height: 76px;
object-fit: cover;
border-radius: 10px;
filter: drop-shadow(0 2px 2px oklch(from var(--cmp-shade) l c h / 0.45)) drop-shadow(0 6px 8px oklch(from var(--cmp-shade) l c h / 0.3));
}
.cf-comparison-us-them__fan-img + .cf-comparison-us-them__fan-img { margin-left: -18px; }
.cf-comparison-us-them__fan-img:nth-child(1) { transform: rotate(-8deg) translateY(5px); }
.cf-comparison-us-them__fan-img:nth-child(2) { position: relative; z-index: 1; transform: translateY(-3px); }
.cf-comparison-us-them__fan-img:nth-child(3) { transform: rotate(8deg) translateY(5px); }
.cf-comparison-us-them__head-name {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
font-size: clamp(1.25rem, 1.9vw, 1.6rem);
line-height: 1.1;
letter-spacing: -0.01em;
text-wrap: balance;
}
.cf-comparison-us-them__head-tag {
font-size: 0.9375rem;
font-weight: 600;
color: color-mix(in oklch, var(--band-ink, oklch(1 0 0)) 84%, var(--band, oklch(0.27 0.067 256)));
}
/* rows */
.cf-comparison-us-them__cell {
position: relative;
z-index: 1;
display: flex;
align-items: flex-start;
gap: 14px;
padding: 18px 20px;
transition: background-color 0.18s ease;
}
.cf-comparison-us-them__cell--feature { grid-column: 1; margin-left: 1px; border-bottom: 1px solid var(--cmp-line); }
.cf-comparison-us-them__cell--them {
grid-column: 2;
align-items: center;
background: var(--cmp-quiet);
border-left: 1px solid var(--cmp-line);
border-bottom: 1px solid var(--cmp-line);
}
.cf-comparison-us-them__cell--us { grid-column: 3; align-items: center; margin-inline: 2px; border-bottom: 1px solid var(--cmp-us-line); }
.cf-comparison-us-them__row.is-last > .cf-comparison-us-them__cell { border-bottom-color: transparent; }
.cf-comparison-us-them__row.is-last > .cf-comparison-us-them__cell--feature,
.cf-comparison-us-them__row.is-last > .cf-comparison-us-them__cell--them { margin-bottom: 1px; }
@media (hover: hover) {
.cf-comparison-us-them__row:hover > .cf-comparison-us-them__cell--feature { background: var(--cmp-quiet); }
.cf-comparison-us-them__row:hover > .cf-comparison-us-them__cell--them { background: var(--cmp-quiet-2); }
.cf-comparison-us-them__row:hover > .cf-comparison-us-them__cell--us { background: var(--cmp-us-hover); }
.cf-comparison-us-them__row:hover .cf-comparison-us-them__badge--yes { transform: scale(1.12); }
}
.cf-comparison-us-them__thumb {
flex: none;
width: 56px;
height: 56px;
border-radius: 10px;
object-fit: cover;
filter: drop-shadow(0 1px 2px oklch(from var(--cmp-shade) l c h / 0.3)) drop-shadow(0 4px 6px oklch(from var(--cmp-shade) l c h / 0.16));
}
.cf-comparison-us-them__thumb--icon { display: grid; place-items: center; color: var(--cmp-us); filter: none; }
.cf-comparison-us-them__thumb--icon svg { width: 30px; height: 30px; stroke-width: 2; }
.cf-comparison-us-them__feature-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cf-comparison-us-them__feature { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--cmp-ink); text-wrap: balance; }
.cf-comparison-us-them__detail { font-size: 0.9375rem; line-height: 1.45; color: var(--muted, oklch(0.45 0.03 258)); text-wrap: pretty; }
.cf-comparison-us-them__them { font-size: 1rem; line-height: 1.35; color: var(--cmp-ink); text-wrap: pretty; }
.cf-comparison-us-them__us-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-comparison-us-them__us { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--cmp-ink); }
.cf-comparison-us-them__us-note { font-size: 0.875rem; font-weight: 600; color: var(--muted, oklch(0.45 0.03 258)); font-variant-numeric: tabular-nums; }
/* solid tick / cross badges: status fill, white glyph, a small bevel and a close dark shadow */
.cf-comparison-us-them__badge {
flex: none;
display: grid;
place-items: center;
width: 30px;
height: 30px;
border-radius: 50%;
color: var(--cmp-glyph);
transition: transform 0.18s ease;
}
.cf-comparison-us-them__badge svg { width: 18px; height: 18px; stroke-width: 3; }
.cf-comparison-us-them__badge--no {
background: var(--cmp-no);
box-shadow: inset 0 1px 0 oklch(from var(--cmp-no) calc(l + 0.1) c h / 0.55), inset 0 -2px 0 oklch(from var(--cmp-no) calc(l - 0.1) c h), var(--cmp-sh-sm);
}
.cf-comparison-us-them__badge--yes {
background: var(--cmp-yes);
box-shadow: inset 0 1px 0 oklch(from var(--cmp-yes) calc(l + 0.1) c h / 0.55), inset 0 -2px 0 oklch(from var(--cmp-yes) calc(l - 0.1) c h), var(--cmp-sh-sm);
}
/* the letter, signed off before the action */
.cf-comparison-us-them__letter {
grid-column: 1 / 3;
grid-row: var(--r-foot);
position: relative;
z-index: 1;
padding: 40px 48px 8px 4px;
}
.cf-comparison-us-them__letter > * { max-width: 58ch; }
.cf-comparison-us-them__salutation {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1.375rem;
line-height: 1.2;
color: var(--cmp-ink);
}
.cf-comparison-us-them__para { margin-top: 12px; font-size: 1.125rem; line-height: 1.6; color: var(--cmp-ink); text-wrap: pretty; }
.cf-comparison-us-them__sign { margin-top: 22px; }
.cf-comparison-us-them__signoff { font-size: 1.0625rem; font-style: italic; color: var(--cmp-ink); }
.cf-comparison-us-them__signature {
margin-top: 2px;
font-family: var(--signature-font);
font-weight: 400;
font-size: 3rem;
line-height: 1.1;
color: var(--signature-ink, var(--cmp-ink));
}
.cf-comparison-us-them__role { margin-top: 2px; font-size: 0.9375rem; color: var(--muted, oklch(0.45 0.03 258)); }
/* the close under the offer column */
.cf-comparison-us-them__close {
grid-column: 3;
grid-row: var(--r-foot);
position: relative;
z-index: 1;
margin: 0 2px 2px;
padding: 30px 24px;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 18px;
text-align: center;
}
.cf-comparison-us-them__price-label { font-size: 1rem; font-weight: 700; color: var(--cmp-ink); }
.cf-comparison-us-them__price-figure { margin-top: 6px; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.cf-comparison-us-them__amount {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: clamp(3rem, 4.4vw, 3.75rem);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;
color: var(--cmp-ink);
}
.cf-comparison-us-them__suffix { font-size: 1.0625rem; font-weight: 700; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-comparison-us-them__perday { margin-top: 12px; font-size: 1rem; font-weight: 600; line-height: 1.4; color: var(--cmp-ink); text-wrap: pretty; }
.cf-comparison-us-them__note { margin-top: 4px; font-size: 0.9375rem; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-comparison-us-them__commit {
position: relative;
display: flex;
align-items: flex-start;
gap: 12px;
padding: 14px 16px;
text-align: left;
background: var(--field, oklch(1 0 0));
color: var(--field-ink, var(--cmp-ink));
border: 1.5px solid var(--field-border, color-mix(in oklch, var(--cmp-ink) 22%, transparent));
border-radius: var(--field-radius, var(--radius, 10px));
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
cursor: pointer;
transition: border-color 0.15s ease;
}
.cf-comparison-us-them__commit:hover { border-color: color-mix(in oklch, var(--field-ink, var(--cmp-ink)) 45%, var(--field, oklch(1 0 0))); }
.cf-comparison-us-them__commit.is-checked { border-color: var(--success, oklch(0.5 0.138 150)); }
.cf-comparison-us-them__commit.is-error { border-color: var(--danger, oklch(0.5 0.17 27)); }
.cf-comparison-us-them__commit.is-disabled { cursor: not-allowed; }
.cf-comparison-us-them__commit-text { text-wrap: pretty; }
/* the native checkbox covers the label as the hit area; the drawn box carries the look, the field roles still drive it */
.cf-comparison-us-them__commit-input {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
margin: 0;
opacity: 0;
cursor: pointer;
background: var(--field, oklch(1 0 0));
color: var(--field-ink, var(--cmp-ink));
border-radius: var(--field-radius, var(--radius, 10px));
accent-color: var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
}
.cf-comparison-us-them__commit-input:disabled { cursor: not-allowed; }
.cf-comparison-us-them__box {
flex: none;
display: grid;
place-items: center;
width: 24px;
height: 24px;
border-radius: 6px;
background: var(--field, oklch(1 0 0));
border: 2px solid color-mix(in oklch, var(--field-ink, var(--cmp-ink)) 45%, var(--field, oklch(1 0 0)));
color: transparent;
transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.cf-comparison-us-them__box svg { width: 16px; height: 16px; stroke-width: 3.5; }
.cf-comparison-us-them__commit-input:checked + .cf-comparison-us-them__box {
background: var(--success, oklch(0.5 0.138 150));
border-color: var(--success, oklch(0.5 0.138 150));
color: var(--cmp-card);
}
.cf-comparison-us-them__commit.is-error .cf-comparison-us-them__box { border-color: var(--danger, oklch(0.5 0.17 27)); }
.cf-comparison-us-them__commit-input:focus-visible + .cf-comparison-us-them__box { outline: 3px solid var(--cmp-focus); outline-offset: 2px; }
.cf-comparison-us-them__commit-input:active:not(:disabled) + .cf-comparison-us-them__box { transform: scale(0.9); }
.cf-comparison-us-them__error {
margin-top: 8px;
display: flex;
align-items: flex-start;
gap: 8px;
padding: 10px 12px;
text-align: left;
border-radius: var(--radius, 10px);
background: var(--danger-soft, oklch(0.93 0.024 27));
color: var(--danger, oklch(0.5 0.17 27));
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
}
.cf-comparison-us-them__error svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.cf-comparison-us-them__cta {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 64px;
padding: 14px 20px;
border: 0;
border-radius: var(--button-radius, var(--radius, 10px));
background-color: var(--cmp-btn);
background-image: linear-gradient(oklch(from var(--cmp-btn) calc(l + 0.04) c h), var(--cmp-btn-2));
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
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.5vw, 1.3rem);
line-height: 1.15;
text-align: center;
text-decoration: none;
text-wrap: balance;
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cmp-btn) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--cmp-btn) calc(l - 0.16) c h), var(--cmp-sh-md));
transition: transform 0.14s ease, box-shadow 0.14s ease;
-webkit-tap-highlight-color: transparent;
}
.cf-comparison-us-them__cta:where(:hover, .is-hover):not(:disabled):not([aria-disabled='true']) {
transform: translateY(-2px);
background-image: linear-gradient(oklch(from var(--cmp-btn) calc(l + 0.01) c h), oklch(from var(--cmp-btn-2) calc(l - 0.03) c h));
box-shadow: inset 0 1px 0 oklch(from var(--cmp-btn) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--cmp-btn) calc(l - 0.18) c h), var(--cmp-sh-lg);
}
.cf-comparison-us-them__cta:where(:active, .is-active):not(:disabled):not([aria-disabled='true']) {
transform: translateY(1px);
background-image: linear-gradient(oklch(from var(--cmp-btn) calc(l - 0.06) c h), oklch(from var(--cmp-btn-2) calc(l - 0.06) c h));
box-shadow: inset 0 2px 3px oklch(from var(--cmp-btn) calc(l - 0.2) c h / 0.5), inset 0 -1px 0 oklch(from var(--cmp-btn) calc(l - 0.16) c h), var(--cmp-sh-sm);
}
.cf-comparison-us-them__cta:focus-visible { outline: 3px solid var(--cmp-focus); outline-offset: 3px; }
.cf-comparison-us-them__cta:disabled,
.cf-comparison-us-them__cta[aria-disabled='true'] {
background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
background-image: none;
color: var(--button-2-ink, var(--secondary-ink, var(--cmp-ink)));
text-shadow: none;
box-shadow: none;
transform: none;
cursor: not-allowed;
}
/* centred reassurance line: the lock sits inline, centred on the first line box, and the words form one inline
block beside it (capped to the room left by the lock), so on a wrap the lock stays next to the first word */
.cf-comparison-us-them__sub {
margin-top: -6px;
text-align: center;
font-size: 0.9375rem;
font-weight: 600;
color: var(--muted, oklch(0.45 0.03 258));
text-wrap: pretty;
}
.cf-comparison-us-them__sub svg {
display: inline-block;
vertical-align: top;
margin-top: calc((1lh - 15px) / 2);
margin-inline-end: 6px;
width: 15px;
height: 15px;
stroke-width: 2.4;
}
.cf-comparison-us-them__sub > span {
display: inline-block;
vertical-align: top;
max-width: calc(100% - 21px);
}
/* motion: the staircase builds left to right, ticks land in order */
@media (prefers-reduced-motion: no-preference) {
.cf-comparison-us-them__step, .cf-comparison-us-them__tower { animation: cf-comparison-us-them-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.cf-comparison-us-them__step--two { animation-delay: 0.08s; }
.cf-comparison-us-them__tower { animation-delay: 0.16s; }
.cf-comparison-us-them__badge--yes { animation: cf-comparison-us-them-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; animation-delay: var(--d, 0.3s); }
.cf-comparison-us-them__error { animation: cf-comparison-us-them-nudge 0.32s ease; }
}
@media (prefers-reduced-motion: reduce) {
.cf-comparison-us-them *, .cf-comparison-us-them *::before, .cf-comparison-us-them *::after { transition: none; }
}
@keyframes cf-comparison-us-them-rise { from { transform: translateY(14px); opacity: 0.85; } to { transform: none; opacity: 1; } }
@keyframes cf-comparison-us-them-pop { from { transform: scale(0.6); } to { transform: scale(1); } }
@keyframes cf-comparison-us-them-nudge { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 65% { transform: translateX(3px); } }
@media (max-width: 980px) {
.cf-comparison-us-them__cell { padding: 16px 14px; }
.cf-comparison-us-them__thumb { width: 46px; height: 46px; }
.cf-comparison-us-them__letter { padding-right: 28px; }
.cf-comparison-us-them__close { padding: 26px 18px; }
}
@media (max-width: 720px) {
.cf-comparison-us-them { grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.96fr) minmax(0, 1.1fr); }
.cf-comparison-us-them__title { grid-column: 1 / -1; grid-row: 1; padding: 0 0 18px; font-size: 1.625rem; }
.cf-comparison-us-them__tower-bg { grid-row: 2 / var(--r-foot); }
.cf-comparison-us-them__head { grid-row: 2; min-height: 150px; padding: 16px 8px 14px; gap: 8px; }
.cf-comparison-us-them__head-name { font-size: 1rem; }
.cf-comparison-us-them__head-tag { display: none; }
.cf-comparison-us-them__fan-img { width: 40px; height: 40px; border-radius: 7px; }
.cf-comparison-us-them__fan-img + .cf-comparison-us-them__fan-img { margin-left: -12px; }
.cf-comparison-us-them__step { padding: 10px; font-size: 0.875rem; }
.cf-comparison-us-them__step--one { min-height: 52px; }
.cf-comparison-us-them__step--two { min-height: 84px; padding-bottom: 12px; }
.cf-comparison-us-them__step-icon { display: none; }
.cf-comparison-us-them__cell { flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 10px; }
.cf-comparison-us-them__thumb, .cf-comparison-us-them__detail { display: none; }
.cf-comparison-us-them__feature { font-size: 0.9375rem; }
.cf-comparison-us-them__them { font-size: 0.875rem; }
.cf-comparison-us-them__us { font-size: 0.9375rem; }
.cf-comparison-us-them__us-note { font-size: 0.875rem; }
.cf-comparison-us-them__badge { width: 24px; height: 24px; }
.cf-comparison-us-them__badge svg { width: 14px; height: 14px; }
.cf-comparison-us-them__letter { grid-column: 1 / -1; padding: 28px 2px 0; }
.cf-comparison-us-them__para { font-size: 1.0625rem; }
.cf-comparison-us-them__signature { font-size: 2.6rem; }
.cf-comparison-us-them__close {
grid-column: 1 / -1;
grid-row: var(--r-foot2);
margin: 24px 0 0;
padding: 24px 18px;
background: var(--cmp-us-bg);
border: 2px solid var(--cmp-us-fill);
border-radius: calc(var(--cmp-radius) + 4px);
box-shadow: var(--card-shadow, var(--cmp-sh-md));
}
}
`;
pieces/content/comparison-us-them/specimen.tsx 63 lines
// Specimen: the us-vs-them staircase for the sample kit, rows built from its three items plus the one-download row.
import * as React from 'react';
import { Download } from 'lucide-react';
import { ComparisonUsThem, type ComparisonUsThemRow } from '../comparison-us-them';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
const sample = defaults.sample;
const DIY_ANSWERS = ['Create your own plan', 'Start from a blank page', 'Build your own list'];
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error';
export default function ComparisonUsThemSpecimen({ state = 'default' }: { state?: SpecimenState }) {
const itemImages = sample.items.map((item, i) => slot(`item-${i + 1}`, item.image));
const rows: ComparisonUsThemRow[] = [
...sample.items.map((item, i) => ({
feature: item.name,
detail: item.detail,
image: itemImages[i],
imageAlt: item.imageAlt,
them: DIY_ANSWERS[i] ?? 'Piece it together yourself',
us: 'Included',
usNote: `${item.value} value`,
})),
{
feature: 'One complete download',
detail: 'Guide, workbook, and checklist together.',
icon: <Download aria-hidden='true' />,
them: 'Assemble it yourself',
us: 'Ready to use',
},
];
return (
<ComparisonUsThem
state={state}
usLabel={sample.name}
productImages={itemImages}
rows={rows}
salutation='Dear friend,'
letter={[
'You could build every piece of this yourself, one blank page at a time.',
'Or you could start with the plan, the page copy and the launch check already laid out, in the order you’ll use them.',
'That’s the whole difference in this table. Tick the box, grab the kit, and start building today.',
]}
signOff='To your first launch,'
signature='Sam Carter'
signatureRole={`Creator of ${sample.name}`}
priceLabel={sample.todayLabel}
price={sample.price}
priceSuffix='once'
perDay='That’s about $1.57 a day over a month.'
priceNote={sample.note}
commitLabel={`I understand I’m covered by the ${sample.guarantee}.`}
label='Send Me The Complete Kit'
sublabel={sample.sublabel}
/>
);
}
| Name | Type | Details |
|---|---|---|
title OptionalComparisonUsThem |
React.ReactNode |
|
tableLabel OptionalComparisonUsThem |
string |
|
featureLabel OptionalComparisonUsThem |
React.ReactNode |
|
themLabel OptionalComparisonUsThem |
React.ReactNode |
|
usLabel OptionalComparisonUsThem |
React.ReactNode |
|
usTagline OptionalComparisonUsThem |
React.ReactNode |
|
productImages OptionalComparisonUsThem |
string[] |
|
rows OptionalComparisonUsThem |
ComparisonUsThemRow[] |
|
salutation OptionalComparisonUsThem |
React.ReactNode |
|
letter OptionalComparisonUsThem |
React.ReactNode[] |
|
signOff OptionalComparisonUsThem |
React.ReactNode |
|
signature OptionalComparisonUsThem |
string |
|
signatureRole OptionalComparisonUsThem |
React.ReactNode |
|
priceLabel OptionalComparisonUsThem |
React.ReactNode |
|
price OptionalComparisonUsThem |
React.ReactNode |
|
priceSuffix OptionalComparisonUsThem |
React.ReactNode |
|
perDay OptionalComparisonUsThem |
React.ReactNode |
|
priceNote OptionalComparisonUsThem |
React.ReactNode |
|
requireCommit OptionalComparisonUsThem |
boolean |
|
commitLabel OptionalComparisonUsThem |
React.ReactNode |
|
commitError OptionalComparisonUsThem |
React.ReactNode |
|
defaultCommitted OptionalComparisonUsThem |
boolean |
|
label OptionalComparisonUsThem |
React.ReactNode |
|
sublabel OptionalComparisonUsThem |
React.ReactNode |
|
href OptionalComparisonUsThem |
string |
|
onAction OptionalComparisonUsThem |
() => void |
|
disabled OptionalComparisonUsThem |
boolean |
|
state OptionalComparisonUsThem |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalComparisonUsThem |
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- 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--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB