Feature Matrix 1
Compares what each plan includes so the buyer can pick the right plan and act.
Use it in a prompt
Use content/feature-matrix 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/feature-matrix.tsx. - Import it and pass your copy and images (Props tab):
import { FeatureMatrix } from "@/components/funneldna/content/feature-matrix"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/feature-matrix/component.tsx 792 lines
// Compares what each plan includes so the buyer can pick the right plan and act.
// layout: clipboard-checklist
// Plan feature matrix: a printed comparison sheet that ticks off what each plan gets, raises the recommended plan, keeps prices and actions in a sticky header, and repeats each action under the list.
// On narrow containers it collapses to one card per plan, recommended first.
import * as React from "react"
import { Check, Minus, Star } from "lucide-react"
/** A value in a plan cell: true = tick, false/null = dash, a short string, or a named item with an optional thumbnail. */
export type FeatureMatrixValue = boolean | null | string | FeatureMatrixItemValue
export type FeatureMatrixItemValue = {
text: React.ReactNode
/** Thumbnail src (an item-n slot image) */
image?: string
imageAlt?: string
}
export type FeatureMatrixPlan = {
id: string
name: string
price: string
/** Short line under the price, e.g. "One payment · Lifetime access" */
priceNote?: string
/** Raises this column and makes its buttons the primary action */
recommended?: boolean
/** Label in the raised header, e.g. "Recommended" */
badge?: string
/** Button label, repeated in the header and under the list */
label: string
/** One reassurance line under the header button */
sublabel?: string
/** Closing line above the repeated button, e.g. "$47 today. That's it." */
actionLine?: string
/** Small line under the closing line */
actionNote?: string
href?: string
disabled?: boolean
}
export type FeatureMatrixRow = {
label: string
/** One value per plan, in plan order */
values: FeatureMatrixValue[]
}
export type FeatureMatrixGroup = {
title: string
rows: FeatureMatrixRow[]
}
export type FeatureMatrixCopy = {
/** Accessible name of the comparison table */
tableLabel: string
/** Accessible label for a tick */
included: string
/** Accessible label for a dash */
notIncluded: string
/** Accessible name of the phone card list */
cardsLabel: string
}
export type FeatureMatrixProps = {
/** The question in the corner cell */
heading?: React.ReactNode
/** One-sentence lines under the question */
lines?: string[]
/** One short emphasis line after the lines */
punch?: string
/** 2–4 plans; extra plans are ignored */
plans?: FeatureMatrixPlan[]
groups?: FeatureMatrixGroup[]
/** Level of the corner question; plan names use the next level */
headingLevel?: 2 | 3 | 4
/** Keep the plan header row pinned while the rows scroll */
sticky?: boolean
/** Distance in px from the viewport top when pinned (e.g. under a fixed bar) */
stickyOffset?: number
state?: "default" | "hover" | "active" | "disabled"
onAction?: (planId: string) => void
copy?: Partial<FeatureMatrixCopy>
className?: string
}
const DEFAULT_HEADING = (
<>
Ready to map your <span className="cffm-em">first funnel</span>?
</>
)
const DEFAULT_LINES = ["Watch the walkthrough free.", "Or take the whole kit and start building."]
const DEFAULT_PLANS: FeatureMatrixPlan[] = [
{
id: "workshop",
name: "Funnel Starter Workshop",
price: "Free",
priceNote: "On-demand workshop",
label: "Let me watch it first",
sublabel: "Free workshop · Watch online",
actionLine: "Free. Watch it on demand.",
},
{
id: "kit",
name: "The Funnel Starter Kit",
price: "$47",
priceNote: "One payment · Lifetime access",
recommended: true,
badge: "Recommended",
label: "I'm ready, show me how",
actionLine: "$47 today. That's it.",
actionNote: "One payment. Yours to keep.",
},
]
const DEFAULT_GROUPS: FeatureMatrixGroup[] = [
{
title: "Plan, write & check",
rows: [
{ label: "Offer & funnel plan", values: ["Walkthrough", "Funnel Planning Guide"] },
{ label: "Page copy", values: ["Walkthrough", "Page Copy Workbook"] },
{ label: "Next steps before launch", values: ["Walkthrough", "Launch Checklist"] },
],
},
{
title: "Access & reassurance",
rows: [
{ label: "How you get it", values: ["Watch online", "Instant download"] },
{ label: "Lifetime access", values: [false, true] },
{ label: "30-day money-back guarantee", values: [false, true] },
],
},
]
const DEFAULT_COPY: FeatureMatrixCopy = {
tableLabel: "Compare plans",
included: "Included",
notIncluded: "Not included",
cardsLabel: "Plans",
}
export function FeatureMatrix(props: FeatureMatrixProps) {
const {
heading = DEFAULT_HEADING,
lines = DEFAULT_LINES,
punch = "Your move.",
plans: rawPlans = DEFAULT_PLANS,
groups = DEFAULT_GROUPS,
headingLevel = 3,
sticky = true,
stickyOffset = 0,
state = "default",
onAction,
copy: copyProp,
className,
} = props
const copy: FeatureMatrixCopy = { ...DEFAULT_COPY, ...copyProp }
const plans = rawPlans.slice(0, 4)
const featuredIndex = plans.findIndex((plan) => plan.recommended)
const allDisabled = state === "disabled"
const uid = React.useId()
const H = `h${headingLevel}` as React.ElementType
const Sub = `h${headingLevel + 1}` as React.ElementType
const sentinel = React.useRef<HTMLDivElement>(null)
const [stuck, setStuck] = React.useState(false)
React.useEffect(() => {
if (!sticky) return
const node = sentinel.current
if (!node || typeof IntersectionObserver === "undefined") return
const observer = new IntersectionObserver(
([entry]) => setStuck(!entry.isIntersecting && entry.boundingClientRect.top < stickyOffset + 1),
{ rootMargin: `${-stickyOffset}px 0px 0px 0px`, threshold: 0 },
)
observer.observe(node)
return () => observer.disconnect()
}, [sticky, stickyOffset])
const isPrimary = (index: number) => featuredIndex < 0 || index === featuredIndex
const isDisabled = (plan: FeatureMatrixPlan) => allDisabled || Boolean(plan.disabled)
const intro = (
<>
<H className="cffm-title">{heading}</H>
{lines.length ? (
<div className="cffm-lines">
{lines.map((line) => (
<p key={line}>{line}</p>
))}
</div>
) : null}
{punch ? <p className="cffm-punch">{punch}</p> : null}
</>
)
// Rows are placed explicitly so the raised rail can span them all.
let rowNo = 1
const bodyRows: React.ReactNode[] = []
groups.forEach((group, gi) => {
rowNo += 1
bodyRows.push(
<div role="row" className="cffm-row cffm-group" key={`g${gi}`} style={rowStyle(rowNo)}>
<div role="rowheader" aria-colspan={plans.length + 1} className="cffm-cell cffm-group-cell">
{group.title}
</div>
</div>,
)
group.rows.forEach((row, ri) => {
rowNo += 1
bodyRows.push(
<div role="row" className="cffm-row cffm-frow" key={`g${gi}r${ri}`} style={rowStyle(rowNo)}>
<div role="rowheader" className="cffm-cell cffm-label">
{row.label}
</div>
{plans.map((plan, pi) => (
<div role="cell" key={plan.id} className={`cffm-cell cffm-value${pi === featuredIndex ? " is-featured" : ""}`}>
<ValueView value={row.values[pi]} copy={copy} />
</div>
))}
</div>,
)
})
})
const footRow = rowNo + 1
const cardOrder =
featuredIndex >= 0
? [featuredIndex, ...plans.map((_, i) => i).filter((i) => i !== featuredIndex)]
: plans.map((_, i) => i)
const sheetStyle = {
"--cffm-plans": String(plans.length),
"--cffm-rows": String(footRow),
"--cffm-fcol": String(featuredIndex + 2),
} as React.CSSProperties
return (
<div
className={`cf-feature-matrix${className ? ` ${className}` : ""}`}
data-plans={plans.length}
data-state={state}
data-sticky={sticky ? "" : undefined}
data-stuck={stuck ? "" : undefined}
style={{ "--cffm-top": `${stickyOffset}px` } as React.CSSProperties}
>
<style>{CSS}</style>
<div className="cffm-matrix">
<div className="cffm-sheet" role="table" aria-label={copy.tableLabel} style={sheetStyle}>
<div ref={sentinel} className="cffm-sentinel" aria-hidden="true" />
{featuredIndex >= 0 ? <div className="cffm-rail" aria-hidden="true" /> : null}
<div role="row" className="cffm-row cffm-head" style={rowStyle(1)}>
<div role="columnheader" className="cffm-cell cffm-corner">
{intro}
</div>
{plans.map((plan, pi) => {
const featured = pi === featuredIndex
return (
<div role="columnheader" key={plan.id} className={`cffm-cell cffm-plan${featured ? " is-featured" : ""}`}>
{featured ? (
<div className="cffm-band">
{plan.badge ? (
<span className="cffm-badge">
<Star aria-hidden="true" fill="currentColor" />
{plan.badge}
</span>
) : null}
<Sub className="cffm-name">{plan.name}</Sub>
</div>
) : (
<Sub className="cffm-name">{plan.name}</Sub>
)}
<div className="cffm-plan-body">
<Price price={plan.price} />
{plan.priceNote ? <p className="cffm-note">{plan.priceNote}</p> : null}
<div className="cffm-act">
<PlanButton plan={plan} primary={isPrimary(pi)} disabled={isDisabled(plan)} onAction={onAction} />
{plan.sublabel ? <p className="cffm-sub">{plan.sublabel}</p> : null}
</div>
</div>
</div>
)
})}
</div>
{bodyRows}
<div role="row" className="cffm-row cffm-foot" style={rowStyle(footRow)}>
<div role="cell" className="cffm-cell cffm-foot-lead" />
{plans.map((plan, pi) => (
<div role="cell" key={plan.id} className={`cffm-cell cffm-foot-cell${pi === featuredIndex ? " is-featured" : ""}`}>
{plan.actionLine ? <p className="cffm-line">{plan.actionLine}</p> : null}
{plan.actionNote ? <p className="cffm-line-note">{plan.actionNote}</p> : null}
<PlanButton plan={plan} primary={isPrimary(pi)} disabled={isDisabled(plan)} onAction={onAction} />
</div>
))}
</div>
</div>
</div>
<div className="cffm-mobile">
<div className="cffm-intro">{intro}</div>
<div className="cffm-cards" role="list" aria-label={copy.cardsLabel}>
{cardOrder.map((pi) => {
const plan = plans[pi]
const featured = pi === featuredIndex
const nameId = `${uid}-plan-${pi}`
return (
<article
role="listitem"
key={plan.id}
aria-labelledby={nameId}
className={`cffm-card${featured ? " is-featured" : ""}`}
style={{ "--i": String(cardOrder.indexOf(pi)) } as React.CSSProperties}
>
{featured ? (
<div className="cffm-band">
{plan.badge ? (
<span className="cffm-badge">
<Star aria-hidden="true" fill="currentColor" />
{plan.badge}
</span>
) : null}
<Sub id={nameId} className="cffm-name">
{plan.name}
</Sub>
</div>
) : (
<div className="cffm-card-head">
<Sub id={nameId} className="cffm-name">
{plan.name}
</Sub>
</div>
)}
<div className="cffm-card-price">
<Price price={plan.price} />
{plan.priceNote ? <p className="cffm-note">{plan.priceNote}</p> : null}
</div>
{groups.map((group, gi) => (
<div className="cffm-card-group" key={gi}>
<p className="cffm-card-gtitle">{group.title}</p>
<ul className="cffm-card-list">
{group.rows.map((row, ri) => (
<li key={ri}>
<span className="cffm-card-label">{row.label}</span>
<span className="cffm-card-value">
<ValueView value={row.values[pi]} copy={copy} />
</span>
</li>
))}
</ul>
</div>
))}
<div className="cffm-card-foot">
{plan.actionLine ? <p className="cffm-line">{plan.actionLine}</p> : null}
{plan.actionNote ? <p className="cffm-line-note">{plan.actionNote}</p> : null}
<PlanButton plan={plan} primary={isPrimary(pi)} disabled={isDisabled(plan)} onAction={onAction} />
{plan.sublabel ? <p className="cffm-sub">{plan.sublabel}</p> : null}
</div>
</article>
)
})}
</div>
</div>
</div>
)
}
export default FeatureMatrix
function rowStyle(row: number) {
return { gridRow: String(row), "--i": String(row) } as React.CSSProperties
}
function Price({ price }: { price: string }) {
return <span className="cffm-price">{price}</span>
}
function PlanButton({
plan,
primary,
disabled,
onAction,
}: {
plan: FeatureMatrixPlan
primary: boolean
disabled: boolean
onAction?: (planId: string) => void
}) {
const className = `cffm-btn ${primary ? "cffm-btn--primary" : "cffm-btn--secondary"}`
const handle = () => onAction?.(plan.id)
if (plan.href && !disabled) {
return (
<a className={className} href={plan.href} onClick={handle}>
{plan.label}
</a>
)
}
return (
<button type="button" className={className} disabled={disabled} onClick={handle}>
{plan.label}
</button>
)
}
function ValueView({ value, copy }: { value: FeatureMatrixValue | undefined; copy: FeatureMatrixCopy }) {
if (value === true) {
return (
<span className="cffm-tick" role="img" aria-label={copy.included}>
<Check aria-hidden="true" />
</span>
)
}
if (value === false || value === null || value === undefined || value === "") {
return (
<span className="cffm-dash" role="img" aria-label={copy.notIncluded}>
<Minus aria-hidden="true" />
</span>
)
}
if (typeof value === "string") return <span className="cffm-val">{value}</span>
return (
<span className="cffm-val">
{value.image ? (
<img className="cffm-thumb" src={value.image} alt={value.imageAlt ?? ""} width={40} height={40} loading="lazy" />
) : null}
<span>{value.text}</span>
</span>
)
}
const CSS = `
.cf-feature-matrix{
--cffm-r:var(--card-radius,var(--radius,0.875rem));
--cffm-br:var(--button-radius,var(--radius,0.75rem));
--cffm-border:var(--card-border,color-mix(in oklch,var(--ink,#101828) 12%,transparent));
--cffm-line:oklch(from var(--ink,#101828) l c h / 0.12);
--cffm-well:color-mix(in oklch,var(--ink,#101828) 5%,var(--card,#ffffff));
--cffm-shade:var(--shadow,oklch(0.22 0.03 260));
container:cffm / inline-size;
isolation:isolate;
position:relative;
width:100%;
color:var(--ink,#101828);
font-family:var(--font-body);
font-size:1rem;
line-height:1.45;
-webkit-font-smoothing:antialiased;
}
.cf-feature-matrix *,.cf-feature-matrix *::before,.cf-feature-matrix *::after{box-sizing:border-box}
.cf-feature-matrix :is(h2,h3,h4,h5,h6,p,ul){margin:0}
.cf-feature-matrix ul{padding:0;list-style:none}
/* Intro: question, one-line punches */
.cf-feature-matrix .cffm-title{
font-family:var(--font-display);
font-weight:var(--display-weight,800);
text-transform:var(--display-case,none);
letter-spacing:var(--display-tracking,-0.025em);
font-size:clamp(1.625rem,2.5vw,2.375rem);
line-height:1.06;
text-wrap:balance;
color:var(--ink,#101828);
margin-bottom:0.75rem;
}
.cffm-em{color:var(--accent,#2563eb)}
.cffm-lines{display:grid;gap:0.25rem}
.cffm-lines p{font-size:1.0625rem;line-height:1.45;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cf-feature-matrix .cffm-punch{
margin-top:0.625rem;
font-family:var(--font-display);
font-weight:var(--display-weight,800);
font-size:1.3125rem;
line-height:1.2;
letter-spacing:-0.01em;
color:var(--ink,#101828);
}
/* The printed sheet */
.cffm-matrix{padding:1.5rem 0.75rem 0.875rem 0}
.cffm-sheet{
position:relative;
display:grid;
grid-template-columns:minmax(13rem,1.2fr) repeat(var(--cffm-plans),minmax(10.5rem,1fr));
grid-template-rows:repeat(var(--cffm-rows),auto);
background:var(--card,#ffffff);
border:1px solid var(--cffm-border);
border-radius:var(--cffm-r);
box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / 0.22),0 4px 10px -2px oklch(0.22 0.03 260 / 0.2));
}
.cffm-sheet::before{
content:"";
position:absolute;
inset:0.625rem -0.625rem -0.625rem 0.625rem;
z-index:-1;
border-radius:var(--cffm-r);
border:1px solid var(--cffm-border);
background:color-mix(in oklch,var(--ink,#101828) 6%,var(--card,#ffffff));
box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / 0.18),0 1px 3px oklch(0.22 0.03 260 / 0.14));
}
.cffm-sentinel{grid-row:1;grid-column:1;align-self:start;height:1px;pointer-events:none}
.cffm-rail{
grid-column:var(--cffm-fcol);
grid-row:1 / -1;
margin:-1.5rem -0.5rem -0.75rem;
position:relative;
z-index:0;
background:var(--card,#ffffff);
border:1px solid var(--cffm-border);
border-radius:var(--cffm-r);
box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / 0.22),0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
pointer-events:none;
}
.cffm-row{display:grid;grid-template-columns:subgrid;grid-column:1 / -1}
.cffm-cell{position:relative;z-index:1;min-width:0}
/* Header row: plans, prices, actions */
.cffm-head{background:var(--card,#ffffff);border-radius:var(--cffm-r) var(--cffm-r) 0 0}
.cf-feature-matrix[data-sticky] .cffm-head{position:sticky;top:var(--cffm-top,0px);z-index:3}
.cf-feature-matrix[data-stuck] .cffm-head{
border-radius:0;
box-shadow:0 1px 0 var(--cffm-line),0 10px 14px -10px oklch(from var(--cffm-shade) l c h / 0.45);
}
.cffm-corner{display:flex;flex-direction:column;justify-content:center;padding:1.75rem 1.5rem 1.5rem 1.75rem}
.cffm-plan{display:flex;flex-direction:column;align-items:center;text-align:center;padding:1.5rem 1rem}
.cffm-plan.is-featured{
margin:-1.5rem -0.5rem 0;
padding:0 0 1.5rem;
background:var(--card,#ffffff);
border:1px solid var(--cffm-border);
border-bottom:0;
border-radius:var(--cffm-r) var(--cffm-r) 0 0;
}
.cffm-plan-body{display:flex;flex:1;flex-direction:column;align-items:center;width:100%}
.cffm-plan.is-featured .cffm-plan-body{padding:0 1rem}
.cf-feature-matrix .cffm-name{
font-family:var(--font-display);
font-weight:var(--display-weight,800);
text-transform:var(--display-case,none);
font-size:1.3125rem;
line-height:1.15;
letter-spacing:-0.015em;
text-wrap:balance;
color:var(--ink,#101828);
}
.cffm-band{
align-self:stretch;
display:flex;
flex-direction:column;
align-items:center;
gap:0.625rem;
margin:-1px -1px 1.25rem;
padding:0.875rem 1rem 1.125rem;
background:var(--band,#1e293b);
color:var(--band-ink,#ffffff);
border-radius:var(--cffm-r) var(--cffm-r) 0 0;
text-align:center;
}
.cf-feature-matrix .cffm-band .cffm-name{color:var(--band-ink,#ffffff);font-size:1.375rem}
.cffm-badge{
display:inline-flex;
align-items:center;
gap:0.375rem;
padding:0.3125rem 0.8125rem;
border-radius:999px;
background:color-mix(in oklch,var(--band-ink,#ffffff) 14%,var(--band,#1e293b));
color:var(--band-ink,#ffffff);
font-size:0.875rem;
font-weight:700;
line-height:1.2;
letter-spacing:0.01em;
white-space:nowrap;
}
.cffm-badge svg{width:0.875rem;height:0.875rem}
.cffm-price{
position:relative;
display:inline-block;
margin-top:0.875rem;
font-family:var(--font-display);
font-weight:900;
font-size:clamp(2.5rem,3.6vw,3.25rem);
line-height:1;
letter-spacing:-0.035em;
font-variant-numeric:tabular-nums;
color:var(--ink,#101828);
}
.cffm-plan.is-featured .cffm-price{margin-top:0.375rem}
.cf-feature-matrix .cffm-note{margin-top:0.875rem;font-size:1rem;line-height:1.4;font-weight:500;color:var(--muted,#475467);text-wrap:pretty}
.cffm-act{display:grid;justify-items:center;gap:0.625rem;width:100%;margin-top:auto;padding-top:1.25rem}
.cf-feature-matrix .cffm-sub{font-size:0.875rem;line-height:1.35;color:var(--muted,#475467);text-wrap:pretty}
/* Buttons */
.cffm-btn{
appearance:none;
display:inline-flex;
align-items:center;
justify-content:center;
width:100%;
min-height:3.375rem;
margin:0;
padding:0.875rem 1.125rem;
border:1px solid transparent;
border-radius:var(--cffm-br);
font-family:var(--button-font,var(--font-display));
font-weight:var(--button-weight,800);
text-transform:var(--button-case,none);
font-size:1.0625rem;
line-height:1.2;
text-align:center;
text-wrap:balance;
text-decoration:none;
cursor:pointer;
-webkit-tap-highlight-color:transparent;
}
.cffm-btn--primary{
background:linear-gradient(oklch(from var(--button-bg,var(--cta,#dc2626)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2,#b91c1c)) l c h));
color:var(--button-ink,var(--cta-ink,#ffffff));
text-shadow:var(--button-text-shadow,none);
border-color:oklch(from var(--button-bg-2,var(--cta-2,#b91c1c)) calc(l - 0.06) c h);
box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#dc2626)) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#dc2626)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--cffm-shade) l c h / 0.3),0 6px 12px -4px oklch(from var(--cffm-shade) l c h / 0.35));
}
.cffm-btn--primary:hover,.cf-feature-matrix[data-state="hover"] .cffm-btn--primary:not(:disabled){
background:linear-gradient(oklch(from var(--button-bg,var(--cta,#dc2626)) calc(l - 0.02) c h),oklch(from var(--button-bg-2,var(--cta-2,#b91c1c)) calc(l - 0.06) c h));
transform:translateY(-1px);
}
.cffm-btn--primary:active,.cf-feature-matrix[data-state="active"] .cffm-btn--primary:not(:disabled){
background:oklch(from var(--button-bg-2,var(--cta-2,#b91c1c)) calc(l - 0.04) c h);
transform:translateY(1px);
box-shadow:inset 0 2px 3px oklch(from var(--button-bg-2,var(--cta-2,#b91c1c)) calc(l - 0.2) c h / 0.6),0 1px 1px oklch(from var(--cffm-shade) l c h / 0.25);
}
.cffm-btn--secondary{
background:var(--button-2-bg,var(--secondary,#eef1f5));
color:var(--button-2-ink,var(--secondary-ink,#101828));
border-color:var(--button-2-border,transparent);
box-shadow:var(--button-2-shadow, var(--shadow-sm));
}
.cffm-btn--secondary:hover,.cf-feature-matrix[data-state="hover"] .cffm-btn--secondary:not(:disabled){
background:oklch(from var(--button-2-bg,var(--secondary,#eef1f5)) calc(l - 0.04) c h);
transform:translateY(-1px);
}
.cffm-btn--secondary:active,.cf-feature-matrix[data-state="active"] .cffm-btn--secondary:not(:disabled){
background:oklch(from var(--button-2-bg,var(--secondary,#eef1f5)) calc(l - 0.07) c h);
transform:translateY(1px);
box-shadow:inset 0 2px 3px oklch(from var(--cffm-shade) l c h / 0.18);
}
.cffm-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px}
.cffm-btn:disabled{
cursor:not-allowed;
transform:none;
background:var(--secondary,#eef1f5);
color:var(--muted,#475467);
text-shadow:none;
border-color:transparent;
box-shadow:none;
}
/* Group rows and feature rows */
.cffm-group{background:var(--cffm-well)}
.cffm-group-cell{
grid-column:1 / -1;
padding:0.875rem 1.5rem 0.75rem 1.75rem;
border-top:1px solid var(--cffm-line);
font-family:var(--font-display);
font-weight:var(--display-weight,800);
font-size:1.125rem;
line-height:1.25;
letter-spacing:-0.01em;
}
.cffm-frow > .cffm-cell{
display:flex;
align-items:center;
justify-content:center;
padding:0.875rem 1rem;
border-top:1px solid var(--cffm-line);
font-size:1rem;
line-height:1.35;
text-align:center;
}
.cffm-frow > .cffm-label{justify-content:flex-start;padding-left:1.75rem;text-align:left;font-weight:700;font-size:1.0625rem;text-wrap:pretty}
.cffm-frow:hover{background:color-mix(in oklch,var(--ink,#101828) 3%,var(--card,#ffffff))}
.cffm-frow:hover > .is-featured{background:color-mix(in oklch,var(--accent-fill,var(--accent,#2563eb)) 7%,var(--card,#ffffff))}
.cffm-value.is-featured{font-weight:700}
.cffm-tick{
display:inline-grid;
place-items:center;
width:1.875rem;
height:1.875rem;
border-radius:999px;
background:var(--success-soft,oklch(0.93 0.02 150));
color:var(--success,#15803d);
}
.cffm-tick svg{width:1.125rem;height:1.125rem;stroke-width:3}
.cffm-dash{display:inline-grid;place-items:center;color:var(--muted,#475467)}
.cffm-dash svg{width:1.25rem;height:1.25rem;stroke-width:2.5}
.cffm-val{display:inline-flex;align-items:center;gap:0.625rem;min-width:0;text-wrap:pretty}
.cffm-thumb{
flex:none;
width:2.5rem;
height:2.5rem;
border-radius:0.5rem;
object-fit:cover;
object-position:center;
filter:drop-shadow(0 2px 3px oklch(from var(--cffm-shade) l c h / 0.3));
}
/* Footer row: the action again */
.cffm-foot > .cffm-cell{border-top:1px solid var(--cffm-line)}
.cffm-foot-cell{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:0.625rem;padding:1.375rem 1rem 1.5rem;text-align:center}
.cf-feature-matrix .cffm-line{
font-family:var(--font-display);
font-weight:var(--display-weight,800);
font-size:1.25rem;
line-height:1.2;
letter-spacing:-0.01em;
text-wrap:balance;
color:var(--ink,#101828);
}
.cf-feature-matrix .cffm-line-note{margin-top:-0.25rem;font-size:0.9375rem;line-height:1.35;color:var(--muted,#475467);text-wrap:pretty}
/* Phone: one card per plan */
.cffm-mobile{display:none}
.cffm-intro{margin-bottom:1.5rem;text-align:center}
.cffm-intro .cffm-lines{justify-items:center}
.cffm-cards{display:grid;gap:1.25rem;align-items:start}
.cffm-card{
overflow:hidden;
background:var(--card,#ffffff);
border:1px solid var(--cffm-border);
border-radius:var(--cffm-r);
box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / 0.22),0 4px 10px -2px oklch(0.22 0.03 260 / 0.2));
}
.cffm-card.is-featured{border-color:transparent;box-shadow:0 0 0 2px var(--accent-fill, var(--accent,#2563eb)),var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / 0.22),0 12px 24px -8px oklch(0.22 0.03 260 / 0.32))}
.cffm-card .cffm-band{margin:0;border-radius:0}
.cffm-card-head{padding:1.25rem 1.25rem 0;text-align:center}
.cffm-card-price{display:flex;flex-direction:column;align-items:center;padding:1.25rem 1.25rem 0;text-align:center}
.cffm-card-price .cffm-price{margin-top:0.25rem}
.cffm-card-price .cffm-note{margin-top:0.75rem}
.cffm-card-group{padding:1.25rem 1.25rem 0}
.cf-feature-matrix .cffm-card-gtitle{
padding:0.5rem 0.75rem;
border-radius:0.5rem;
background:var(--cffm-well);
font-family:var(--font-display);
font-weight:var(--display-weight,800);
font-size:1rem;
line-height:1.3;
}
.cffm-card-list li{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem 0.25rem}
.cffm-card-list li + li{border-top:1px solid var(--cffm-line)}
.cffm-card-label{min-width:0;font-weight:700;line-height:1.35;text-wrap:pretty}
.cffm-card-value{display:flex;justify-content:flex-end;flex:none;max-width:58%;text-align:right;line-height:1.35}
.cffm-card.is-featured .cffm-card-value{font-weight:700}
.cffm-card-value .cffm-thumb{width:2rem;height:2rem}
.cffm-card-foot{display:grid;justify-items:center;gap:0.625rem;padding:1.25rem;text-align:center}
.cffm-card-foot .cffm-line-note{margin-top:-0.375rem}
@container cffm (max-width: 47.99rem){
.cffm-matrix{display:none}
.cffm-mobile{display:block}
}
@container cffm (max-width: 53.99rem){
.cf-feature-matrix[data-plans="3"] .cffm-matrix{display:none}
.cf-feature-matrix[data-plans="3"] .cffm-mobile{display:block}
}
@container cffm (max-width: 61.99rem){
.cf-feature-matrix[data-plans="4"] .cffm-matrix{display:none}
.cf-feature-matrix[data-plans="4"] .cffm-mobile{display:block}
}
@container cffm (min-width: 36rem){
.cffm-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (prefers-reduced-motion: no-preference){
.cffm-btn{transition:transform 0.15s ease,box-shadow 0.15s ease,background 0.15s ease}
.cf-feature-matrix .cffm-head{transition:box-shadow 0.2s ease}
.cffm-frow{transition:background 0.15s ease}
.cffm-frow > .cffm-cell,.cffm-group-cell,.cffm-foot-cell{
animation:cffm-rise 0.45s cubic-bezier(0.22,0.61,0.36,1) backwards;
animation-delay:min(calc(var(--i,0) * 45ms),400ms);
}
.cffm-tick{
animation:cffm-pop 0.36s cubic-bezier(0.34,1.56,0.64,1) backwards;
animation-delay:min(calc(var(--i,0) * 45ms + 140ms),540ms);
}
.cffm-card{animation:cffm-rise 0.45s cubic-bezier(0.22,0.61,0.36,1) backwards;animation-delay:min(calc(var(--i,0) * 70ms),280ms)}
}
@keyframes cffm-rise{from{opacity:0.82;transform:translateY(8px)}}
@keyframes cffm-pop{from{opacity:0.5;transform:scale(0.6)}}
@media (prefers-reduced-motion: reduce){
.cffm-btn:hover,.cffm-btn:active,.cf-feature-matrix[data-state] .cffm-btn{transform:none}
}
`
pieces/content/feature-matrix/specimen.tsx 64 lines
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
import { FeatureMatrix, type FeatureMatrixGroup, type FeatureMatrixPlan } from "../feature-matrix"
export const states = ["default", "hover", "active", "disabled"]
export default function FeatureMatrixSpecimen({ state = "default" }: { state?: "default" | "hover" | "active" | "disabled" }) {
const sample = defaults.sample
const [guide, workbook, checklist] = sample.items
const plans: FeatureMatrixPlan[] = [
{
id: "workshop",
name: sample.registration.name,
price: "Free",
priceNote: "On-demand workshop",
label: "Let me watch it first",
sublabel: sample.registration.sublabel,
actionLine: "Free. Watch it on demand.",
},
{
id: "kit",
name: sample.name,
price: sample.price,
priceNote: sample.note,
recommended: true,
badge: "Recommended",
label: "I'm ready, show me how",
sublabel: sample.sublabel,
actionLine: `${sample.price} today. That's it.`,
actionNote: "One payment. Yours to keep.",
},
]
const groups: FeatureMatrixGroup[] = [
{
title: "Plan, write & check",
rows: [
{
label: "Offer & funnel plan",
values: ["Walkthrough", { text: guide.name, image: slot("item-1", guide.image), imageAlt: guide.imageAlt }],
},
{
label: "Page copy",
values: ["Walkthrough", { text: workbook.name, image: slot("item-2", workbook.image), imageAlt: workbook.imageAlt }],
},
{
label: "Next steps before launch",
values: ["Walkthrough", { text: checklist.name, image: slot("item-3", checklist.image), imageAlt: checklist.imageAlt }],
},
],
},
{
title: "Access & reassurance",
rows: [
{ label: "How you get it", values: ["Watch online", "Instant download"] },
{ label: "Lifetime access", values: [false, true] },
{ label: "30-day money-back guarantee", values: [false, true] },
],
},
]
return <FeatureMatrix plans={plans} groups={groups} state={state} />
}
| Name | Type | Details |
|---|---|---|
heading OptionalFeatureMatrix |
React.ReactNode |
|
lines OptionalFeatureMatrix |
string[] |
|
punch OptionalFeatureMatrix |
string |
|
plans OptionalFeatureMatrix |
FeatureMatrixPlan[] |
|
groups OptionalFeatureMatrix |
FeatureMatrixGroup[] |
|
headingLevel OptionalFeatureMatrix |
2 | 3 | 4 |
|
sticky OptionalFeatureMatrix |
boolean |
|
stickyOffset OptionalFeatureMatrix |
number |
|
state OptionalFeatureMatrix |
"default" | "hover" | "active" | "disabled" |
|
onAction OptionalFeatureMatrix |
(planId: string) => void |
|
copy OptionalFeatureMatrix |
Partial<FeatureMatrixCopy> |
|
className OptionalFeatureMatrix |
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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- 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