Trial Offer 5
Trial offer block: a bento of everything the first month unlocks, arranged around one dominant receipt tile and a start-trial tile. The receipt tile shows today's trial price, a plain line on what it becomes and an optional monthly/yearly switch, so the low-risk front door shows the whole membership.
Use it in a prompt
Use offer/trial-offer-5 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/trial-offer-5.tsx. - Import it and pass your copy and images (Props tab):
import { TrialOffer5 } from "@/components/funneldna/offer/trial-offer-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/trial-offer-5/component.tsx 828 lines
// layout: bento-grid
// Trial offer block: a bento of everything the first month unlocks, arranged around one dominant receipt tile and a start-trial tile. The receipt tile shows today's trial price, a plain line on what it becomes and an optional monthly/yearly switch, so the low-risk front door shows the whole membership.
import * as React from "react"
import { CircleAlert as AlertIcon, Loader2 as SpinnerIcon, ShieldCheck as ShieldIcon } from "lucide-react"
import { Spot } from "../fx/fx"
import shieldSpot from "../fx/spots/shield"
export type TrialOffer5State = "default" | "hover" | "active" | "disabled" | "error"
export type TrialOffer5Plan = "monthly" | "yearly"
export type TrialOffer5Unlock = {
/** Benefit-led tile title, e.g. "Live cook-alongs". */
title: string
/** One short line under the title. */
detail?: string
/** Small grey chip for when it happens, e.g. "Thursdays, 7pm"; omitted when empty. */
when?: string
/** Thumbnail photo (slots "item-1" to "item-3"). */
image?: string
imageAlt?: string
}
/** Every other visible word. Templates: {trialPrice}, {trialDays}, {monthlyPrice}, {yearlyPrice}, {count}. */
export type TrialOffer5Copy = Record<keyof typeof DEFAULT_COPY, string>
export type TrialOffer5Props = {
headline?: React.ReactNode
/** Phrase after the headline that carries the marker stroke; supports the templates. */
accent?: string
/** Numbered reasons set inline under the headline; they support the templates. */
reasons?: string[]
/** Price paid today for the first month, set huge as the receipt total. */
trialPrice?: string
/** Length of the trial in days. */
trialDays?: number
/** Price per month after the trial; omitted when empty. */
monthlyPrice?: string
/** Price per year after the trial. The monthly/yearly switch shows only when both prices are supplied. */
yearlyPrice?: string
/** Small flag on the yearly option, e.g. "Save $58". Use supplied facts only. */
yearlyFlag?: string
/** Plan the switch starts on. */
initialPlan?: TrialOffer5Plan
/** Small line at the top of the receipt, e.g. the membership name; omitted when empty. */
receiptTitle?: string
/** Discount on the receipt; computed from the monthly and trial prices when left out. */
discountAmount?: string
/** Up to three things the first month unlocks. */
unlocks?: TrialOffer5Unlock[]
/** Clay fx Spot for the cancel tile (an imported spot asset); omitted when empty. */
cancelSpot?: string
cancelTitle?: string
/** Supports the templates. */
cancelBody?: string
/** Guarantee line in the cancel tile; omitted when empty. */
guarantee?: string
/** Heading in the action tile that closes the bento. Supports the templates. */
actionTitle?: string
/** Button label; supports the templates. */
ctaLabel?: string
/** Button label while onAction is pending. */
loadingLabel?: string
/** Shown when onAction rejects or when state is "error". */
errorMessage?: string
/** Shown under the button when it is disabled. */
disabledNote?: string
copy?: Partial<TrialOffer5Copy>
state?: TrialOffer5State
disabled?: boolean
/** Start-trial click with the chosen plan. The builder wires what happens next; a rejected promise shows the error line. */
onAction?: (plan: TrialOffer5Plan) => void | Promise<void>
/** Called when the visitor switches plan. */
onPlanChange?: (plan: TrialOffer5Plan) => void
className?: string
style?: React.CSSProperties
}
type Phase = "idle" | "loading" | "error"
export function TrialOffer5({
headline = "Open everything",
accent = "for {trialPrice}",
reasons = DEFAULT_REASONS,
trialPrice = "$1",
trialDays = 30,
monthlyPrice = "$29",
yearlyPrice,
yearlyFlag,
initialPlan,
receiptTitle,
discountAmount,
unlocks = DEFAULT_UNLOCKS,
cancelSpot = shieldSpot,
cancelTitle = "Cancel anytime",
cancelBody = "Stop before day {trialDays} and you pay nothing more.",
guarantee,
actionTitle = "Start your first month for {trialPrice}",
ctaLabel = "Send Me In for {trialPrice}",
loadingLabel = "Opening your first month…",
errorMessage = "We couldn’t start your trial and nothing was charged. Please try again.",
disabledNote = "This trial isn’t open right now.",
copy,
state = "default",
disabled = false,
onAction,
onPlanChange,
className,
style,
}: TrialOffer5Props) {
const t: TrialOffer5Copy = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const ids = { title: uid + "-title", note: uid + "-note", plan: uid + "-plan" }
const plans: TrialOffer5Plan[] = []
if (monthlyPrice) plans.push("monthly")
if (yearlyPrice) plans.push("yearly")
const [picked, setPicked] = React.useState<TrialOffer5Plan>(initialPlan ?? "monthly")
const plan: TrialOffer5Plan | undefined = plans.includes(picked) ? picked : plans[0]
const hasSwitch = plans.length === 2
const [phase, setPhase] = React.useState<Phase>(state === "error" ? "error" : "idle")
const alive = React.useRef(true)
const pending = React.useRef(false)
React.useEffect(() => {
setPhase(state === "error" ? "error" : "idle")
}, [state])
React.useEffect(() => {
if (initialPlan) setPicked(initialPlan)
}, [initialPlan])
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const list = (reasons || []).filter(Boolean)
const fill = (text: string) =>
fillTemplate(text, {
trialPrice,
trialDays: String(trialDays),
monthlyPrice: monthlyPrice ?? "",
yearlyPrice: yearlyPrice ?? "",
count: NUMBER_WORDS[list.length] ?? String(list.length),
})
const tiles = (unlocks || []).filter((tile) => tile && tile.title).slice(0, 3)
const discount = discountAmount ?? (monthlyPrice ? subtractMoney(monthlyPrice, trialPrice) : undefined)
const after = plan === "yearly" ? fill(t.afterYearly) : plan === "monthly" ? fill(t.afterMonthly) : ""
const note = plan === "yearly" ? fill(t.noteYearly) : plan === "monthly" ? fill(t.noteMonthly) : fill(t.noteTrial)
const isDisabled = disabled || state === "disabled"
const busy = phase === "loading"
const force = !isDisabled && phase === "idle" && (state === "hover" || state === "active") ? state : undefined
const showStatus = phase === "error" || isDisabled
let order = 0
const at = () => ({ "--t5-i": order++ }) as React.CSSProperties
const choose = (next: TrialOffer5Plan) => {
setPicked(next)
onPlanChange?.(next)
}
const handleStart = async () => {
if (isDisabled || busy || pending.current || !onAction) return
pending.current = true
setPhase("loading")
try {
await onAction(plan ?? "monthly")
if (alive.current) setPhase("idle")
} catch {
if (alive.current) setPhase("error")
} finally {
pending.current = false
}
}
return (
<section className={["cf-trial-offer-5", className].filter(Boolean).join(" ")} style={style} aria-labelledby={ids.title}>
<style>{CSS}</style>
<div className="t5-wrap">
<header className="t5-head">
<h2 id={ids.title} className="t5-title">
{headline}
{accent ? (
<>
{" "}
<span className="t5-mark">{fill(accent)}</span>
</>
) : null}
</h2>
{list.length ? (
<p className="t5-reasons">
<strong>{fill(t.reasonsLead)}</strong>
{list.map((reason, index) => (
<React.Fragment key={index}>
{" "}
<span className="t5-n">{index + 1}</span>
{fill(reason)}
</React.Fragment>
))}
</p>
) : null}
</header>
<div className="t5-grid" data-count={tiles.length}>
<div className="t5-col">
<div className="t5-tile t5-pt" style={at()}>
{receiptTitle || monthlyPrice ? (
<div className="t5-receipt">
{receiptTitle ? <p className="t5-rc-title">{receiptTitle}</p> : null}
{monthlyPrice ? (
<dl className="t5-rows" aria-label={fill(t.receiptLabel)}>
<div className="t5-row">
<dt>{fill(t.receiptItem)}</dt>
<dd>{monthlyPrice}</dd>
</div>
{discount ? (
<div className="t5-row t5-row-off">
<dt>{fill(t.discountLabel)}</dt>
<dd>−{discount}</dd>
</div>
) : null}
</dl>
) : null}
</div>
) : null}
<div className="t5-total">
<p className="t5-total-label">{fill(t.totalLabel)}</p>
<p className="t5-big">
<Price value={trialPrice} />
</p>
<p className="t5-total-for">{fill(t.totalFor)}</p>
</div>
{plans.length ? (
<div className="t5-after-box">
{hasSwitch ? (
<fieldset className="t5-switch">
<legend className="t5-legend">{t.planLegend}</legend>
<div className="t5-seg">
{plans.map((option) => (
<label key={option} className="t5-opt" data-on={plan === option ? "" : undefined}>
<input
className="t5-radio"
type="radio"
name={ids.plan}
value={option}
checked={plan === option}
onChange={() => choose(option)}
/>
<span>{option === "yearly" ? t.yearly : t.monthly}</span>
{option === "yearly" && yearlyFlag ? <span className="t5-flag">{yearlyFlag}</span> : null}
</label>
))}
</div>
</fieldset>
) : null}
<div className="t5-after-live" aria-live="polite">
<p className="t5-after" key={plan}>
{after}
</p>
</div>
</div>
) : null}
</div>
<div className="t5-tile t5-cx" style={at()}>
{cancelSpot ? (
<span className="t5-spot">
<Spot src={cancelSpot} size={72} />
</span>
) : null}
<div className="t5-cx-copy">
<h3 className="t5-cx-title">{fill(cancelTitle)}</h3>
{cancelBody ? <p className="t5-cx-body">{fill(cancelBody)}</p> : null}
{guarantee ? (
<p className="t5-guar">
<ShieldIcon className="t5-ic" size={16} strokeWidth={2.5} aria-hidden="true" />
{guarantee}
</p>
) : null}
</div>
</div>
</div>
{tiles.length ? (
<ul className="t5-list" role="list" aria-label={fill(t.unlocksLabel)}>
{tiles.map((tile, index) => (
<li key={tile.title + index} className={"t5-tile t5-u t5-u" + (index + 1)} style={at()}>
{tile.image ? (
<div className="t5-thumb">
<img
src={tile.image}
alt={tile.imageAlt ?? ""}
width={640}
height={index === 0 ? 320 : 480}
loading="lazy"
decoding="async"
/>
</div>
) : null}
<div className="t5-u-body">
<h3 className="t5-u-title">{tile.title}</h3>
{tile.detail ? <p className="t5-u-detail">{tile.detail}</p> : null}
{tile.when ? <span className="t5-chip">{tile.when}</span> : null}
</div>
</li>
))}
</ul>
) : null}
<div className="t5-tile t5-act" style={at()}>
<div className="t5-act-copy">
{actionTitle ? <h3 className="t5-act-title">{fill(actionTitle)}</h3> : null}
<p id={ids.note} className="t5-act-note" key={plan}>
{note}
</p>
</div>
<div className="t5-act-do">
<button
type="button"
className="t5-btn"
data-force={force}
disabled={isDisabled}
aria-busy={busy || undefined}
aria-describedby={ids.note}
onClick={handleStart}
>
{busy ? (
<>
<SpinnerIcon className="t5-spin" size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{loadingLabel}</span>
</>
) : (
<span>{fill(ctaLabel)}</span>
)}
</button>
{showStatus ? (
isDisabled ? (
<p className="t5-off">{disabledNote}</p>
) : (
<p className="t5-err" role="alert">
<AlertIcon className="t5-ic" size={16} strokeWidth={2.5} aria-hidden="true" />
{errorMessage}
</p>
)
) : null}
</div>
</div>
</div>
</div>
</section>
)
}
export default TrialOffer5
function Price({ value }: { value: string }) {
const parts = parseMoney(value)
if (!parts) return <>{value}</>
return (
<>
{parts.sym ? <span className="t5-cur">{parts.sym}</span> : null}
{parts.num}
{parts.rest ? <span className="t5-cur-rest">{parts.rest}</span> : null}
</>
)
}
const DIGITS = "0123456789"
function parseMoney(value: string) {
let i = 0
while (i < value.length && !DIGITS.includes(value[i])) i++
let j = i
while (j < value.length && (DIGITS.includes(value[j]) || value[j] === "," || value[j] === ".")) j++
if (i === j) return null
const num = value.slice(i, j)
const clean = num.split(",").join("")
const n = Number(clean)
if (!Number.isFinite(n)) return null
const dot = clean.indexOf(".")
return { sym: value.slice(0, i), num, n, dec: dot < 0 ? 0 : clean.length - dot - 1, rest: value.slice(j) }
}
function subtractMoney(regular: string, trial: string) {
const a = parseMoney(regular)
const b = parseMoney(trial)
if (!a || !b || a.sym !== b.sym || a.rest !== b.rest) return undefined
const dec = Math.max(a.dec, b.dec)
const scale = 10 ** dec
const diff = Math.round((a.n - b.n) * scale) / scale
if (!(diff > 0)) return undefined
return a.sym + diff.toLocaleString("en-US", { minimumFractionDigits: dec, maximumFractionDigits: dec }) + a.rest
}
function fillTemplate(text: string, values: Record<string, string>) {
let out = text
for (const key of Object.keys(values)) out = out.split("{" + key + "}").join(values[key])
return out
}
const NUMBER_WORDS = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven"]
const DEFAULT_REASONS = [
"Everything inside opens on day one.",
"You see it all before you pay full price.",
"You decide on day {trialDays}, not today.",
]
const DEFAULT_UNLOCKS: TrialOffer5Unlock[] = [
{ title: "Live sessions", detail: "Join live, follow along and ask as you go." },
{ title: "The full library", detail: "Everything published so far, open from day one." },
{ title: "Members’ Q&A", detail: "Bring your questions and get answers live." },
]
const DEFAULT_COPY = {
reasonsLead: "{count} reasons it’s {trialPrice} today:",
receiptLabel: "Your first month, itemised",
receiptItem: "Full membership, first {trialDays} days",
discountLabel: "First-month trial price",
totalLabel: "Due today",
totalFor: "for your first {trialDays} days",
planLegend: "After your trial, pay",
monthly: "Monthly",
yearly: "Yearly",
afterMonthly: "Then {monthlyPrice} a month after your first {trialDays} days.",
afterYearly: "Then {yearlyPrice} a year after your first {trialDays} days.",
noteMonthly: "{trialPrice} today, then {monthlyPrice}/month. Cancel anytime.",
noteYearly: "{trialPrice} today, then {yearlyPrice}/year. Cancel anytime.",
noteTrial: "{trialPrice} today. Cancel anytime.",
unlocksLabel: "What unlocks in your first {trialDays} days",
}
const CSS = `
.cf-trial-offer-5 {
--t5-shade: var(--shadow, oklch(0.22 0.03 260));
--t5-marker: color-mix(in oklch, var(--marker, #fae37c) 82%, transparent);
--t5-line: oklch(from var(--ink, oklch(0.21 0.03 263)) l c h / 0.12);
--t5-ease: cubic-bezier(.2, .7, .2, 1);
position: relative;
box-sizing: border-box;
width: 100%;
padding: clamp(56px, 8vw, 112px) clamp(16px, 5vw, 48px) clamp(64px, 8.5vw, 120px);
background: color-mix(in oklch, var(--ink, oklch(0.21 0.03 263)) 3.5%, var(--surface, oklch(1 0 0)));
color: var(--ink, oklch(0.21 0.03 263));
font-family: var(--font-body, system-ui, sans-serif);
overflow-x: clip;
}
.cf-trial-offer-5 *, .cf-trial-offer-5 *::before, .cf-trial-offer-5 *::after { box-sizing: border-box; }
.cf-trial-offer-5 .t5-wrap { max-width: 1120px; margin: 0 auto; }
.cf-trial-offer-5 .t5-head { margin: 0 0 clamp(32px, 4vw, 48px); }
.cf-trial-offer-5 .t5-title {
margin: 0;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
letter-spacing: var(--display-tracking, -0.025em);
text-transform: var(--display-case, none);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
text-wrap: balance;
color: var(--ink);
}
.cf-trial-offer-5 .t5-mark {
padding: 0 .1em;
margin: 0 -.04em;
border-radius: .12em .28em .16em .3em;
background: linear-gradient(transparent 58%, var(--t5-marker) 58%, var(--t5-marker) 94%, transparent 94%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-trial-offer-5 .t5-reasons {
margin: 16px 0 0;
max-width: 64ch;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.45;
font-weight: 500;
color: var(--muted);
text-wrap: pretty;
}
.cf-trial-offer-5 .t5-reasons strong { color: var(--ink); font-weight: 800; }
.cf-trial-offer-5 .t5-n {
margin: 0 .28em 0 .1em;
font-family: var(--font-display);
font-weight: 800;
font-variant-numeric: tabular-nums;
color: var(--accent);
}
.cf-trial-offer-5 .t5-grid {
display: grid;
gap: 16px;
grid-template-columns: minmax(0, 1fr);
}
.cf-trial-offer-5 .t5-col { display: contents; }
.cf-trial-offer-5 .t5-list { display: contents; list-style: none; margin: 0; padding: 0; }
.cf-trial-offer-5 .t5-pt { order: 1; }
.cf-trial-offer-5 .t5-u { order: 2; }
.cf-trial-offer-5 .t5-cx { order: 3; }
.cf-trial-offer-5 .t5-act { order: 4; }
.cf-trial-offer-5 .t5-tile {
position: relative;
min-width: 0;
margin: 0;
padding: clamp(20px, 3vw, 32px);
background: var(--card, oklch(1 0 0));
color: var(--ink);
border: 1px solid var(--card-border, var(--t5-line));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(from var(--t5-shade) l c h / .22), 0 4px 10px -2px oklch(from var(--t5-shade) l c h / .2)));
animation: t5-rise .45s var(--t5-ease) both;
animation-delay: calc(min(var(--t5-i, 0), 4) * .07s);
}
.cf-trial-offer-5 .t5-pt {
display: flex;
flex-direction: column;
gap: 24px;
border-color: oklch(from var(--accent-fill, var(--accent)) l c h / .45);
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--t5-shade) l c h / .22), 0 12px 24px -8px oklch(from var(--t5-shade) l c h / .32));
}
.cf-trial-offer-5 .t5-rc-title { margin: 0 0 8px; font-size: .9375rem; line-height: 1.4; font-weight: 700; color: var(--muted); }
.cf-trial-offer-5 .t5-rows { margin: 0; }
.cf-trial-offer-5 .t5-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 16px;
padding: 12px 0;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.4;
}
.cf-trial-offer-5 .t5-row + .t5-row { border-top: 1px solid var(--t5-line); }
.cf-trial-offer-5 .t5-row dt { min-width: 0; color: var(--ink); text-wrap: pretty; }
.cf-trial-offer-5 .t5-row dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.cf-trial-offer-5 .t5-row-off dd { color: var(--success); }
.cf-trial-offer-5 .t5-total { margin: 0; }
.cf-trial-offer-5 .t5-total-label { margin: 0; font-size: .9375rem; line-height: 1.4; font-weight: 700; color: var(--muted); }
.cf-trial-offer-5 .t5-big {
margin: 16px 0 0;
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: clamp(4.5rem, 10vw, 8.5rem);
line-height: 1.1;
letter-spacing: -0.04em;
font-variant-numeric: tabular-nums;
color: var(--ink);
}
.cf-trial-offer-5 .t5-cur { font-size: .42em; letter-spacing: 0; vertical-align: .95em; margin-right: .06em; }
.cf-trial-offer-5 .t5-cur-rest { font-size: .3em; letter-spacing: 0; margin-left: .1em; }
.cf-trial-offer-5 .t5-total-for { margin: 16px 0 0; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; color: var(--muted); text-wrap: pretty; }
.cf-trial-offer-5 .t5-after-box {
display: grid;
gap: 12px;
padding: 16px;
border-radius: 10px;
background: color-mix(in oklch, var(--ink) 4%, var(--card));
}
.cf-trial-offer-5 .t5-switch { margin: 0; padding: 0; border: 0; min-width: 0; }
.cf-trial-offer-5 .t5-legend { padding: 0; margin: 0 0 8px; font-size: .9375rem; line-height: 1.4; font-weight: 700; color: var(--ink); }
.cf-trial-offer-5 .t5-seg {
display: inline-flex;
flex-wrap: wrap;
gap: 4px;
max-width: 100%;
padding: 4px;
border-radius: calc(var(--radius, 12px) + 2px);
background: color-mix(in oklch, var(--ink) 9%, var(--card));
}
.cf-trial-offer-5 .t5-opt {
position: relative;
display: inline-flex;
flex: 1 1 auto;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 44px;
padding: 0 16px;
border-radius: var(--radius, 12px);
color: var(--ink);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
font-weight: 600;
line-height: 1.2;
white-space: nowrap;
cursor: pointer;
transition: background .16s ease, box-shadow .16s ease;
}
.cf-trial-offer-5 .t5-opt:hover { background: color-mix(in oklch, var(--ink) 4%, var(--card)); }
.cf-trial-offer-5 .t5-opt[data-on] {
background: var(--card);
font-weight: 800;
box-shadow: var(--shadow-sm, 0 1px 1px oklch(from var(--t5-shade) l c h / .18), 0 1px 3px oklch(from var(--t5-shade) l c h / .14));
}
.cf-trial-offer-5 .t5-radio { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cf-trial-offer-5 .t5-opt:has(.t5-radio:focus-visible) { outline: 2px solid var(--field-focus, var(--accent)); outline-offset: 2px; }
.cf-trial-offer-5 .t5-flag {
display: inline-flex;
align-items: center;
min-height: 28px;
padding: 4px 12px;
border-radius: 999px;
background: var(--accent-fill, var(--accent));
color: var(--accent-fill-ink, var(--card));
font-size: .875rem;
font-weight: 800;
line-height: 1.2;
}
.cf-trial-offer-5 .t5-after {
margin: 0;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.35;
font-weight: 700;
color: var(--ink);
text-wrap: pretty;
animation: t5-swap .3s var(--t5-ease) both;
}
.cf-trial-offer-5 .t5-u { display: flex; flex-direction: column; gap: 16px; padding: 12px; }
.cf-trial-offer-5 .t5-thumb {
position: relative;
overflow: hidden;
margin: 0;
border-radius: 12px;
aspect-ratio: 4 / 3;
background: color-mix(in oklch, var(--ink) 6%, var(--card));
}
.cf-trial-offer-5 .t5-u1 .t5-thumb { aspect-ratio: 2 / 1; }
.cf-trial-offer-5 .t5-thumb img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
transition: transform .5s var(--t5-ease);
}
@media (hover: hover) {
.cf-trial-offer-5 .t5-u:hover .t5-thumb img { transform: scale(1.04); }
}
.cf-trial-offer-5 .t5-u-body { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 8px 8px; }
.cf-trial-offer-5 .t5-u:not(:has(.t5-thumb)) .t5-u-body { padding: 12px; }
.cf-trial-offer-5 .t5-u-title,
.cf-trial-offer-5 .t5-cx-title,
.cf-trial-offer-5 .t5-act-title {
margin: 0;
font-family: var(--font-display);
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-trial-offer-5 .t5-u-detail { margin: 0; font-size: .9375rem; line-height: 1.4; color: var(--muted); text-wrap: pretty; }
.cf-trial-offer-5 .t5-chip {
display: inline-flex;
align-items: center;
min-height: 28px;
margin-top: auto;
padding: 4px 12px;
border-radius: 999px;
background: color-mix(in oklch, var(--ink) 6%, var(--card));
color: var(--ink);
font-size: .875rem;
font-weight: 800;
line-height: 1.2;
}
.cf-trial-offer-5 .t5-cx { display: flex; flex-direction: row; align-items: flex-start; gap: 20px; }
.cf-trial-offer-5 .t5-spot { display: block; flex: none; line-height: 0; }
.cf-trial-offer-5 .t5-cx-copy { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cf-trial-offer-5 .t5-cx-body { margin: 0; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.cf-trial-offer-5 .t5-guar { margin: 4px 0 0; font-size: .9375rem; line-height: 1.4; font-weight: 600; color: var(--ink); text-wrap: pretty; }
.cf-trial-offer-5 .t5-ic { display: inline-block; width: 16px; height: 16px; vertical-align: -0.15em; margin-inline-end: .4em; }
.cf-trial-offer-5 .t5-guar .t5-ic { color: var(--success); }
.cf-trial-offer-5 .t5-act {
display: flex;
flex-direction: column;
justify-content: center;
gap: 24px;
background: var(--band);
color: var(--band-ink);
border-color: transparent;
box-shadow: var(--shadow-lg, 0 2px 4px oklch(from var(--t5-shade) l c h / .22), 0 12px 24px -8px oklch(from var(--t5-shade) l c h / .32));
}
.cf-trial-offer-5 .t5-act-title { color: var(--band-ink); }
.cf-trial-offer-5 .t5-act-copy { min-width: 0; }
.cf-trial-offer-5 .t5-act-note {
margin: 8px 0 0;
font-size: .9375rem;
line-height: 1.4;
font-weight: 600;
color: var(--band-ink);
text-wrap: pretty;
animation: t5-swap .3s var(--t5-ease) both;
}
.cf-trial-offer-5 .t5-act-do { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cf-trial-offer-5 .t5-btn {
--t5-b: var(--button-bg, var(--cta));
--t5-b2: var(--button-bg-2, var(--cta-2, var(--t5-b)));
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
min-height: 72px;
margin: 0;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display));
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-align: center;
text-wrap: balance;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--t5-b) calc(l + .04) c h), oklch(from var(--t5-b2) calc(l - .02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--t5-b) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--t5-b) calc(l - .16) c h), 0 1px 2px oklch(from var(--t5-shade) l c h / .35), 0 8px 16px -6px oklch(from var(--t5-shade) l c h / .45));
cursor: pointer;
-webkit-tap-highlight-color: transparent;
transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cf-trial-offer-5 .t5-btn:hover:not(:disabled),
.cf-trial-offer-5 .t5-btn[data-force="hover"] {
background: linear-gradient(oklch(from var(--t5-b) calc(l - .01) c h), oklch(from var(--t5-b2) calc(l - .07) c h));
transform: translateY(-1px);
}
.cf-trial-offer-5 .t5-btn:active:not(:disabled),
.cf-trial-offer-5 .t5-btn[data-force="active"] {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--t5-b) calc(l - .04) c h), oklch(from var(--t5-b2) calc(l - .08) c h));
box-shadow: inset 0 2px 4px oklch(from var(--t5-shade) l c h / .35), inset 0 -2px 0 oklch(from var(--t5-b) calc(l - .16) c h), 0 1px 1px oklch(from var(--t5-shade) l c h / .3);
}
.cf-trial-offer-5 .t5-btn:focus-visible { outline: 3px solid var(--band-ink); outline-offset: 3px; }
.cf-trial-offer-5 .t5-btn[aria-busy="true"] { cursor: progress; }
.cf-trial-offer-5 .t5-btn:disabled {
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
cursor: not-allowed;
transform: none;
}
.cf-trial-offer-5 .t5-spin { flex: none; width: 20px; height: 20px; animation: t5-spin .8s linear infinite; }
.cf-trial-offer-5 .t5-err {
margin: 0;
padding: 12px;
border-radius: 10px;
background: var(--danger-soft);
color: var(--danger);
font-size: .9375rem;
font-weight: 600;
line-height: 1.4;
text-wrap: pretty;
}
.cf-trial-offer-5 .t5-off { margin: 0; font-size: .9375rem; font-weight: 600; line-height: 1.4; color: var(--band-ink); text-align: center; text-wrap: pretty; }
@media (min-width: 640px) {
.cf-trial-offer-5 .t5-list { display: grid; order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; }
.cf-trial-offer-5 .t5-u1,
.cf-trial-offer-5 .t5-grid[data-count="2"] .t5-u2 { grid-column: 1 / -1; }
.cf-trial-offer-5 .t5-grid[data-count="2"] .t5-u2 .t5-thumb { aspect-ratio: 2 / 1; }
.cf-trial-offer-5 .t5-act { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; }
.cf-trial-offer-5 .t5-act-copy { flex: 1 1 260px; }
.cf-trial-offer-5 .t5-act-do { flex: 1 1 300px; max-width: 440px; }
}
@media (min-width: 960px) {
.cf-trial-offer-5 .t5-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-trial-offer-5 .t5-grid[data-count="0"] { grid-template-columns: minmax(0, 1fr); }
.cf-trial-offer-5 .t5-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cf-trial-offer-5 .t5-pt { flex: 1 1 auto; justify-content: space-between; }
.cf-trial-offer-5 .t5-act { grid-column: 1 / -1; }
.cf-trial-offer-5 .t5-u { padding: 16px; }
.cf-trial-offer-5 .t5-grid[data-count="1"] .t5-u1 .t5-thumb { aspect-ratio: 4 / 3; }
}
@media (max-width: 639px) {
.cf-trial-offer-5 .t5-grid { gap: 12px; }
.cf-trial-offer-5 .t5-pt { padding: 20px; gap: 20px; }
.cf-trial-offer-5 .t5-after-box { padding: 14px; }
.cf-trial-offer-5 .t5-u { padding: 8px; gap: 12px; }
.cf-trial-offer-5 .t5-u-body { padding: 0 4px 8px; }
.cf-trial-offer-5 .t5-u2,
.cf-trial-offer-5 .t5-u3 { flex-direction: row; align-items: flex-start; gap: 16px; }
.cf-trial-offer-5 .t5-u2 .t5-thumb,
.cf-trial-offer-5 .t5-u3 .t5-thumb { flex: 0 0 112px; aspect-ratio: 1 / 1; border-radius: 8px; }
.cf-trial-offer-5 .t5-u2 .t5-u-body,
.cf-trial-offer-5 .t5-u3 .t5-u-body { padding: 4px 4px 4px 0; }
.cf-trial-offer-5 .t5-u-title { font-size: 1.125rem; }
.cf-trial-offer-5 .t5-u1 .t5-u-title { font-size: 1.3125rem; }
.cf-trial-offer-5 .t5-cx { padding: 20px; gap: 16px; }
.cf-trial-offer-5 .t5-seg { display: flex; width: 100%; }
.cf-trial-offer-5 .t5-opt { padding: 0 10px; }
.cf-trial-offer-5 .t5-flag { padding: 4px 10px; }
.cf-trial-offer-5 .t5-act { padding: 20px; gap: 16px; }
.cf-trial-offer-5 .t5-btn { min-height: 64px; padding: 0 20px; }
}
@keyframes t5-rise { from { opacity: .82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes t5-swap { from { opacity: .45; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes t5-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.cf-trial-offer-5 .t5-tile,
.cf-trial-offer-5 .t5-after,
.cf-trial-offer-5 .t5-act-note,
.cf-trial-offer-5 .t5-spin { animation: none; }
.cf-trial-offer-5 .t5-btn,
.cf-trial-offer-5 .t5-opt,
.cf-trial-offer-5 .t5-thumb img { transition: none; }
.cf-trial-offer-5 .t5-btn:hover:not(:disabled),
.cf-trial-offer-5 .t5-btn[data-force="hover"],
.cf-trial-offer-5 .t5-btn:active:not(:disabled),
.cf-trial-offer-5 .t5-btn[data-force="active"],
.cf-trial-offer-5 .t5-u:hover .t5-thumb img { transform: none; }
}
`
pieces/offer/trial-offer-5/specimen.tsx 67 lines
import __studioImageb6e6fec1 from "../assets/1b832e00f83dbabc.webp";
import __studioImage8fd367a1 from "../assets/0bfe10aa25712550.webp";
import __studioImage67bfc549 from "../assets/2c31c10d8cddde2c.webp";
import { TrialOffer5, type TrialOffer5State } from "../trial-offer-5"
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
export const states = ["default", "hover", "active", "disabled", "error"]
export default function TrialOffer5Specimen({ state = "default" }: { state?: TrialOffer5State }) {
return (
<TrialOffer5
state={state}
headline="Open the whole kitchen"
accent="for {trialPrice}"
reasons={[
"Every live cook-along is open from day one.",
"The whole recipe vault is yours to cook from.",
"You decide on day {trialDays}, not tonight.",
]}
trialPrice="$1"
trialDays={30}
monthlyPrice="$29"
yearlyPrice="$290"
yearlyFlag="Save $58"
receiptTitle="The Supper Club Kitchen"
unlocks={[
{
title: "Live cook-alongs",
detail: "Cook dinner alongside a chef and ask as you go.",
when: "Thursdays, 7pm",
image: slot(
"item-1",
__studioImageb6e6fec1
),
imageAlt: "A laptop on a kitchen counter showing a live cooking class beside fresh herbs and a sizzling pan",
},
{
title: "The recipe vault",
detail: "Every club recipe, open from day one.",
when: "Open all month",
image: slot(
"item-2",
__studioImage8fd367a1
),
imageAlt: "A tablet showing a grid of recipe photos next to a bowl of fresh pasta",
},
{
title: "Members’ Q&A night",
detail: "Bring your kitchen questions to the table.",
when: "Once a month, live",
image: slot(
"item-3",
__studioImage67bfc549
),
imageAlt: "A home cook at a kitchen island chatting on a laptop video call in the evening",
},
]}
cancelTitle="Cancel anytime"
cancelBody="Stop before day {trialDays} and you pay nothing more."
guarantee={defaults.sample.guarantee}
actionTitle="Pull up a chair for {trialPrice}"
ctaLabel="Send My {trialPrice} Kitchen Pass"
onAction={() => undefined}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalTrialOffer5 |
React.ReactNode |
Default "Open everything"
|
accent OptionalTrialOffer5 |
string |
Default "for {trialPrice}"
|
reasons OptionalTrialOffer5 |
string[] |
Default DEFAULT_REASONS
|
trialPrice OptionalTrialOffer5 |
string |
Default "$1"
|
trialDays OptionalTrialOffer5 |
number |
Default 30
|
monthlyPrice OptionalTrialOffer5 |
string |
Default "$29"
|
yearlyPrice OptionalTrialOffer5 |
string |
|
yearlyFlag OptionalTrialOffer5 |
string |
|
initialPlan OptionalTrialOffer5 |
TrialOffer5Plan |
|
receiptTitle OptionalTrialOffer5 |
string |
|
discountAmount OptionalTrialOffer5 |
string |
|
unlocks OptionalTrialOffer5 |
TrialOffer5Unlock[] |
Default DEFAULT_UNLOCKS
|
cancelSpot OptionalTrialOffer5 |
string |
Default shieldSpot
|
cancelTitle OptionalTrialOffer5 |
string |
Default "Cancel anytime"
|
cancelBody OptionalTrialOffer5 |
string |
Default "Stop before day {trialDays} and you pay nothing more."
|
guarantee OptionalTrialOffer5 |
string |
|
actionTitle OptionalTrialOffer5 |
string |
Default "Start your first month for {trialPrice}"
|
ctaLabel OptionalTrialOffer5 |
string |
Default "Send Me In for {trialPrice}"
|
loadingLabel OptionalTrialOffer5 |
string |
Default "Opening your first month…"
|
errorMessage OptionalTrialOffer5 |
string |
Default "We couldn’t start your trial and nothing was charged. Please try again."
|
disabledNote OptionalTrialOffer5 |
string |
Default "This trial isn’t open right now."
|
copy OptionalTrialOffer5 |
Partial<TrialOffer5Copy> |
|
state OptionalTrialOffer5 |
TrialOffer5State |
Default "default"
|
disabled OptionalTrialOffer5 |
boolean |
Default false
|
onAction OptionalTrialOffer5 |
(plan: TrialOffer5Plan) => void | Promise<void> |
|
onPlanChange OptionalTrialOffer5 |
(plan: TrialOffer5Plan) => void |
|
className OptionalTrialOffer5 |
string |
|
style OptionalTrialOffer5 |
React.CSSProperties |
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--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
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.
-
0bfe10aa25712550.webp
image/webp · 178 KB
-
1b832e00f83dbabc.webp
image/webp · 151 KB
-
2c31c10d8cddde2c.webp
image/webp · 100 KB
-
7d6f1c81c93d8f71.webp
image/webp · 18.2 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB