Cancel Save 1
Cancellation save block: the member names why they're leaving, the matching save offer (pause, discount or a lighter plan) fans to the front with one keep button, and "Continue cancelling" stays plainly visible underneath.
Use it in a prompt
Use checkout/cancel-save 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/checkout/cancel-save.tsx. - Import it and pass your copy and images (Props tab):
import { CancelSave } from "@/components/funneldna/checkout/cancel-save"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/checkout/cancel-save/component.tsx 790 lines
// layout: card-fan
// Cancellation save block: the member names why they're leaving, the matching save offer (pause, discount or a lighter plan) fans to the front with one keep button, and "Continue cancelling" stays plainly visible underneath.
// Theme: every colour reads the contract tokens. The one documented fixed value is the white glyph inside solid status badges (`--badge-glyph`, #fff fallback), per the status icon badge rule.
// The phone switcher and the disabled keep button sit on the band, so they paint the guaranteed --secondary / --secondary-ink pair instead of --button-2-bg / --button-2-ink. An outline secondary theme (transparent fill, surface ink) would otherwise put dark text on the dark band.
import React from "react";
import { AlertCircle, Check, ShieldCheck, X } from "lucide-react";
export type SaveOfferId = "pause" | "discount" | "downgrade";
export type SaveOfferBase = {
title: string; // card headline: sells the outcome of this option
short: string; // compact name for the phone switcher buttons
chip?: string; // short pill at the top right of the card
price: string; // e.g. "$24": a leading currency symbol is set superscript
priceSuffix?: string; // e.g. "/mo", set small after the figure
priceNote: string; // small line under the price
lead: string; // bold lead-in that opens the paragraph
text: string; // the rest of the paragraph
image?: string; // cut-out graphic on a transparent background (slot item-n)
imageAlt?: string;
action: string; // keep button label while this card is in front
};
export type PauseOffer = SaveOfferBase & {
monthsLegend: string;
months: number[];
monthOne: string; // "{n} month"
monthMany: string; // "{n} months"
actionNoMonths: string; // button label before a length is picked; `action` uses {months}
error: string; // inline error when no length is picked
};
export type DiscountOffer = SaveOfferBase & {
afterNote: string; // what happens after the discount ends
};
export type DowngradeOffer = SaveOfferBase & {
kept: string[];
dropped: string[];
keptLabel: string; // screen-reader prefix for kept rows
droppedLabel: string; // screen-reader prefix for dropped rows
};
export type CancelReason = {
id: string;
label: string;
offer?: SaveOfferId; // the save offer this reason brings to the front
};
export type CancelSaveChoice = {
offer: SaveOfferId;
months?: number;
reason?: string;
};
export type CancelSaveProps = {
headline?: React.ReactNode;
leadIn?: string; // bold lead-in of the subhead
lead?: string;
reasonLegend?: string;
reasons?: CancelReason[];
matchLine?: string; // "Matched to “{reason}”"
idleLine?: string;
faceHint?: string; // label on the fanned-back cards
otherLabel?: string; // phone switcher label
pause?: Partial<PauseOffer>;
discount?: Partial<DiscountOffer>;
downgrade?: Partial<DowngradeOffer>;
initialOffer?: SaveOfferId;
reassurance?: string;
cancelPrompt?: string;
cancelLabel?: string;
cancelHref?: string; // where "Continue cancelling" goes
disabled?: boolean;
onAction?: (choice: CancelSaveChoice) => void; // keep button
onCancel?: (choice: { reason?: string }) => void; // continue cancelling
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
const ORDER: SaveOfferId[] = ["pause", "discount", "downgrade"];
const DEFAULT_REASONS: CancelReason[] = [
{ id: "busy", label: "I'm too busy right now", offer: "pause" },
{ id: "cost", label: "It costs too much right now", offer: "discount" },
{ id: "usage", label: "I'm not using all of it", offer: "downgrade" },
{ id: "other", label: "Something else" },
];
const DEFAULT_PAUSE: PauseOffer = {
title: "Pause your plan, keep your work",
short: "Pause my plan",
chip: "Up to 3 months",
price: "$0",
priceNote: "while paused, then back to $47/mo",
lead: "Nothing is lost.",
text: "Your funnels, pages and saved copy stay exactly where you left them.",
action: "Pause My Plan For {months}",
actionNoMonths: "Pause My Plan",
monthsLegend: "Pause for how long?",
months: [1, 2, 3],
monthOne: "{n} month",
monthMany: "{n} months",
error: "Choose 1, 2 or 3 months to pause.",
};
const DEFAULT_DISCOUNT: DiscountOffer = {
title: "Stay for half price",
short: "Half price",
chip: "Next 3 months",
price: "$24",
priceSuffix: "/mo",
priceNote: "for your next 3 months",
lead: "Same plan, smaller bill.",
text: "Keep every template and tool you use today.",
action: "Keep My Plan At $24/mo",
afterNote: "Then $47/mo. No new contract, cancel anytime.",
};
const DEFAULT_DOWNGRADE: DowngradeOffer = {
title: "Switch to the Lite plan",
short: "Lite plan",
chip: "Lighter plan",
price: "$19",
priceSuffix: "/mo",
priceNote: "billed monthly, upgrade anytime",
lead: "Keep the essentials.",
text: "Pay only for the parts you actually open.",
action: "Switch To Lite At $19/mo",
kept: ["Your saved funnels and pages", "Core page templates"],
dropped: ["Advanced automations"],
keptLabel: "Included",
droppedLabel: "Not included",
};
export function CancelSave(props: CancelSaveProps) {
const {
headline = "Before you go, let's find a plan that fits",
leadIn = "Tell us why you're leaving.",
lead = "The option that fixes it moves to the front. If none fit, cancelling is one link away.",
reasonLegend = "What's the main reason?",
reasons = DEFAULT_REASONS,
matchLine = "Matched to “{reason}”",
idleLine = "Pick a reason and the option that fits moves to the front.",
faceHint = "See this option",
otherLabel = "Other ways to stay",
initialOffer = "discount",
reassurance = "Change or cancel anytime from your account.",
cancelPrompt = "Still want to leave?",
cancelLabel = "Continue cancelling",
cancelHref,
disabled = false,
onAction,
onCancel,
state = "default",
className,
} = props;
const pause: PauseOffer = { ...DEFAULT_PAUSE, ...props.pause };
const discount: DiscountOffer = { ...DEFAULT_DISCOUNT, ...props.discount };
const downgrade: DowngradeOffer = { ...DEFAULT_DOWNGRADE, ...props.downgrade };
const offers: Record<SaveOfferId, SaveOfferBase> = { pause, discount, downgrade };
const uid = React.useId();
const errId = `${uid}-err`;
const [active, setActive] = React.useState<SaveOfferId>(state === "error" ? "pause" : initialOffer);
const [reasonId, setReasonId] = React.useState<string | null>(null);
const [months, setMonths] = React.useState<number | null>(null);
const [showError, setShowError] = React.useState(state === "error");
const firstMonth = React.useRef<HTMLInputElement>(null);
React.useEffect(() => {
if (state === "error") {
setActive("pause");
setMonths(null);
setShowError(true);
} else {
setShowError(false);
}
}, [state]);
const isDisabled = disabled || state === "disabled";
const reason = reasons.find((r) => r.id === reasonId);
const matched = Boolean(reason && reason.offer === active);
const monthText = (n: number) => fill(n === 1 ? pause.monthOne : pause.monthMany, { n: String(n) });
const show = (id: SaveOfferId) => {
setActive(id);
setShowError(false);
};
const pickReason = (r: CancelReason) => {
setReasonId(r.id);
if (r.offer) show(r.offer);
};
const keep = () => {
if (isDisabled) return;
if (active === "pause" && months == null) {
setShowError(true);
firstMonth.current?.focus();
return;
}
onAction?.({ offer: active, months: active === "pause" ? months ?? undefined : undefined, reason: reason?.label });
};
const keepLabel =
active === "pause"
? months == null
? pause.actionNoMonths
: fill(pause.action, { months: monthText(months) })
: offers[active].action;
const ai = ORDER.indexOf(active);
const posOf = (id: SaveOfferId) => {
const i = ORDER.indexOf(id);
return i === ai ? "front" : i === (ai + 1) % ORDER.length ? "right" : "left";
};
const [matchBefore, matchAfter] = matchLine.split("{reason}");
const renderDetail = (id: SaveOfferId) => {
if (id === "pause") {
return (
<fieldset className="cfcs-well cfcs-months">
<legend className="cfcs-mlegend">{pause.monthsLegend}</legend>
<div className="cfcs-seg">
{pause.months.map((n, i) => (
<label key={n} className="cfcs-mo" data-on={months === n || undefined} data-invalid={showError || undefined}>
<input
ref={i === 0 ? firstMonth : undefined}
type="radio"
className="cfcs-sr cfcs-radio"
name={`${uid}-months`}
value={n}
checked={months === n}
onChange={() => {
setMonths(n);
setShowError(false);
}}
aria-invalid={showError || undefined}
aria-describedby={showError ? errId : undefined}
/>
{monthText(n)}
</label>
))}
</div>
{showError && (
<p id={errId} className="cfcs-err" role="alert">
<AlertCircle className="cfcs-inl" size={16} strokeWidth={2.5} aria-hidden="true" />
{pause.error}
</p>
)}
</fieldset>
);
}
if (id === "discount") {
return <p className="cfcs-well cfcs-after">{discount.afterNote}</p>;
}
return (
<ul className="cfcs-well cfcs-list">
{downgrade.kept.map((t) => (
<li key={`k-${t}`}>
<span className="cfcs-badge" data-kind="yes" aria-hidden="true">
<Check size={14} strokeWidth={3} />
</span>
<span>
<span className="cfcs-sr">{downgrade.keptLabel}: </span>
{t}
</span>
</li>
))}
{downgrade.dropped.map((t) => (
<li key={`d-${t}`}>
<span className="cfcs-badge" data-kind="no" aria-hidden="true">
<X size={14} strokeWidth={3} />
</span>
<span>
<span className="cfcs-sr">{downgrade.droppedLabel}: </span>
{t}
</span>
</li>
))}
</ul>
);
};
return (
<section className={["cf-cancel-save", className].filter(Boolean).join(" ")} aria-labelledby={`${uid}-h`}>
<style>{CSS}</style>
<div className="cfcs-wrap">
<header className="cfcs-head">
<h2 id={`${uid}-h`} className="cfcs-h2">
{headline}
</h2>
<p className="cfcs-lead">
<strong>{leadIn}</strong> {lead}
</p>
</header>
<fieldset className="cfcs-reasons">
<legend className="cfcs-legend">{reasonLegend}</legend>
<div className="cfcs-pills">
{reasons.map((r) => {
const on = r.id === reasonId;
return (
<label key={r.id} className="cfcs-pill" data-on={on || undefined}>
<input
type="radio"
className="cfcs-sr cfcs-radio"
name={`${uid}-reason`}
value={r.id}
checked={on}
onChange={() => pickReason(r)}
/>
<span className="cfcs-dot" aria-hidden="true">
<Check size={14} strokeWidth={3} />
</span>
<span>{r.label}</span>
</label>
);
})}
</div>
</fieldset>
<p className="cfcs-match" aria-live="polite">
{matched && reason ? (
<>
{matchBefore}
<strong>{reason.label}</strong>
{matchAfter}
</>
) : (
idleLine
)}
</p>
<div className="cfcs-fan">
{ORDER.map((id) => {
const o = offers[id];
const pos = posOf(id);
const { symbol, amount } = splitPrice(o.price);
return (
<div key={id} className="cfcs-card" data-pos={pos} data-offer={id}>
<div className="cfcs-body">
<div className="cfcs-top">
{o.image ? <img className="cfcs-img" src={o.image} alt={o.imageAlt ?? ""} width={84} height={84} /> : <span />}
{o.chip && <span className="cfcs-chip">{o.chip}</span>}
</div>
<h3 className="cfcs-title">{o.title}</h3>
<div className="cfcs-price">
<p className="cfcs-figure">
{symbol && <span className="cfcs-cur">{symbol}</span>}
<span>{amount}</span>
{o.priceSuffix && <span className="cfcs-suffix">{o.priceSuffix}</span>}
</p>
<p className="cfcs-note">{o.priceNote}</p>
</div>
<p className="cfcs-copy">
<strong>{o.lead}</strong> {o.text}
</p>
<div className="cfcs-detail">{renderDetail(id)}</div>
</div>
<button type="button" className="cfcs-face" onClick={() => show(id)} aria-label={`${faceHint}: ${o.title}`}>
<span className="cfcs-face-in">
{o.image && <img className="cfcs-img" src={o.image} alt="" width={84} height={84} />}
<span className="cfcs-ftitle">{o.title}</span>
<span className="cfcs-fhint">{faceHint}</span>
</span>
</button>
</div>
);
})}
</div>
<div className="cfcs-switch">
<p className="cfcs-swlabel">{otherLabel}</p>
<div className="cfcs-swrow">
{ORDER.filter((id) => id !== active).map((id) => (
<button key={id} type="button" className="cfcs-swbtn" onClick={() => show(id)}>
{offers[id].short}
</button>
))}
</div>
</div>
<div className="cfcs-act">
<button
type="button"
className="cfcs-keep"
data-force={state === "hover" || state === "active" ? state : undefined}
disabled={isDisabled}
onClick={keep}
aria-describedby={showError && active === "pause" ? errId : undefined}
>
{keepLabel}
</button>
<p className="cfcs-reassure">
<ShieldCheck className="cfcs-inl" size={16} strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
<p className="cfcs-cancel">
{cancelPrompt}{" "}
<a
className="cfcs-cancel-link"
href={cancelHref ?? "#"}
onClick={(e) => {
if (!cancelHref) e.preventDefault();
onCancel?.({ reason: reason?.label });
}}
>
{cancelLabel}
</a>
</p>
</div>
</div>
</section>
);
}
export default CancelSave;
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((s, k) => s.split(`{${k}}`).join(vars[k]), template);
}
function splitPrice(price: string) {
let i = 0;
while (i < price.length && !"0123456789".includes(price[i])) i++;
return { symbol: price.slice(0, i).trim(), amount: price.slice(i) };
}
const CSS = `
.cf-cancel-save{
--cs-b: var(--band, oklch(0.27 0.067 256));
--cs-bi: var(--band-ink, oklch(1 0 0));
--cs-soft: color-mix(in oklch, var(--cs-bi) 82%, var(--cs-b));
--cs-sh: var(--shadow, oklch(0.22 0.03 256));
--cs-btn: var(--button-bg, var(--cta, oklch(0.58 0.21 29)));
--cs-btn2: var(--button-bg-2, var(--cta-2, oklch(0.51 0.21 29)));
--cs-sec: var(--secondary, oklch(0.93 0.015 263));
--cs-sec-ink: var(--secondary-ink, oklch(0.21 0.034 263));
--cs-card-w: 100%;
position: relative;
isolation: isolate;
overflow: hidden;
background: var(--cs-b);
color: var(--cs-bi);
font-family: var(--font-body, system-ui, sans-serif);
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
}
.cf-cancel-save *, .cf-cancel-save *::before, .cf-cancel-save *::after{ box-sizing: border-box; }
.cf-cancel-save .cfcs-wrap{ max-width: 1120px; margin: 0 auto; text-align: center; }
.cf-cancel-save .cfcs-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-cancel-save .cfcs-radio{ accent-color: var(--field-focus, var(--accent, oklch(0.5 0.17 257))); }
.cf-cancel-save .cfcs-inl{ display: inline-block; vertical-align: -0.15em; margin-inline-end: .4em; }
.cf-cancel-save .cfcs-head{ max-width: 46rem; margin: 0 auto; }
.cf-cancel-save .cfcs-h2{
margin: 0 0 16px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.025em);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
text-wrap: balance;
color: var(--cs-bi);
}
.cf-cancel-save .cfcs-lead{
margin: 0 auto;
max-width: 40rem;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.4;
font-weight: 500;
color: var(--cs-soft);
text-wrap: pretty;
}
.cf-cancel-save .cfcs-lead strong{ color: var(--cs-bi); font-weight: 800; }
.cf-cancel-save .cfcs-reasons{ border: 0; padding: 0; min-width: 0; margin: 32px auto 0; max-width: 1040px; }
.cf-cancel-save .cfcs-legend{ padding: 0; margin: 0 auto 12px; font-size: 1.0625rem; font-weight: 700; color: var(--cs-bi); }
.cf-cancel-save .cfcs-pills{ display: grid; grid-template-columns: 1fr; gap: 8px; }
.cf-cancel-save .cfcs-pill{
position: relative;
display: flex;
align-items: center;
gap: 12px;
min-height: 52px;
padding: 0 20px 0 14px;
border-radius: 999px;
border: 1px solid oklch(from var(--cs-bi) l c h / .24);
background: oklch(from var(--cs-bi) l c h / .08);
color: var(--cs-bi);
font-size: 1.0625rem;
font-weight: 600;
line-height: 1.25;
text-align: start;
cursor: pointer;
transition: background .16s ease, color .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.cf-cancel-save .cfcs-pill:not([data-on]):hover{ background: oklch(from var(--cs-bi) l c h / .15); }
.cf-cancel-save .cfcs-pill[data-on]{ background: var(--card, oklch(1 0 0)); color: var(--ink, oklch(0.21 0.034 263)); border-color: transparent; box-shadow: var(--shadow-sm, 0 1px 3px oklch(from var(--cs-sh) l c h / .3)); }
.cf-cancel-save .cfcs-pill:has(input:focus-visible){ outline: 3px solid var(--cs-bi); outline-offset: 3px; }
.cf-cancel-save .cfcs-dot{
flex: none;
display: inline-grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 999px;
border: 2px solid oklch(from var(--cs-bi) l c h / .55);
color: transparent;
transition: background .16s ease, border-color .16s ease;
}
.cf-cancel-save .cfcs-pill[data-on] .cfcs-dot{
background: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
border-color: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
color: var(--accent-fill-ink, var(--card, oklch(1 0 0)));
}
.cf-cancel-save .cfcs-match{ margin: 24px auto 0; min-height: 1.4em; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--cs-soft); text-wrap: pretty; }
.cf-cancel-save .cfcs-match strong{ color: var(--cs-bi); font-weight: 800; }
.cf-cancel-save .cfcs-fan{
display: grid;
grid-template-columns: minmax(0, 520px);
justify-content: center;
margin: 16px auto 0;
padding-bottom: 28px;
}
.cf-cancel-save .cfcs-card{
grid-area: 1 / 1;
position: relative;
width: var(--cs-card-w);
display: flex;
flex-direction: column;
text-align: start;
background: var(--card, oklch(1 0 0));
color: var(--ink, oklch(0.21 0.034 263));
border: 1px solid var(--card-border, oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / .12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--cs-sh) l c h / .22), 0 4px 10px -2px oklch(from var(--cs-sh) l c h / .2)));
transform-origin: 50% 100%;
transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.cf-cancel-save .cfcs-card[data-pos=front]{
z-index: 3;
transform: none;
border-color: color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 40%, var(--card, oklch(1 0 0)));
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--cs-sh) l c h / .22), 0 12px 24px -8px oklch(from var(--cs-sh) l c h / .32));
}
.cf-cancel-save .cfcs-card[data-pos=right]{ z-index: 2; transform: translateY(14px) scale(.95); }
.cf-cancel-save .cfcs-card[data-pos=left]{ z-index: 1; transform: translateY(28px) scale(.9); }
.cf-cancel-save .cfcs-body{
flex: 1;
display: flex;
flex-direction: column;
padding: clamp(20px, 3vw, 32px);
}
.cf-cancel-save .cfcs-card:not([data-pos=front]) .cfcs-body{ display: none; }
.cf-cancel-save .cfcs-card[data-pos=front] .cfcs-body{ animation: cfcs-swap .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes cfcs-swap{ from{ opacity: .2; transform: translateY(6px); } to{ opacity: 1; transform: none; } }
.cf-cancel-save .cfcs-top{ display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.cf-cancel-save .cfcs-img{
display: block;
width: 84px;
height: 84px;
object-fit: contain;
border-radius: 0;
filter: drop-shadow(0 2px 3px oklch(from var(--cs-sh) l c h / .3)) drop-shadow(0 10px 12px oklch(from var(--cs-sh) l c h / .16));
}
.cf-cancel-save .cfcs-chip{
display: inline-flex;
align-items: center;
min-height: 30px;
padding: 4px 12px;
border-radius: 999px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 6%, var(--card, oklch(1 0 0)));
color: var(--ink, oklch(0.21 0.034 263));
font-size: .875rem;
font-weight: 800;
line-height: 1.2;
white-space: nowrap;
}
.cf-cancel-save .cfcs-title{
margin: 0 0 16px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
}
.cf-cancel-save .cfcs-figure{
margin: 0;
display: flex;
align-items: flex-start;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: clamp(2.5rem, 4.2vw, 3.75rem);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;
color: var(--ink, oklch(0.21 0.034 263));
}
.cf-cancel-save .cfcs-cur{ font-size: .45em; line-height: 1; margin: .1em .05em 0 0; letter-spacing: 0; }
.cf-cancel-save .cfcs-suffix{ align-self: flex-end; margin: 0 0 .28em .14em; font-size: .34em; font-weight: 700; letter-spacing: 0; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-cancel-save .cfcs-note{ margin: 20px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--muted, oklch(0.45 0.03 258)); text-wrap: pretty; }
.cf-cancel-save .cfcs-copy{ margin: 20px 0 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--muted, oklch(0.45 0.03 258)); text-wrap: pretty; }
.cf-cancel-save .cfcs-copy strong{ color: var(--ink, oklch(0.21 0.034 263)); font-weight: 800; }
.cf-cancel-save .cfcs-detail{ margin-top: 24px; }
.cf-cancel-save .cfcs-well{
margin: 0;
padding: 14px 16px;
border: 0;
border-radius: 10px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 4%, var(--card, oklch(1 0 0)));
min-width: 0;
}
.cf-cancel-save .cfcs-after{ font-size: 1rem; line-height: 1.45; font-weight: 600; color: var(--ink, oklch(0.21 0.034 263)); text-wrap: pretty; }
.cf-cancel-save .cfcs-list{ list-style: none; display: grid; gap: 10px; }
.cf-cancel-save .cfcs-list li{ display: flex; align-items: flex-start; gap: 10px; font-size: 1rem; line-height: 1.4; font-weight: 600; color: var(--ink, oklch(0.21 0.034 263)); }
.cf-cancel-save .cfcs-badge{ flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; color: var(--badge-glyph, #fff); }
.cf-cancel-save .cfcs-badge[data-kind=yes]{ background: var(--success, oklch(0.5 0.14 150)); }
.cf-cancel-save .cfcs-badge[data-kind=no]{ background: var(--danger, oklch(0.5 0.17 27)); }
.cf-cancel-save .cfcs-mlegend{ float: left; width: 100%; padding: 0; margin: 0 0 10px; font-size: .9375rem; font-weight: 700; color: var(--label-ink, var(--ink, oklch(0.21 0.034 263))); }
.cf-cancel-save .cfcs-seg{ clear: both; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cf-cancel-save .cfcs-mo{
position: relative;
display: flex;
align-items: center;
justify-content: center;
min-height: 48px;
padding: 0 8px;
border-radius: 10px;
border: 1px solid var(--field-border, oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / .18));
color: var(--ink, oklch(0.21 0.034 263));
font-size: 1rem;
font-weight: 700;
white-space: nowrap;
cursor: pointer;
transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.cf-cancel-save .cfcs-mo:hover{ border-color: oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / .34); }
.cf-cancel-save .cfcs-mo[data-on]{
background: color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 12%, var(--card, oklch(1 0 0)));
border-color: var(--accent, oklch(0.5 0.17 257));
box-shadow: var(--shadow-sm, 0 1px 3px oklch(from var(--cs-sh) l c h / .3));
}
.cf-cancel-save .cfcs-mo[data-invalid]{ border-color: var(--danger, oklch(0.5 0.17 27)); }
.cf-cancel-save .cfcs-mo:has(input:focus-visible){ box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent, oklch(0.5 0.17 257))) l c h / .4); border-color: var(--field-focus, var(--accent, oklch(0.5 0.17 257))); }
.cf-cancel-save .cfcs-err{ margin: 10px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--danger, oklch(0.5 0.17 27)); text-wrap: pretty; }
.cf-cancel-save .cfcs-face{
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
padding: clamp(20px, 3vw, 32px);
border: 0;
border-radius: inherit;
background: transparent;
color: var(--ink, oklch(0.21 0.034 263));
font: inherit;
font-family: var(--button-font, var(--font-body, system-ui, sans-serif));
text-align: start;
cursor: pointer;
visibility: hidden;
opacity: 0;
transition: opacity .2s ease, visibility 0s linear .2s;
}
.cf-cancel-save .cfcs-face:focus-visible{ outline: 3px solid var(--cs-bi); outline-offset: 4px; }
.cf-cancel-save .cfcs-face-in{ display: flex; flex-direction: column; align-items: flex-start; gap: 12px; width: 62%; }
.cf-cancel-save .cfcs-card[data-pos=right] .cfcs-face-in{ margin-inline-start: auto; align-items: flex-end; text-align: end; }
.cf-cancel-save .cfcs-ftitle{ font-family: var(--font-display, inherit); font-weight: var(--display-weight, 800); font-size: 1.25rem; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.cf-cancel-save .cfcs-fhint{ font-size: .9375rem; font-weight: 700; color: var(--link, var(--accent, oklch(0.5 0.17 257))); text-decoration: underline; text-decoration-color: oklch(from var(--link, var(--accent, oklch(0.5 0.17 257))) l c h / .45); text-underline-offset: .18em; }
.cf-cancel-save .cfcs-switch{ margin-top: 20px; }
.cf-cancel-save .cfcs-swlabel{ margin: 0 0 8px; font-size: .9375rem; font-weight: 600; color: var(--cs-soft); }
.cf-cancel-save .cfcs-swrow{ display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cf-cancel-save .cfcs-swbtn{
min-height: 48px;
padding: 0 20px;
border-radius: var(--button-radius, var(--radius, 12px));
border: 1px solid var(--button-2-border, transparent);
background: var(--cs-sec);
color: var(--cs-sec-ink);
box-shadow: var(--button-2-shadow, var(--shadow-sm, 0 1px 3px oklch(from var(--cs-sh) l c h / .3)));
font-family: var(--button-font, var(--font-display, inherit));
font-weight: var(--button-weight, 700);
font-size: 1rem;
text-transform: var(--button-case, none);
cursor: pointer;
transition: background .16s ease, transform .16s ease;
}
.cf-cancel-save .cfcs-swbtn:hover{ background: oklch(from var(--cs-sec) calc(l - .04) c h); }
.cf-cancel-save .cfcs-swbtn:active{ transform: translateY(1px); }
.cf-cancel-save .cfcs-swbtn:focus-visible{ outline: 3px solid var(--cs-bi); outline-offset: 3px; }
.cf-cancel-save .cfcs-act{ margin-top: 32px; display: flex; flex-direction: column; align-items: center; }
.cf-cancel-save .cfcs-keep{
width: min(100%, 460px);
min-height: 72px;
padding: 12px 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;
text-wrap: balance;
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--cs-btn) calc(l + .04) c h), oklch(from var(--cs-btn2) calc(l - .02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cs-btn) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--cs-btn) calc(l - .16) c h), 0 1px 2px oklch(from var(--cs-sh) l c h / .4), 0 8px 16px -6px oklch(from var(--cs-sh) l c h / .55));
cursor: pointer;
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-cancel-save .cfcs-keep:hover:not(:disabled), .cf-cancel-save .cfcs-keep[data-force=hover]{
transform: translateY(-1px);
background: linear-gradient(oklch(from var(--cs-btn) calc(l - .01) c h), oklch(from var(--cs-btn2) calc(l - .07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--cs-btn) calc(l + .12) c h / .7), inset 0 -3px 0 oklch(from var(--cs-btn) calc(l - .2) c h), 0 1px 2px oklch(from var(--cs-sh) l c h / .45), 0 10px 18px -6px oklch(from var(--cs-sh) l c h / .62));
}
.cf-cancel-save .cfcs-keep:active:not(:disabled), .cf-cancel-save .cfcs-keep[data-force=active]{
transform: translateY(1px);
background: linear-gradient(oklch(from var(--cs-btn) calc(l - .04) c h), oklch(from var(--cs-btn2) calc(l - .08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--cs-btn) calc(l - .22) c h / .55), inset 0 -2px 0 oklch(from var(--cs-btn) calc(l - .16) c h), 0 1px 1px oklch(from var(--cs-sh) l c h / .4);
}
.cf-cancel-save .cfcs-keep:focus-visible{ outline: 3px solid var(--cs-bi); outline-offset: 3px; }
.cf-cancel-save .cfcs-keep:disabled{
cursor: not-allowed;
transform: none;
background: var(--cs-sec);
color: var(--cs-sec-ink);
text-shadow: none;
box-shadow: none;
}
.cf-cancel-save .cfcs-reassure{ margin: 16px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 500; color: var(--cs-soft); text-wrap: pretty; }
.cf-cancel-save .cfcs-cancel{ margin: 16px 0 0; font-size: 1.0625rem; line-height: 1.4; font-weight: 500; color: var(--cs-soft); text-wrap: pretty; }
.cf-cancel-save .cfcs-cancel-link{
display: inline-block;
padding: 10px 2px;
color: var(--cs-bi);
font-weight: 700;
text-decoration: underline;
text-decoration-thickness: 1.5px;
text-decoration-color: oklch(from var(--cs-bi) l c h / .55);
text-underline-offset: .18em;
}
.cf-cancel-save .cfcs-cancel-link:hover{ text-decoration-color: var(--cs-bi); }
.cf-cancel-save .cfcs-cancel-link:focus-visible{ outline: 3px solid var(--cs-bi); outline-offset: 2px; border-radius: 4px; }
@keyframes cfcs-rise{ from{ opacity: .82; transform: translateY(8px); } to{ opacity: 1; transform: none; } }
.cf-cancel-save .cfcs-head, .cf-cancel-save .cfcs-reasons, .cf-cancel-save .cfcs-fan, .cf-cancel-save .cfcs-act{ animation: cfcs-rise .45s cubic-bezier(.2,.7,.2,1) both; }
.cf-cancel-save .cfcs-reasons{ animation-delay: .07s; }
.cf-cancel-save .cfcs-fan{ animation-delay: .14s; }
.cf-cancel-save .cfcs-act{ animation-delay: .21s; }
@media (min-width: 640px){
.cf-cancel-save .cfcs-pills{ display: flex; flex-wrap: wrap; justify-content: center; }
.cf-cancel-save .cfcs-pill{ display: inline-flex; }
}
@media (min-width: 880px){
.cf-cancel-save{ --cs-card-w: clamp(320px, 31vw, 372px); }
.cf-cancel-save .cfcs-fan{ grid-template-columns: var(--cs-card-w); margin-top: 24px; padding-bottom: 40px; }
.cf-cancel-save .cfcs-card{ transform-origin: 50% 50%; }
.cf-cancel-save .cfcs-card[data-pos=left]{ z-index: 1; transform: translateX(-66%) translateY(26px) rotate(-6deg) scale(.9); }
.cf-cancel-save .cfcs-card[data-pos=right]{ z-index: 1; transform: translateX(66%) translateY(26px) rotate(6deg) scale(.9); }
.cf-cancel-save .cfcs-card:not([data-pos=front]) .cfcs-face{ visibility: visible; opacity: 1; transition: opacity .3s ease .12s, visibility 0s; }
.cf-cancel-save .cfcs-switch{ display: none; }
}
@media (min-width: 880px) and (hover: hover){
.cf-cancel-save .cfcs-card[data-pos=left]:hover{ transform: translateX(-68%) translateY(16px) rotate(-7deg) scale(.9); }
.cf-cancel-save .cfcs-card[data-pos=right]:hover{ transform: translateX(68%) translateY(16px) rotate(7deg) scale(.9); }
}
@media (prefers-reduced-motion: reduce){
.cf-cancel-save .cfcs-head, .cf-cancel-save .cfcs-reasons, .cf-cancel-save .cfcs-fan, .cf-cancel-save .cfcs-act, .cf-cancel-save .cfcs-card[data-pos=front] .cfcs-body{ animation: none; }
.cf-cancel-save .cfcs-card, .cf-cancel-save .cfcs-card[data-pos=front] .cfcs-body, .cf-cancel-save .cfcs-card:not([data-pos=front]) .cfcs-body, .cf-cancel-save .cfcs-face, .cf-cancel-save .cfcs-card:not([data-pos=front]) .cfcs-face, .cf-cancel-save .cfcs-pill, .cf-cancel-save .cfcs-dot, .cf-cancel-save .cfcs-mo, .cf-cancel-save .cfcs-keep, .cf-cancel-save .cfcs-swbtn{ transition: none; }
.cf-cancel-save .cfcs-keep:hover:not(:disabled), .cf-cancel-save .cfcs-keep[data-force=hover], .cf-cancel-save .cfcs-keep:active:not(:disabled), .cf-cancel-save .cfcs-keep[data-force=active]{ transform: none; }
}
`;
pieces/checkout/cancel-save/specimen.tsx 36 lines
import __studioImage1a30e7c5 from "../assets/f4eb47ad3b98a6df.webp";
import __studioImage867e853e from "../assets/8682923736e49526.webp";
import __studioImage0b0bd505 from "../assets/a0ca78a3bc82d7b7.webp";
import React from "react";
import { CancelSave, type CancelSaveProps } from "../cancel-save";
import defaults from "../../studio-defaults.json";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function CancelSaveSpecimen({ state }: { state?: CancelSaveProps["state"] }) {
const s = defaults.sample;
return (
<CancelSave
state={state}
headline="Before you go, let's find a plan that fits"
leadIn="Tell us why you're leaving."
lead="The option that fixes it moves to the front. If none fit, cancelling is one link away."
pause={{
image: slot("item-1", __studioImage1a30e7c5),
imageAlt: "Hourglass",
priceNote: `while paused, then back to ${s.price}/mo`,
}}
discount={{
image: slot("item-2", __studioImage867e853e),
imageAlt: "Price tag",
afterNote: `Then ${s.price}/mo. No new contract, cancel anytime.`,
}}
downgrade={{
image: slot("item-3", __studioImage0b0bd505),
imageAlt: "Feather",
text: `Pay only for the parts of ${s.name} you actually open.`,
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCancelSave |
React.ReactNode |
|
leadIn OptionalCancelSave |
string |
|
lead OptionalCancelSave |
string |
|
reasonLegend OptionalCancelSave |
string |
|
reasons OptionalCancelSave |
CancelReason[] |
|
matchLine OptionalCancelSave |
string |
|
idleLine OptionalCancelSave |
string |
|
faceHint OptionalCancelSave |
string |
|
otherLabel OptionalCancelSave |
string |
|
pause OptionalCancelSave |
Partial<PauseOffer> |
|
discount OptionalCancelSave |
Partial<DiscountOffer> |
|
downgrade OptionalCancelSave |
Partial<DowngradeOffer> |
|
initialOffer OptionalCancelSave |
SaveOfferId |
|
reassurance OptionalCancelSave |
string |
|
cancelPrompt OptionalCancelSave |
string |
|
cancelLabel OptionalCancelSave |
string |
|
cancelHref OptionalCancelSave |
string |
|
disabled OptionalCancelSave |
boolean |
|
onAction OptionalCancelSave |
(choice: CancelSaveChoice) => void |
|
onCancel OptionalCancelSave |
(choice: { reason?: string }) => void |
|
state OptionalCancelSave |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalCancelSave |
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-border--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-border--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.
-
8682923736e49526.webp
image/webp · 145 KB
-
a0ca78a3bc82d7b7.webp
image/webp · 263 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f4eb47ad3b98a6df.webp
image/webp · 113 KB