Cost Comparison 1
Prices each part of the offer on its own, then shows today's single price so the deal is easy to see.
Use it in a prompt
Use content/cost-comparison 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/cost-comparison.tsx. - Import it and pass your copy and images (Props tab):
import { CostComparison } from "@/components/funneldna/content/cost-comparison"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/cost-comparison/component.tsx 300 lines
// Prices each part of the offer on its own, then shows today's single price so the deal is easy to see.
// layout: interview-qa
// Cost comparison: an interview-style Q&A that prices each piece on its own, strikes the total, lands on today's one-time price in a quiet featured row (never the action colour, so the button stays loudest), then asks for the click.
import * as React from "react"
import { ShieldCheck } from "lucide-react"
export type CostComparisonRow = {
name: string
/** One short line under the name. */
detail?: string
/** Supplied price for this piece bought on its own. */
value: string
/** Product photo for the row (slot item-n). */
image?: string
imageAlt?: string
}
export type CostComparisonProps = {
/** First red interview question, above the ledger. */
question?: React.ReactNode
/** Optional short answer line above the ledger. */
answer?: React.ReactNode
columnLabel?: string
valueLabel?: string
rows?: CostComparisonRow[]
totalLabel?: string
/** Supplied total of the rows; shown struck through. */
totalValue?: string
price?: string
/** Today line; "{price}" is replaced by the price. */
todayLine?: string
todayNote?: string
/** Second red interview question, above the action. */
closeQuestion?: React.ReactNode
closeAnswer?: React.ReactNode
label?: string
sublabel?: string
reassurance?: string
href?: string
onAction?: (event: React.MouseEvent<HTMLElement>) => void
disabled?: boolean
state?: "default" | "hover" | "active" | "disabled"
copy?: { questionMark?: string; answerMark?: string; tableCaption?: string; totalSr?: string }
className?: string
}
const DEFAULT_ROWS: CostComparisonRow[] = [
{ name: "Funnel Planning Guide", detail: "Map your offer and the pages your funnel needs.", value: "$49" },
{ name: "Page Copy Workbook", detail: "Draft your headline, offer, and call to action.", value: "$29" },
{ name: "Launch Checklist", detail: "Review the links, forms, and next steps before launch.", value: "$19" },
]
const DEFAULT_COPY = {
questionMark: "Q.",
answerMark: "A.",
tableCaption: "What each piece costs bought separately, and today's price",
totalSr: "Was",
}
export function CostComparison(props: CostComparisonProps) {
const {
question = "What would it cost to buy each piece on its own?",
answer,
columnLabel = "Bought separately",
valueLabel = "Value",
rows = DEFAULT_ROWS,
totalLabel = "Total value",
totalValue = "$97",
price = "$47",
todayLine = "{price} today. That's it.",
todayNote = "One payment \u00b7 Lifetime access",
closeQuestion = "So how do I get all three today?",
closeAnswer = "Tap below. The guide, workbook and checklist download instantly.",
label = "Get the kit",
sublabel = "Instant download",
reassurance = "30-day money-back guarantee",
href,
onAction,
disabled = false,
state = "default",
className = "",
} = props
const copy = { ...DEFAULT_COPY, ...props.copy }
const isDisabled = disabled || state === "disabled"
const { before, after } = splitPrice(todayLine)
const buttonBody = (
<>
<span className="cfcc-btn-label">{label}</span>
{sublabel ? <span className="cfcc-btn-sub">{sublabel}</span> : null}
</>
)
const action = href ? (
isDisabled ? (
<a className="cfcc-btn" role="link" aria-disabled="true">
{buttonBody}
</a>
) : (
<a className="cfcc-btn" href={href} onClick={onAction}>
{buttonBody}
</a>
)
) : (
<button type="button" className="cfcc-btn" disabled={isDisabled} onClick={onAction}>
{buttonBody}
</button>
)
return (
<div className={`cf-cost-comparison ${className}`.trim()} data-state={state}>
<style>{CSS}</style>
<div className="cfcc-qa">
<div className="cfcc-line">
<span className="cfcc-mark" aria-hidden="true">{copy.questionMark}</span>
<h3 className="cfcc-question">{question}</h3>
</div>
<div className="cfcc-line cfcc-answer">
<span className="cfcc-mark cfcc-mark-a" aria-hidden="true">{copy.answerMark}</span>
<div className="cfcc-body">
{answer ? <p className="cfcc-say">{answer}</p> : null}
<div className="cfcc-ledger">
<table className="cfcc-table">
<caption className="cfcc-sr">{copy.tableCaption}</caption>
<thead>
<tr>
<th scope="col">{columnLabel}</th>
<th scope="col" className="cfcc-num">{valueLabel}</th>
</tr>
</thead>
<tbody>
{rows.map((row, i) => (
<tr className="cfcc-item" key={`${row.name}-${i}`} style={{ ["--i" as string]: i } as React.CSSProperties}>
<th scope="row">
<span className="cfcc-what">
{row.image ? (
<img
className="cfcc-thumb"
src={row.image}
alt={row.imageAlt ?? row.name}
width={52}
height={52}
loading="lazy"
decoding="async"
/>
) : null}
<span className="cfcc-text">
<span className="cfcc-name">{row.name}</span>
{row.detail ? <span className="cfcc-detail">{row.detail}</span> : null}
</span>
</span>
</th>
<td className="cfcc-num cfcc-value">
<span className="cfcc-amount">{row.value}</span>
</td>
</tr>
))}
</tbody>
<tfoot>
{totalValue ? (
<tr className="cfcc-total">
<th scope="row" className="cfcc-total-label">{totalLabel}</th>
<td className="cfcc-num">
<s className="cfcc-struck">
<span className="cfcc-sr">{copy.totalSr} </span>
{totalValue}
</s>
</td>
</tr>
) : null}
<tr className="cfcc-today">
<td colSpan={2}>
<p className="cfcc-today-line">
{before ? <span className="cfcc-today-rest">{before}</span> : null}
<span className="cfcc-today-price">{price}</span>
{after ? <span className="cfcc-today-rest">{after}</span> : null}
</p>
{todayNote ? <p className="cfcc-today-note">{todayNote}</p> : null}
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div className="cfcc-qa">
<div className="cfcc-line">
<span className="cfcc-mark" aria-hidden="true">{copy.questionMark}</span>
<h3 className="cfcc-question">{closeQuestion}</h3>
</div>
<div className="cfcc-line cfcc-answer">
<span className="cfcc-mark cfcc-mark-a" aria-hidden="true">{copy.answerMark}</span>
<div className="cfcc-body">
{closeAnswer ? <p className="cfcc-say">{closeAnswer}</p> : null}
<div className="cfcc-action">
{action}
{reassurance ? (
<p className="cfcc-assure">
<ShieldCheck aria-hidden="true" />
<span>{reassurance}</span>
</p>
) : null}
</div>
</div>
</div>
</div>
</div>
)
}
export default CostComparison
function splitPrice(template: string) {
const at = template.indexOf("{price}")
if (at < 0) return { before: "", after: template.trim() }
return { before: template.slice(0, at).trim(), after: template.slice(at + 7).trim() }
}
const CSS = `
.cf-cost-comparison{--cfcc-head:color-mix(in oklab,var(--cta) 55%,var(--ink));--cfcc-shadow:var(--shadow,oklch(0.22 0.03 260));box-sizing:border-box;width:100%;max-width:46rem;margin-inline:auto;color:var(--ink);font-family:var(--font-body)}
.cf-cost-comparison *,.cf-cost-comparison *::before,.cf-cost-comparison *::after{box-sizing:border-box}
.cf-cost-comparison .cfcc-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.cf-cost-comparison .cfcc-qa+.cfcc-qa{margin-top:2.75rem}
.cf-cost-comparison .cfcc-line{display:grid;grid-template-columns:3.25rem minmax(0,1fr);column-gap:1rem;align-items:baseline}
.cf-cost-comparison .cfcc-answer{margin-top:1.1rem;align-items:start}
.cf-cost-comparison .cfcc-body{min-width:0}
.cf-cost-comparison .cfcc-mark{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:2.25rem;line-height:1;letter-spacing:-.02em;color:var(--cfcc-head)}
.cf-cost-comparison .cfcc-mark-a{padding-top:.4rem;font-size:1.75rem;color:var(--muted)}
.cf-cost-comparison .cfcc-question{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-.02em);font-size:clamp(1.6rem,3.2vw,2.25rem);line-height:1.1;color:var(--cfcc-head);text-wrap:balance}
.cf-cost-comparison .cfcc-say{margin:0 0 1.25rem;font-size:1.125rem;font-weight:500;line-height:1.55;color:var(--ink);text-wrap:pretty}
.cf-cost-comparison .cfcc-ledger{overflow:hidden;background:var(--card);border:1px solid var(--card-border,color-mix(in oklch,var(--ink) 12%,transparent));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2)))}
.cf-cost-comparison .cfcc-table{width:100%;border-collapse:separate;border-spacing:0;font-variant-numeric:tabular-nums}
.cf-cost-comparison .cfcc-table thead th{padding:.85rem 1.25rem;background:color-mix(in oklch,var(--ink) 6%,var(--card));border-bottom:2px solid oklch(from var(--ink) l c h / .16);font-family:var(--font-display);font-weight:800;font-size:1rem;line-height:1.3;text-align:left;color:var(--ink)}
.cf-cost-comparison .cfcc-table tbody th,.cf-cost-comparison .cfcc-table tfoot th{text-align:left;font-weight:inherit}
.cf-cost-comparison .cfcc-table .cfcc-num{width:1%;white-space:nowrap;text-align:right}
.cf-cost-comparison .cfcc-item>*{padding:1rem 1.25rem;vertical-align:top;border-bottom:1px solid oklch(from var(--ink) l c h / .1);transition:background-color .18s ease}
.cf-cost-comparison .cfcc-item:last-child>*{border-bottom:0}
.cf-cost-comparison .cfcc-item:hover>*{background:color-mix(in oklch,var(--ink) 3%,var(--card))}
.cf-cost-comparison .cfcc-what{display:flex;align-items:flex-start;gap:.9rem;min-width:0}
.cf-cost-comparison .cfcc-thumb{flex:0 0 auto;display:block;width:3.25rem;height:3.25rem;border-radius:.55rem;object-fit:cover;object-position:center;filter:drop-shadow(0 1px 2px oklch(from var(--cfcc-shadow) l c h / .28));transition:transform .2s ease}
.cf-cost-comparison .cfcc-item:hover .cfcc-thumb{transform:translateY(-2px) rotate(-2deg)}
.cf-cost-comparison .cfcc-text{min-width:0}
.cf-cost-comparison .cfcc-name{display:block;font-weight:700;font-size:1.125rem;line-height:1.3;color:var(--ink);text-wrap:balance}
.cf-cost-comparison .cfcc-detail{display:block;margin-top:.25rem;font-size:.9375rem;line-height:1.45;color:var(--muted);text-wrap:pretty}
.cf-cost-comparison .cfcc-value{font-family:var(--font-display);font-weight:800;font-size:1.25rem;line-height:1.3;color:var(--ink)}
.cf-cost-comparison .cfcc-amount{display:inline-block}
.cf-cost-comparison .cfcc-total>*{padding:1.1rem 1.25rem;vertical-align:middle;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-cost-comparison .cfcc-total-label{font-family:var(--font-display);font-weight:800 !important;font-size:1.375rem;line-height:1.2;color:var(--ink)}
.cf-cost-comparison .cfcc-struck{position:relative;display:inline-block;font-family:var(--font-display);font-weight:800;font-size:1.5rem;line-height:1.2;color:var(--muted);text-decoration:none}
.cf-cost-comparison .cfcc-struck::after{content:"";position:absolute;left:-.12em;right:-.12em;top:50%;height:.12em;margin-top:-.06em;border-radius:99px;background:var(--danger);transform:rotate(-8deg);transform-origin:left center}
.cf-cost-comparison .cfcc-today>td{padding:1.35rem 1.25rem 1.4rem;background:color-mix(in oklch,var(--accent-fill,var(--accent)) 9%,var(--card));color:var(--ink)}
.cf-cost-comparison .cfcc-today-line{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;column-gap:.6rem;row-gap:.25rem;font-family:var(--font-display);font-weight:800;line-height:1;text-transform:var(--display-case,none);color:var(--ink)}
.cf-cost-comparison .cfcc-today-price{display:inline-block;font-size:clamp(2.75rem,7vw,4rem);letter-spacing:-.03em;color:var(--ink)}
.cf-cost-comparison .cfcc-today-rest{font-size:clamp(1.35rem,3vw,1.875rem);letter-spacing:-.01em;text-wrap:balance}
.cf-cost-comparison .cfcc-today-note{margin:.8rem 0 0;font-size:1.0625rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-cost-comparison .cfcc-action{display:flex;flex-direction:column;align-items:stretch;max-width:26rem}
.cf-cost-comparison .cfcc-btn{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:.2rem;width:100%;min-height:4.5rem;padding:.85rem 1.5rem;border:1px solid oklch(from var(--button-bg,var(--cta)) calc(l - 0.12) c h);border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(in oklch,oklch(from var(--button-bg,var(--cta)) l c h),var(--button-bg-2,var(--cta-2)));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 6px 14px -4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .38));cursor:pointer;transition:transform .16s ease,background .16s ease,box-shadow .16s ease}
.cf-cost-comparison .cfcc-btn-label{font-size:clamp(1.25rem,2.4vw,1.5rem);font-weight:var(--button-weight,800);line-height:1.15;text-transform:var(--button-case,none);text-wrap:balance}
.cf-cost-comparison .cfcc-btn-sub{font-family:var(--font-body);font-size:.9375rem;font-weight:500;line-height:1.3;text-wrap:pretty}
.cf-cost-comparison .cfcc-btn:hover:not(:disabled):not([aria-disabled="true"]),.cf-cost-comparison[data-state="hover"] .cfcc-btn:not(:disabled):not([aria-disabled="true"]){background:linear-gradient(in oklch,oklch(from var(--button-bg,var(--cta)) calc(l - 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.04) c h));transform:translateY(-1px)}
.cf-cost-comparison .cfcc-btn:active:not(:disabled):not([aria-disabled="true"]),.cf-cost-comparison[data-state="active"] .cfcc-btn:not(:disabled):not([aria-disabled="true"]){background:linear-gradient(in oklch,oklch(from var(--button-bg,var(--cta)) calc(l - 0.08) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.06) c h));transform:translateY(1px);box-shadow:inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.08) c h / .4),inset 0 -1px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)}
.cf-cost-comparison .cfcc-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-cost-comparison .cfcc-btn:disabled,.cf-cost-comparison .cfcc-btn[aria-disabled="true"]{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));border-color:oklch(from var(--ink) l c h / .12);text-shadow:none;box-shadow:none;cursor:not-allowed;transform:none}
.cf-cost-comparison .cfcc-assure{display:flex;align-items:center;justify-content:center;gap:.5rem;margin:.9rem 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-cost-comparison .cfcc-assure svg{flex:0 0 auto;width:1.15rem;height:1.15rem;color:var(--success)}
@keyframes cfcc-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cfcc-strike{from{transform:rotate(-8deg) scaleX(0)}to{transform:rotate(-8deg) scaleX(1)}}
@keyframes cfcc-pop{from{opacity:.82;transform:scale(.94)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:no-preference){
.cf-cost-comparison .cfcc-item .cfcc-what,.cf-cost-comparison .cfcc-item .cfcc-amount{animation:cfcc-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * 70ms + 60ms)}
.cf-cost-comparison .cfcc-struck::after{animation:cfcc-strike .5s .35s cubic-bezier(.6,0,.2,1) both}
.cf-cost-comparison .cfcc-today-price{animation:cfcc-pop .5s .55s cubic-bezier(.2,.7,.2,1) both}
}
@media (max-width:560px){
.cf-cost-comparison .cfcc-qa+.cfcc-qa{margin-top:2.25rem}
.cf-cost-comparison .cfcc-line{grid-template-columns:auto minmax(0,1fr);column-gap:.6rem}
.cf-cost-comparison .cfcc-mark{font-size:1.6rem}
.cf-cost-comparison .cfcc-answer{display:block;margin-top:1rem}
.cf-cost-comparison .cfcc-answer>.cfcc-mark-a{display:none}
.cf-cost-comparison .cfcc-question{font-size:1.5rem}
.cf-cost-comparison .cfcc-table thead th,.cf-cost-comparison .cfcc-item>*,.cf-cost-comparison .cfcc-total>*,.cf-cost-comparison .cfcc-today>td{padding-inline:.9rem}
.cf-cost-comparison .cfcc-table thead th{font-size:.9375rem}
.cf-cost-comparison .cfcc-what{gap:.7rem}
.cf-cost-comparison .cfcc-thumb{width:2.75rem;height:2.75rem}
.cf-cost-comparison .cfcc-name{font-size:1.0625rem}
.cf-cost-comparison .cfcc-detail{font-size:.875rem}
.cf-cost-comparison .cfcc-value{font-size:1.125rem}
.cf-cost-comparison .cfcc-total-label{font-size:1.2rem}
.cf-cost-comparison .cfcc-struck{font-size:1.3rem}
.cf-cost-comparison .cfcc-action{max-width:none}
}
@media (prefers-reduced-motion:reduce){
.cf-cost-comparison .cfcc-btn,.cf-cost-comparison .cfcc-thumb,.cf-cost-comparison .cfcc-item>*{transition:none}
.cf-cost-comparison .cfcc-item:hover .cfcc-thumb{transform:none}
.cf-cost-comparison .cfcc-btn:hover:not(:disabled),.cf-cost-comparison .cfcc-btn:active:not(:disabled),.cf-cost-comparison[data-state] .cfcc-btn{transform:none}
}
`
pieces/content/cost-comparison/specimen.tsx 28 lines
import * as React from "react"
import { CostComparison, type CostComparisonProps } from "../cost-comparison"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled"]
export default function CostComparisonSpecimen({ state = "default" }: { state?: CostComparisonProps["state"] }) {
const sample = defaults.sample
const rows = sample.items.map((item, i) => ({
name: item.name,
detail: item.detail,
value: item.value,
image: slot(`item-${i + 1}`, item.image),
imageAlt: item.imageAlt,
}))
return (
<CostComparison
rows={rows}
totalValue={sample.regularPrice}
price={sample.price}
todayNote={sample.note}
reassurance={sample.guarantee}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
question OptionalCostComparison |
React.ReactNode |
|
answer OptionalCostComparison |
React.ReactNode |
|
columnLabel OptionalCostComparison |
string |
|
valueLabel OptionalCostComparison |
string |
|
rows OptionalCostComparison |
CostComparisonRow[] |
|
totalLabel OptionalCostComparison |
string |
|
totalValue OptionalCostComparison |
string |
|
price OptionalCostComparison |
string |
|
todayLine OptionalCostComparison |
string |
|
todayNote OptionalCostComparison |
string |
|
closeQuestion OptionalCostComparison |
React.ReactNode |
|
closeAnswer OptionalCostComparison |
React.ReactNode |
|
label OptionalCostComparison |
string |
|
sublabel OptionalCostComparison |
string |
|
reassurance OptionalCostComparison |
string |
|
href OptionalCostComparison |
string |
|
onAction OptionalCostComparison |
(event: React.MouseEvent<HTMLElement>) => void |
|
disabled OptionalCostComparison |
boolean |
|
state OptionalCostComparison |
"default" | "hover" | "active" | "disabled" |
|
copy OptionalCostComparison |
{ questionMark?: string; answerMark?: string; tableCaption?: string; totalSr?: string } |
|
className OptionalCostComparison |
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-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-*- 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