Subscribe Save 3
Subscribe & save as a delivery route: choose a rhythm and every delivery slides onto its date across the first
Use it in a prompt
Use offer/subscribe-save-3 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/offer/subscribe-save-3.tsx. - Import it and pass your copy and images (Props tab):
import { SubscribeSave3 } from "@/components/funneldna/offer/subscribe-save-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/subscribe-save-3/component.tsx 648 lines
// layout: route-map
// Subscribe & save as a delivery route: choose a rhythm and every delivery slides onto its date across the first
// weeks. Shows the per-delivery price, the saving computed from the supplied prices and one subscribe action.
import * as React from 'react';
import { CalendarCheck, Package } from 'lucide-react';
import { Divider, FX_HOST, Spot } from '../fx/fx';
import calendarSpot from '../fx/spots/calendar';
import savingsSpot from '../fx/spots/savings';
import truckSpot from '../fx/spots/truck';
type DividerTone = React.ComponentProps<typeof Divider>['tone'];
export type SubscribeSave3Cadence = {
/** Stable id. Defaults to the number of weeks as a string. */
id?: string;
/** Weeks between deliveries. */
weeks: number;
/** Segment title. Defaults to copy.cadenceLabel. */
label?: string;
/** Subscription price per delivery for this rhythm. Falls back to props.price. */
price?: number;
};
export type SubscribeSave3Reason = {
/** Bold lead-in sentence. */
title: React.ReactNode;
text?: React.ReactNode;
/** Imported fx spot, e.g. import truck from '../fx/spots/truck'. */
spot?: string;
};
export type SubscribeSave3Delivery = {
/** 1-based delivery number. */
n: number;
/** 1-based week the delivery lands in. */
week: number;
/** YYYY-MM-DD, only when a start date is supplied. */
date?: string;
};
export type SubscribeSave3Detail = {
/** id of the chosen rhythm. */
cadence: string;
everyWeeks: number;
deliveries: SubscribeSave3Delivery[];
/** Price per delivery, when a price is supplied. */
price?: number;
/** Price of every delivery shown on the route. */
total?: number;
oneTimePrice?: number;
currency: string;
};
export type SubscribeSave3Copy = {
/** Heading of the rhythm picker. */
legend: string;
/** {weeks} */
cadenceLabel: string;
cadenceLabelOne: string;
/** {weeks}, used in the button note. */
cadenceShort: string;
cadenceShortOne: string;
/** Segment sub-line: {count} {deliveries} in the weeks shown. */
cadenceCount: string;
/** Singular delivery noun used inside other templates. */
delivery: string;
/** Plural delivery noun used inside other templates. */
deliveries: string;
/** Capitalised delivery noun for list rows. */
deliveryTitle: string;
/** {item} {n} */
itemLabel: string;
/** Stop label when no start date is supplied: {n} */
weekLabel: string;
/** Week scale under the route: {n} */
weekTick: string;
/** Word before the price. */
priceLead: string;
/** {item} */
priceUnit: string;
/** {saving} {item} */
saving: string;
/** {weeks} */
routeLabel: string;
/** {count} {deliveries} {total} {weeks} */
totalLine: string;
/** {count} {deliveries} {weeks} */
totalLineNoPrice: string;
/** {saving} */
totalSaving: string;
/** {Count} is the number of reasons in words. */
reasonsHeading: string;
reasonsHeadingOne: string;
/** Number words for {Count}, starting at one. */
countWords: string[];
/** {date} of the first delivery. */
actionNote: string;
/** {cadence} */
actionNoteNoDate: string;
/** Screen-reader update: {count} {deliveries} {weeks} {cadence} */
live: string;
};
export type SubscribeSave3Props = {
headline?: React.ReactNode;
/** Phrase inside a string headline set in the accent colour. */
headlineHighlight?: string;
lead?: React.ReactNode;
/** product slot: transparent cut-out of the product. */
productImage?: string;
productImageAlt?: string;
/** Line under the product image. Shown only when supplied. */
imageCaption?: string;
/** Delivery rhythms offered in the picker. */
cadences?: SubscribeSave3Cadence[];
/** id of the rhythm chosen at start. */
defaultCadence?: string;
/** Weeks shown on the route. */
weeks?: number;
/** First delivery, YYYY-MM-DD. Without it the route counts weeks instead of dates. */
startDate?: string;
/** Subscription price per delivery. */
price?: number;
/** One-time price per delivery; the saving is computed from it. */
oneTimePrice?: number;
/** ISO 4217 code used to format prices. */
currency?: string;
/** BCP 47 locale used for prices and dates. */
locale?: string;
/** The value in words beside the price. Shown only when supplied. */
priceAside?: React.ReactNode;
/** Subscription terms under the button (skip, pause, cancel). Shown only when supplied. */
terms?: React.ReactNode;
/** Numbered reasons beside the headline; empty hides the list. */
reasons?: SubscribeSave3Reason[];
/** Subscribe button label. */
actionLabel?: string;
/** Overrides for any generated wording; templates keep their {placeholders}. */
copy?: Partial<SubscribeSave3Copy>;
/** Subscribe: receives the chosen rhythm, its deliveries and prices. */
onAction?: (detail: SubscribeSave3Detail) => void;
/** Token of the next section for the curved hand-off; null for a flat edge. */
edgeTone?: DividerTone | null;
/** Forces the subscribe button's hover/pressed look, or disables the picker and button. */
state?: 'default' | 'hover' | 'active' | 'disabled';
/** Root class for page-level placement. */
className?: string;
};
const COPY: SubscribeSave3Copy = {
legend: 'Choose your rhythm',
cadenceLabel: 'Every {weeks} weeks',
cadenceLabelOne: 'Every week',
cadenceShort: '{weeks} weeks',
cadenceShortOne: 'week',
cadenceCount: '{count} {deliveries}',
delivery: 'delivery',
deliveries: 'deliveries',
deliveryTitle: 'Delivery',
itemLabel: '{item} {n}',
weekLabel: 'Week {n}',
weekTick: 'Wk {n}',
priceLead: 'Just',
priceUnit: 'a {item}',
saving: '{saving} less than buying each {item} one-time',
routeLabel: 'Your deliveries in the first {weeks} weeks',
totalLine: '{count} {deliveries} · {total} over {weeks} weeks',
totalLineNoPrice: '{count} {deliveries} over {weeks} weeks',
totalSaving: 'You keep {saving} compared with buying one-time',
reasonsHeading: '{Count} reasons to let it come to you',
reasonsHeadingOne: 'One reason to let it come to you',
countWords: ['One', 'Two', 'Three', 'Four', 'Five', 'Six'],
actionNote: 'First delivery {date}',
actionNoteNoDate: 'Every {cadence}',
live: '{count} {deliveries} in {weeks} weeks, every {cadence}',
};
const HEADLINE = 'Have it arrive on the rhythm you actually use it';
const HIGHLIGHT = 'the rhythm you actually use it';
const LEAD = 'Choose how often it comes and see every delivery mapped out below before you subscribe.';
const DEFAULT_CADENCES: SubscribeSave3Cadence[] = [{ weeks: 2 }, { weeks: 4 }, { weeks: 6 }];
const DEFAULT_REASONS: SubscribeSave3Reason[] = [
{ title: 'Set the gap once.', text: 'Pick the rhythm that matches how fast you use it and the deliveries follow it.', spot: calendarSpot },
{ title: 'One clear price per delivery.', text: 'You see what each delivery costs before you start.', spot: savingsSpot },
{ title: 'Every date up front.', text: 'The route below shows each delivery before you commit.', spot: truckSpot },
];
const DEFAULT_EDGE: DividerTone = 'band' as DividerTone;
const WEEK_MS = 7 * 24 * 60 * 60 * 1000;
export function SubscribeSave3(props: SubscribeSave3Props) {
const {
headline = HEADLINE,
headlineHighlight = props.headline === undefined ? HIGHLIGHT : '',
lead = LEAD,
productImage = '',
productImageAlt = '',
imageCaption = '',
cadences = DEFAULT_CADENCES,
defaultCadence,
weeks = 12,
startDate,
price,
oneTimePrice,
currency = 'USD',
locale = 'en-US',
priceAside,
terms,
reasons = DEFAULT_REASONS,
actionLabel = 'Start my deliveries',
onAction,
edgeTone = DEFAULT_EDGE,
state = 'default',
className = '',
} = props;
const c: SubscribeSave3Copy = { ...COPY, ...props.copy };
const uid = React.useId();
const span = Math.max(1, Math.round(Number.isFinite(weeks) ? weeks : 12));
const opts = cadences
.filter((o) => o && Number.isFinite(o.weeks) && o.weeks >= 1)
.map((o) => ({ ...o, every: Math.round(o.weeks), key: o.id ?? String(Math.round(o.weeks)) }));
const [sel, setSel] = React.useState<string>(() => (opts.find((o) => o.key === defaultCadence) ?? opts[0])?.key ?? '');
const [flip, setFlip] = React.useState(false);
const cur = opts.find((o) => o.key === sel) ?? opts[0];
const disabled = state === 'disabled';
const forced = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-press' : '';
const money = (n: number) => formatMoney(n, currency, locale);
const noun = (n: number) => (n === 1 ? c.delivery : c.deliveries);
const cadenceText = (every: number) => (every === 1 ? c.cadenceShortOne : fill(c.cadenceShort, { weeks: every }));
const start = parseISO(startDate);
const dateAt = (w: number) => (start === null ? null : new Date(start + w * WEEK_MS));
const stops = cur ? plan(span, cur.every) : [];
const count = stops.length;
const pool = opts.reduce((m, o) => Math.max(m, plan(span, o.every).length), 0);
const each = cur && typeof cur.price === 'number' ? cur.price : price;
const hasPrice = typeof each === 'number' && Number.isFinite(each);
const unit = hasPrice ? (each as number) : 0;
const saveEach = hasPrice && typeof oneTimePrice === 'number' && oneTimePrice > unit ? round2(oneTimePrice - unit) : 0;
const total = round2(unit * count);
const first = count ? dateAt(stops[0]) : null;
const xAt = (w: number) => ((w + 0.5) / span) * 100;
const x0 = count ? xAt(stops[0]) : 0;
const xl = count ? xAt(stops[count - 1]) : 0;
const tickStep = span > 16 ? Math.ceil(span / 12) : 1;
const list = reasons.filter(Boolean);
const reasonsTitle =
list.length === 1
? c.reasonsHeadingOne
: fill(c.reasonsHeading, { Count: c.countWords[list.length - 1] ?? String(list.length) });
const pick = (key: string) => {
if (disabled || key === sel) return;
setSel(key);
setFlip((f) => !f);
};
const act = () => {
if (disabled || !cur) return;
onAction?.({
cadence: cur.key,
everyWeeks: cur.every,
deliveries: stops.map((w, i) => {
const d = dateAt(w);
return d ? { n: i + 1, week: w + 1, date: isoDay(d) } : { n: i + 1, week: w + 1 };
}),
price: hasPrice ? unit : undefined,
total: hasPrice ? total : undefined,
oneTimePrice,
currency,
});
};
const note = first
? fill(c.actionNote, { date: formatDate(first, locale) })
: cur
? fill(c.actionNoteNoDate, { cadence: cadenceText(cur.every) })
: '';
const rootCls =
'cf-subscribe-save-3' +
(productImage ? '' : ' no-img') +
(list.length ? '' : ' no-reasons') +
(edgeTone ? '' : ' is-flat') +
(disabled ? ' is-disabled' : '') +
(className ? ' ' + className : '');
return (
<section className={rootCls} style={FX_HOST} aria-labelledby={uid + '-h'}>
<style>{CSS}</style>
{edgeTone ? <Divider shape='curve' tone={edgeTone} height={56} /> : null}
<div className='ss3-wrap'>
{productImage ? (
<figure className='ss3-img ss3-rise'>
<img src={productImage} alt={productImageAlt} width={560} height={560} decoding='async' />
{imageCaption ? <figcaption>{imageCaption}</figcaption> : null}
</figure>
) : null}
<div className='ss3-copy ss3-rise'>
<h2 id={uid + '-h'} className='ss3-h2'>
{emphasise(headline, headlineHighlight)}
</h2>
{lead ? <p className='ss3-lead'>{lead}</p> : null}
</div>
{list.length ? (
<div className='ss3-reasons ss3-rise' style={{ '--d': '.07s' } as React.CSSProperties}>
<h3 className='ss3-h3'>{reasonsTitle}</h3>
<ol className='ss3-reason-list'>
{list.map((r, i) => (
<li key={i} className={'ss3-reason' + (r.spot ? '' : ' no-spot')}>
{r.spot ? (
<span className='ss3-spot'>
<Spot src={r.spot} size={56} />
</span>
) : null}
<p className='ss3-reason-body'>
<span className='ss3-reason-n'>{i + 1}.</span>
<span className='ss3-reason-title'>{r.title}</span>
{r.text ? <> {r.text}</> : null}
</p>
</li>
))}
</ol>
</div>
) : null}
<div className='ss3-board ss3-rise' style={{ '--d': '.14s' } as React.CSSProperties}>
{opts.length || hasPrice ? (
<div className='ss3-head'>
{opts.length ? (
<fieldset className='ss3-pick' disabled={disabled}>
<legend className='ss3-legend'>{c.legend}</legend>
<div className='ss3-segs'>
{opts.map((o) => {
const n = plan(span, o.every).length;
return (
<label key={o.key} className='ss3-seg'>
<input
type='radio'
name={uid + '-cadence'}
value={o.key}
checked={o.key === cur?.key}
onChange={() => pick(o.key)}
/>
<span className='ss3-face'>
<span className='ss3-face-t'>
{o.label ?? (o.every === 1 ? c.cadenceLabelOne : fill(c.cadenceLabel, { weeks: o.every }))}
</span>
<span className='ss3-face-s'>{fill(c.cadenceCount, { count: n, deliveries: noun(n) })}</span>
</span>
</label>
);
})}
</div>
</fieldset>
) : null}
{hasPrice ? (
<div className='ss3-price'>
<p className='ss3-price-line'>
<span className='ss3-price-lead'>{c.priceLead}</span>
<span className='ss3-price-num'>{money(unit)}</span>
<span className='ss3-price-unit'>{fill(c.priceUnit, { item: c.delivery })}</span>
</p>
{priceAside ? <p className='ss3-price-aside'>{priceAside}</p> : null}
{saveEach > 0 ? (
<p className='ss3-price-save'>{fill(c.saving, { saving: money(saveEach), item: c.delivery })}</p>
) : null}
</div>
) : null}
</div>
) : null}
{cur ? (
<div className='ss3-route'>
<div className='ss3-rail' aria-hidden='true'>
<span className='ss3-line' />
{Array.from({ length: span }, (_, w) => (
<span key={w} className='ss3-tick' style={{ left: xAt(w) + '%' }}>
{w % tickStep === 0 ? <b>{fill(c.weekTick, { n: w + 1 })}</b> : null}
</span>
))}
<span className='ss3-fill' style={{ left: x0 + '%', width: xl - x0 + '%' }} />
</div>
<ol className='ss3-stops' aria-label={fill(c.routeLabel, { weeks: span })}>
{Array.from({ length: pool }, (_, i) => {
const on = i < count;
const w = on ? stops[i] : (stops[count - 1] ?? 0);
const d = dateAt(w);
const vars = {
'--x': xAt(w).toFixed(4),
'--i': String(i),
'--d': Math.min(i * 0.07, 0.28).toFixed(2) + 's',
} as React.CSSProperties;
return (
<li
key={i}
className='ss3-stop'
data-off={on ? undefined : 'true'}
data-flip={flip ? 'b' : 'a'}
aria-hidden={on ? undefined : true}
style={vars}
>
<span className='ss3-disc' aria-hidden='true'>
<Package size={18} strokeWidth={2.5} />
</span>
<span className='ss3-stop-text'>
<span className='ss3-stop-n'>{fill(c.itemLabel, { item: c.deliveryTitle, n: i + 1 })}</span>
<span className='ss3-stop-date'>
{d ? <time dateTime={isoDay(d)}>{formatDate(d, locale)}</time> : fill(c.weekLabel, { n: w + 1 })}
</span>
</span>
{hasPrice ? <span className='ss3-stop-price'>{money(unit)}</span> : null}
</li>
);
})}
</ol>
<p className='ss3-sr' aria-live='polite'>
{fill(c.live, { count, deliveries: noun(count), weeks: span, cadence: cadenceText(cur.every) })}
</p>
</div>
) : null}
<div className={'ss3-close' + (cur ? '' : ' is-solo')}>
{cur ? (
<div className='ss3-sum'>
<p className='ss3-total'>
{hasPrice
? fill(c.totalLine, { count, deliveries: noun(count), total: money(total), weeks: span })
: fill(c.totalLineNoPrice, { count, deliveries: noun(count), weeks: span })}
</p>
{saveEach > 0 ? (
<p className='ss3-total-save'>{fill(c.totalSaving, { saving: money(round2(saveEach * count)) })}</p>
) : null}
</div>
) : null}
<div className='ss3-act'>
<button type='button' className={'ss3-btn' + forced} disabled={disabled} onClick={act}>
<span className='ss3-btn-label'>{actionLabel}</span>
{note ? <span className='ss3-btn-note'>{note}</span> : null}
</button>
{terms ? (
<p className='ss3-terms'>
<CalendarCheck size={16} strokeWidth={2.5} aria-hidden='true' />
{terms}
</p>
) : null}
</div>
</div>
</div>
</div>
</section>
);
}
export default SubscribeSave3;
function plan(span: number, every: number): number[] {
const out: number[] = [];
for (let w = 0; w < span; w += Math.max(1, every)) out.push(w);
return out;
}
function round2(n: number) {
return Math.round(n * 100) / 100;
}
function fill(template: string, values: Record<string, string | number>) {
return template.replace(/[{]([a-zA-Z]+)[}]/g, (match, key: string) => (key in values ? String(values[key]) : match));
}
function parseISO(value?: string): number | null {
if (!value) return null;
const m = /^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.exec(value.trim());
if (!m) return null;
const t = Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
return Number.isFinite(t) ? t : null;
}
function isoDay(d: Date) {
return d.toISOString().slice(0, 10);
}
function formatDate(d: Date, locale: string) {
try {
return new Intl.DateTimeFormat(locale, { month: 'short', day: 'numeric', timeZone: 'UTC' }).format(d);
} catch {
return isoDay(d);
}
}
function formatMoney(n: number, currency: string, locale: string) {
const whole = Math.abs(n - Math.round(n)) < 0.005;
try {
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: whole ? 0 : 2,
}).format(n);
} catch {
return whole ? String(Math.round(n)) : n.toFixed(2);
}
}
function emphasise(text: React.ReactNode, phrase: string): React.ReactNode {
if (typeof text !== 'string' || !phrase) return text;
const i = text.indexOf(phrase);
if (i < 0) return text;
return (
<>
{text.slice(0, i)}
<span className='ss3-em'>{phrase}</span>
{text.slice(i + phrase.length)}
</>
);
}
const CSS = `
.cf-subscribe-save-3{position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) calc(clamp(64px,8.5vw,120px) + 56px);overflow-x:clip}
.cf-subscribe-save-3.is-flat{padding-bottom:clamp(64px,8.5vw,120px)}
.cf-subscribe-save-3 *,.cf-subscribe-save-3 *::before,.cf-subscribe-save-3 *::after{box-sizing:border-box}
.cf-subscribe-save-3 .ss3-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);grid-template-areas:'img copy' 'img reasons' 'board board';grid-template-rows:auto 1fr auto;column-gap:clamp(32px,5vw,72px);row-gap:32px;align-items:start}
.cf-subscribe-save-3.no-img .ss3-wrap{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'copy reasons' 'board board';grid-template-rows:auto auto}
.cf-subscribe-save-3.no-reasons .ss3-wrap{grid-template-areas:'img copy' 'img .' 'board board'}
.cf-subscribe-save-3.no-img.no-reasons .ss3-wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:'copy' 'board';grid-template-rows:auto auto}
.cf-subscribe-save-3 .ss3-img{grid-area:img;margin:0;display:grid;gap:12px;justify-items:center;min-width:0}
.cf-subscribe-save-3 .ss3-img img{display:block;width:100%;height:clamp(300px,38vw,500px);object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .28)) drop-shadow(0 16px 18px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .2))}
.cf-subscribe-save-3 .ss3-img figcaption{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-align:center;text-wrap:pretty}
.cf-subscribe-save-3 .ss3-copy{grid-area:copy;min-width:0}
.cf-subscribe-save-3 .ss3-h2{margin:0 0 24px;font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
.cf-subscribe-save-3 .ss3-em{color:var(--accent)}
.cf-subscribe-save-3 .ss3-lead{margin:0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--ink);text-wrap:pretty}
.cf-subscribe-save-3 .ss3-reasons{grid-area:reasons;min-width:0}
.cf-subscribe-save-3 .ss3-h3{margin:0 0 16px;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink)}
.cf-subscribe-save-3 .ss3-reason-list{list-style:none;margin:0;padding:0;display:grid;gap:16px}
.cf-subscribe-save-3 .ss3-reason{display:grid;grid-template-columns:56px minmax(0,1fr);column-gap:16px;align-items:start}
.cf-subscribe-save-3 .ss3-reason.no-spot{grid-template-columns:minmax(0,1fr)}
.cf-subscribe-save-3 .ss3-spot{display:block;width:56px;height:56px;line-height:0}
.cf-subscribe-save-3 .ss3-reason-body{margin:0;padding-top:4px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-subscribe-save-3 .ss3-reason-n{margin-inline-end:.4em;font-family:var(--font-display);font-weight:var(--display-weight,800);color:var(--accent);font-variant-numeric:tabular-nums}
.cf-subscribe-save-3 .ss3-reason-title{font-weight:800;color:var(--ink)}
.cf-subscribe-save-3 .ss3-board{grid-area:board;min-width:0;margin-top:32px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) 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(--shadow,oklch(.22 .03 260)) l c h / .22),0 4px 10px -2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .2)));padding:clamp(20px,3vw,32px)}
.cf-subscribe-save-3 .ss3-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:24px 40px;align-items:end}
.cf-subscribe-save-3 .ss3-pick{border:0;margin:0;padding:0;min-width:0}
.cf-subscribe-save-3 .ss3-legend{float:none;padding:0;margin:0 0 12px;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);color:var(--ink)}
.cf-subscribe-save-3 .ss3-segs{display:flex;gap:4px;padding:4px;max-width:560px;border-radius:calc(var(--radius,12px) + 4px);background:color-mix(in oklch,var(--ink) 6%,var(--card))}
.cf-subscribe-save-3 .ss3-seg{position:relative;flex:1 1 0;min-width:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cf-subscribe-save-3 .ss3-seg input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}
.cf-subscribe-save-3 .ss3-face{display:grid;place-content:center;gap:2px;min-height:64px;padding:10px 12px;border-radius:var(--radius,12px);border:1px solid transparent;text-align:center;transition:background-color .16s ease,box-shadow .16s ease,transform .16s ease,border-color .16s ease}
.cf-subscribe-save-3 .ss3-face-t{font-size:1.0625rem;line-height:1.2;font-weight:800;color:var(--ink);text-wrap:balance}
.cf-subscribe-save-3 .ss3-face-s{font-size:.9375rem;line-height:1.3;font-weight:600;color:color-mix(in oklch,var(--muted) 70%,var(--ink));font-variant-numeric:tabular-nums}
.cf-subscribe-save-3 .ss3-seg:hover input:not(:checked):not(:disabled) + .ss3-face{background:color-mix(in oklch,var(--ink) 11%,var(--card))}
.cf-subscribe-save-3 .ss3-seg input:checked + .ss3-face{background:var(--card);border-color:oklch(from var(--accent) l c h / .5);box-shadow:var(--shadow-sm,0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .2),0 1px 3px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .14))}
.cf-subscribe-save-3 .ss3-seg input:checked + .ss3-face .ss3-face-s{color:var(--accent)}
.cf-subscribe-save-3 .ss3-seg input:focus-visible + .ss3-face{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:2px}
.cf-subscribe-save-3 .ss3-seg:active input:not(:disabled) + .ss3-face{transform:scale(.98)}
.cf-subscribe-save-3 .ss3-pick:disabled .ss3-seg{cursor:not-allowed}
.cf-subscribe-save-3 .ss3-pick:disabled .ss3-face{opacity:.6}
.cf-subscribe-save-3 .ss3-price{min-width:0;text-align:right}
.cf-subscribe-save-3 .ss3-price-line{margin:0;padding-bottom:8px;display:flex;flex-wrap:wrap;align-items:baseline;justify-content:flex-end;column-gap:10px;row-gap:4px}
.cf-subscribe-save-3 .ss3-price-lead{font-family:var(--font-display);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--display-weight,800);text-transform:var(--display-case,none);color:var(--ink)}
.cf-subscribe-save-3 .ss3-price-num{font-family:var(--font-display);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:var(--display-weight,800);letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-subscribe-save-3 .ss3-price-unit{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;font-weight:600;color:var(--muted)}
.cf-subscribe-save-3 .ss3-price-aside{margin:16px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-subscribe-save-3 .ss3-price-save{margin:4px 0 0;font-size:.9375rem;line-height:1.4;font-weight:700;color:var(--success);text-wrap:pretty}
.cf-subscribe-save-3 .ss3-price-line + .ss3-price-save{margin-top:16px}
.cf-subscribe-save-3 .ss3-route{position:relative;height:104px;margin-top:36px}
.cf-subscribe-save-3 .ss3-rail{position:absolute;inset:0;pointer-events:none}
.cf-subscribe-save-3 .ss3-line{position:absolute;left:0;right:0;top:47px;height:6px;border-radius:999px;background:color-mix(in oklch,var(--ink) 10%,var(--card))}
.cf-subscribe-save-3 .ss3-tick{position:absolute;top:0;width:0;height:100%}
.cf-subscribe-save-3 .ss3-tick::before{content:'';position:absolute;top:46px;left:-4px;width:8px;height:8px;border-radius:50%;background:color-mix(in oklch,var(--ink) 24%,var(--card))}
.cf-subscribe-save-3 .ss3-tick b{position:absolute;top:78px;left:0;transform:translateX(-50%);font-size:.875rem;line-height:1.2;font-weight:700;color:var(--muted);white-space:nowrap}
.cf-subscribe-save-3 .ss3-fill{position:absolute;top:47px;height:6px;border-radius:999px;background:var(--accent-fill,var(--accent));transition:left .55s cubic-bezier(.2,.7,.2,1),width .55s cubic-bezier(.2,.7,.2,1)}
.cf-subscribe-save-3 .ss3-stops{list-style:none;margin:0;padding:0;position:absolute;inset:0}
.cf-subscribe-save-3 .ss3-stop{position:absolute;top:0;left:calc(var(--x) * 1%);width:96px;margin-left:-48px;display:flex;flex-direction:column-reverse;align-items:center;gap:10px;transform-origin:50% 50px;transition:left .55s cubic-bezier(.2,.7,.2,1) calc(var(--i) * .035s),opacity .3s ease,transform .3s ease}
.cf-subscribe-save-3 .ss3-stop[data-off]{opacity:0;transform:scale(.6);pointer-events:none}
.cf-subscribe-save-3 .ss3-disc{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));border:3px solid var(--card);box-shadow:0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3),0 4px 8px -3px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3)}
.cf-subscribe-save-3 .ss3-stop-text{display:block;text-align:center}
.cf-subscribe-save-3 .ss3-stop-date{display:block;font-size:.875rem;line-height:20px;font-weight:800;color:var(--ink);white-space:nowrap;font-variant-numeric:tabular-nums}
.cf-subscribe-save-3 .ss3-stop-n,.cf-subscribe-save-3 .ss3-stop-price,.cf-subscribe-save-3 .ss3-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.cf-subscribe-save-3 .ss3-close{margin-top:32px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:24px 40px;align-items:center}
.cf-subscribe-save-3 .ss3-close.is-solo{grid-template-columns:minmax(0,1fr);justify-items:center}
.cf-subscribe-save-3 .ss3-sum{min-width:0}
.cf-subscribe-save-3 .ss3-total{margin:0;font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);font-variant-numeric:tabular-nums;color:var(--ink);text-wrap:balance}
.cf-subscribe-save-3 .ss3-total-save{margin:8px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;font-weight:600;color:var(--success);text-wrap:pretty}
.cf-subscribe-save-3 .ss3-act{display:grid;justify-items:center;gap:12px;min-width:min(100%,320px)}
.cf-subscribe-save-3 .ss3-terms{margin:0;max-width:340px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-align:center;text-wrap:pretty}
.cf-subscribe-save-3 .ss3-terms svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-subscribe-save-3 .ss3-btn{appearance:none;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-height:72px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta))) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;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 + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .42));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-subscribe-save-3 .ss3-btn:hover:not(:disabled),.cf-subscribe-save-3 .ss3-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta))) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .32),0 10px 18px -6px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .5))}
.cf-subscribe-save-3 .ss3-btn:active:not(:disabled),.cf-subscribe-save-3 .ss3-btn.is-press:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta))) calc(l - .09) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .2) c h),0 1px 1px oklch(from var(--shadow,oklch(.22 .03 260)) l c h / .3)}
.cf-subscribe-save-3 .ss3-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-subscribe-save-3 .ss3-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:none;text-shadow:none;cursor:not-allowed}
.cf-subscribe-save-3 .ss3-btn-label{font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15}
.cf-subscribe-save-3 .ss3-btn-note{font-family:var(--font-body);font-size:.9375rem;line-height:1.3;font-weight:600;text-wrap:pretty}
@keyframes ss3-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ss3-a{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ss3-b{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
.cf-subscribe-save-3 .ss3-rise{animation:ss3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
@media (max-width:720px){
.cf-subscribe-save-3 .ss3-wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:'copy' 'img' 'board' 'reasons';grid-template-rows:auto;row-gap:24px}
.cf-subscribe-save-3.no-img .ss3-wrap{grid-template-columns:minmax(0,1fr);grid-template-areas:'copy' 'board' 'reasons';grid-template-rows:auto}
.cf-subscribe-save-3.no-reasons .ss3-wrap{grid-template-areas:'copy' 'img' 'board'}
.cf-subscribe-save-3.no-img.no-reasons .ss3-wrap{grid-template-areas:'copy' 'board'}
.cf-subscribe-save-3 .ss3-img img{height:240px}
.cf-subscribe-save-3 .ss3-board{margin-top:0}
.cf-subscribe-save-3 .ss3-reasons{margin-top:16px}
.cf-subscribe-save-3 .ss3-head{grid-template-columns:minmax(0,1fr)}
.cf-subscribe-save-3 .ss3-price{text-align:left}
.cf-subscribe-save-3 .ss3-price-line{justify-content:flex-start}
.cf-subscribe-save-3 .ss3-segs{max-width:none}
.cf-subscribe-save-3 .ss3-face{padding:10px 6px}
.cf-subscribe-save-3 .ss3-face-t{font-size:1rem}
.cf-subscribe-save-3 .ss3-face-s{font-size:.875rem}
.cf-subscribe-save-3 .ss3-route{height:auto;margin-top:28px}
.cf-subscribe-save-3 .ss3-rail{display:none}
.cf-subscribe-save-3 .ss3-stops{position:relative;inset:auto;display:grid}
.cf-subscribe-save-3 .ss3-stops::before{content:'';position:absolute;left:18px;top:28px;bottom:28px;width:4px;border-radius:999px;background:color-mix(in oklch,var(--ink) 10%,var(--card))}
.cf-subscribe-save-3 .ss3-stop{position:relative;left:auto;width:auto;margin-left:0;display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;column-gap:16px;padding:8px 0;transition:none}
.cf-subscribe-save-3 .ss3-stop[data-off]{display:none}
.cf-subscribe-save-3 .ss3-stop[data-flip='a']{animation:ss3-a .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.cf-subscribe-save-3 .ss3-stop[data-flip='b']{animation:ss3-b .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.cf-subscribe-save-3 .ss3-stop-text{text-align:left;min-width:0}
.cf-subscribe-save-3 .ss3-stop-n{position:static;display:block;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:normal;font-size:.9375rem;line-height:1.3;font-weight:600;color:var(--muted)}
.cf-subscribe-save-3 .ss3-stop-date{font-size:1.0625rem;line-height:1.3}
.cf-subscribe-save-3 .ss3-stop-price{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto;white-space:nowrap;font-size:1.0625rem;line-height:1.3;font-weight:800;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-subscribe-save-3 .ss3-close{grid-template-columns:minmax(0,1fr);margin-top:24px}
.cf-subscribe-save-3 .ss3-act{min-width:0;justify-items:stretch}
}
@media (prefers-reduced-motion: reduce){
/* !important kept: the animated rules (.ss3-rise, .ss3-stop[data-flip]) out-specify this universal reset. */
.cf-subscribe-save-3 *,.cf-subscribe-save-3 *::before,.cf-subscribe-save-3 *::after{animation:none !important;transition:none !important}
}
`;
pieces/offer/subscribe-save-3/specimen.tsx 63 lines
import __studioImage904f6363 from "../assets/f2234034a4e36c4d.webp";
// Specimen: Sprout Supper spice kits (fictional) on the subscribe-and-save delivery route.
import * as React from 'react';
import { SubscribeSave3, type SubscribeSave3Props } from '../subscribe-save-3';
import { slot } from '../../slots';
import calendar from '../../fx/spots/calendar';
import clock from '../../fx/spots/clock';
import savings from '../../fx/spots/savings';
export const states = ['default', 'hover', 'active', 'disabled'];
type SpecimenState = NonNullable<SubscribeSave3Props['state']>;
export default function SubscribeSave3Specimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<SubscribeSave3
state={state}
productImage={slot(
'product',
__studioImage904f6363,
)}
productImageAlt='Sprout Supper spice kit with four blend tins and recipe cards'
headline='Weeknight dinners that taste planned, on the rhythm you cook'
headlineHighlight='on the rhythm you cook'
lead='Every Sprout Supper kit packs four fresh spice blends with the recipe cards that use them. Pick how often a box lands and see each date before you start.'
cadences={[{ weeks: 2 }, { weeks: 4 }, { weeks: 6 }]}
defaultCadence='2'
weeks={12}
startDate='2026-12-03'
price={24}
oneTimePrice={30}
currency='USD'
priceAside='about the price of one takeout order'
terms='Skip, pause or cancel anytime from your account.'
actionLabel='Start my spice kits'
reasons={[
{
title: 'Fresh blends in every box.',
text: 'Each kit is mixed for the four recipes inside, so nothing sits in the cupboard going flat.',
spot: clock,
},
{
title: 'Dinner sorted in one decision.',
text: 'Pick a rhythm once and the next kit is already on its way.',
spot: calendar,
},
{
title: 'Just $24 a kit on subscription.',
text: 'That is $6 under the one-time price on every delivery.',
spot: savings,
},
]}
copy={{
delivery: 'kit',
deliveries: 'kits',
deliveryTitle: 'Kit',
actionNote: 'First kit arrives {date}',
reasonsHeading: '{Count} reasons to let dinner come to you',
routeLabel: 'Your Sprout Supper kits in the first {weeks} weeks',
}}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalSubscribeSave3 |
React.ReactNode |
|
headlineHighlight OptionalSubscribeSave3 |
string |
|
lead OptionalSubscribeSave3 |
React.ReactNode |
|
productImage OptionalSubscribeSave3 |
string |
|
productImageAlt OptionalSubscribeSave3 |
string |
|
imageCaption OptionalSubscribeSave3 |
string |
|
cadences OptionalSubscribeSave3 |
SubscribeSave3Cadence[] |
|
defaultCadence OptionalSubscribeSave3 |
string |
|
weeks OptionalSubscribeSave3 |
number |
|
startDate OptionalSubscribeSave3 |
string |
|
price OptionalSubscribeSave3 |
number |
|
oneTimePrice OptionalSubscribeSave3 |
number |
|
currency OptionalSubscribeSave3 |
string |
|
locale OptionalSubscribeSave3 |
string |
|
priceAside OptionalSubscribeSave3 |
React.ReactNode |
|
terms OptionalSubscribeSave3 |
React.ReactNode |
|
reasons OptionalSubscribeSave3 |
SubscribeSave3Reason[] |
|
actionLabel OptionalSubscribeSave3 |
string |
|
copy OptionalSubscribeSave3 |
Partial<SubscribeSave3Copy> |
|
onAction OptionalSubscribeSave3 |
(detail: SubscribeSave3Detail) => void |
|
edgeTone OptionalSubscribeSave3 |
DividerTone | null |
|
state OptionalSubscribeSave3 |
'default' | 'hover' | 'active' | 'disabled' |
|
className OptionalSubscribeSave3 |
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.
product- The main product shot or cover (ebook, kit, bottle).
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
75ba15955a7397f6.webp
image/webp · 18.6 KB
-
7c36d7f4dd4ae594.webp
image/webp · 26.5 KB
-
87170e25e6a4d825.webp
image/webp · 18.7 KB
-
f2234034a4e36c4d.webp
image/webp · 86.5 KB