Trial Offer 1
Shows the trial price, billing timeline and cancellation terms before starting an offer.
Use it in a prompt
Use offer/trial-offer 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.tsx. - Import it and pass your copy and images (Props tab):
import { TrialOffer } from "@/components/funneldna/offer/trial-offer"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/trial-offer/component.tsx 407 lines
// Shows the trial price, billing timeline and cancellation terms before starting an offer.
import * as React from "react"
import { CalendarCheck as CalendarCheckIcon, CalendarDays as CalendarDaysIcon, CreditCard as CardIcon, Download as DownloadIcon, BadgeCheck as KeepIcon, LoaderCircle as SpinnerIcon, CircleAlert as AlertIcon, Lock as LockIcon, ShieldCheck as ShieldIcon } from "lucide-react"
export type TrialOfferProps = {
headline?: string
accent?: string
lead?: string
/** One 3D product shot on a transparent background, shown large in the header. */
productImage?: string
productImageAlt?: string
/** Legacy product image; productImage takes precedence. */
image?: TrialImage
/** Fallback when there is no product shot: up to three item thumbnails, fanned. */
images?: TrialImage[]
trialPrice?: string
todayLabel?: string
trialLength?: string
valueLabel?: string
regularValue?: string
planTitle?: string
steps?: TrialStep[]
cancelLine?: string
ctaLabel?: string
ctaNote?: string
loadingLabel?: string
guarantee?: string
secureLabel?: string
errorMessage?: string
disabledNote?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
successTitle?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
successBody?: string
/** Deprecated: ignored. The builder wires what happens after the action. */
chargeReceipt?: string
/** "success" is accepted for older callers and renders as default. */
state?: TrialOfferState
disabled?: boolean
/** Action click; takes precedence over onStart. Without either the button does nothing visible. */
onAction?: () => void | Promise<void>
/** Legacy action alias. */
onStart?: () => void | Promise<void>
className?: string
style?: React.CSSProperties
}
export function TrialOffer({
headline = "Try the complete kit for",
accent = "just\u00a0$1",
lead = "Start today, use everything for 14 days, then decide.",
productImage,
productImageAlt,
image,
images = [],
trialPrice = "$1",
todayLabel = "Today",
trialLength = "14-day trial",
valueLabel = "Regular price",
regularValue,
planTitle = "Exactly what you\u2019ll pay",
steps = DEFAULT_STEPS,
cancelLine = "Cancel any time before day 14 and you pay nothing more.",
ctaLabel = "Start My $1 Trial",
ctaNote = "$1 today \u00b7 $47 on day 14 only if you keep it",
loadingLabel = "Starting your trial\u2026",
guarantee,
secureLabel = "",
errorMessage = "We couldn\u2019t start your trial and nothing was charged. Please try again.",
disabledNote = "This trial isn\u2019t open right now.",
state = "default",
disabled = false,
onStart,
onAction = onStart,
className,
style,
}: TrialOfferProps) {
const titleId = React.useId()
const [status, setStatus] = React.useState<"idle" | "loading" | "error">("idle")
React.useEffect(() => {
setStatus("idle")
}, [state])
const forcedView = state === "error" || state === "loading" ? state : "idle"
const view = status !== "idle" ? status : forcedView
const isDisabled = disabled || state === "disabled"
const loading = view === "loading"
const force = status === "idle" && (state === "hover" || state === "active") ? state : undefined
const shot = { src: productImage ?? image?.src, alt: productImageAlt ?? image?.alt ?? "" }
const fan = (images || []).filter(Boolean).map(item => ({ ...item, src: item.itemImage ?? item.src })).filter(item => item.src).slice(0, 3)
async function handleStart(event: React.MouseEvent<HTMLButtonElement>) {
event.preventDefault()
if (isDisabled || loading || !onAction) return
setStatus("loading")
try {
await onAction()
setStatus("idle")
} catch {
setStatus("error")
}
}
return (
<div className={`cf-trial-offer${className ? ` ${className}` : ""}`} style={style}>
<style>{CSS}</style>
<article className="tro-card" aria-labelledby={titleId}>
<header className="tro-head">
<div className="tro-head-copy">
<h2 id={titleId} className="tro-title">
{headline}
{accent ? (
<>
{" "}
<span className="tro-title-accent">{accent}</span>
</>
) : null}
</h2>
{lead ? <p className="tro-lead">{lead}</p> : null}
</div>
{shot.src ? (
<figure className="tro-shot" style={{ margin: undefined }}>
<img src={shot.src} alt={shot.alt} width={480} height={480} decoding="async" />
</figure>
) : fan.length > 0 ? (
<div className="tro-fan">
{fan.map((item, index) => (
<figure className="tro-fan-tile" key={`${index}-${item.alt}`}>
<img src={item.src} alt={item.alt} width={180} height={180} decoding="async" />
</figure>
))}
</div>
) : null}
</header>
<div className="tro-body">
<div className="tro-plate">
<div className="tro-today">
<span className="tro-price">{trialPrice}</span>
<span className="tro-today-meta">
<span className="tro-today-label">{todayLabel}</span>
{trialLength ? (
<span className="tro-trial-badge">
<CalendarDaysIcon aria-hidden="true" />
{trialLength}
</span>
) : null}
</span>
</div>
{regularValue ? (
<div className="tro-anchor">
<span className="tro-anchor-label">{valueLabel}</span>
<s className="tro-anchor-value">{regularValue}</s>
</div>
) : null}
</div>
<section className="tro-plan" aria-label={planTitle}>
<h3 className="tro-plan-title">{planTitle}</h3>
<ol className="tro-steps">
{steps.map((step, index) => {
const kind = step.kind ?? "start"
const NodeIcon = NODE_ICONS[kind] ?? NoIcon
return (
<li
className="tro-step"
key={`${index}-${step.when}`}
data-kind={kind}
data-highlight={step.highlight ? "" : undefined}
>
<span className="tro-node" aria-hidden="true">
<NodeIcon />
</span>
<span className="tro-step-copy">
<span className="tro-when">{step.when}</span>
<span className="tro-step-title">{step.title}</span>
{step.detail ? <span className="tro-step-detail">{step.detail}</span> : null}
</span>
<span className="tro-amount">{step.amount}</span>
</li>
)
})}
</ol>
{cancelLine ? (
<p className="tro-cancel">
<CalendarCheckIcon aria-hidden="true" />
<span>{cancelLine}</span>
</p>
) : null}
</section>
<div className="tro-action">
{(
<>
{view === "error" ? (
<p className="tro-error" role="alert">
<AlertIcon aria-hidden="true" />
<span>{errorMessage}</span>
</p>
) : null}
<button
type="button"
className="tro-btn"
onClick={handleStart}
disabled={isDisabled}
aria-busy={loading || undefined}
data-force={force}
data-loading={loading ? "" : undefined}
>
{loading ? (
<>
<SpinnerIcon className="tro-spin" aria-hidden="true" />
<span className="tro-btn-label">{loadingLabel}</span>
</>
) : (
<>
<span className="tro-btn-label">{ctaLabel}</span>
</>
)}
</button>
<p className="tro-note">{isDisabled ? disabledNote : ctaNote}</p>
{guarantee || secureLabel ? (
<ul className="tro-trust">
{guarantee ? (
<li>
<ShieldIcon className="tro-ok" aria-hidden="true" />
<span>{guarantee}</span>
</li>
) : null}
{secureLabel ? (
<li>
<LockIcon aria-hidden="true" />
<span>{secureLabel}</span>
</li>
) : null}
</ul>
) : null}
</>
)}
</div>
</div>
</article>
</div>
)
}
export default TrialOffer
type IconC = React.ComponentType<{ className?: string; "aria-hidden"?: boolean | "true" | "false" }>
const NoIcon: IconC = () => null
export type TrialOfferState = "default" | "hover" | "active" | "disabled" | "loading" | "error" | "success"
export type TrialStep = {
when: string
amount: string
title: string
detail?: string
kind?: "start" | "charge" | "after"
highlight?: boolean
}
export type TrialImage = { itemImage?: string; /** Legacy image alias. */ src?: string; alt: string }
const DEFAULT_STEPS: TrialStep[] = [
{ when: "Today", amount: "$1", title: "Full access starts now", detail: "Everything in the offer unlocks the moment you start.", kind: "start" },
{ when: "Day 14", amount: "$47", title: "One payment, only if you keep it", detail: "Charged once to the same card when your trial ends.", kind: "charge", highlight: true },
{ when: "After that", amount: "$0", title: "Yours to keep", detail: "No subscription. Nothing else to pay.", kind: "after" },
]
const NODE_ICONS: Record<"start" | "charge" | "after", IconC> = {
start: DownloadIcon,
charge: CardIcon,
after: KeepIcon,
}
const CSS = `
.cf-trial-offer{--tro-node:2.375rem;--tro-pad:.75rem;--tro-row:.875rem;container-type:inline-size;position:relative;width:100%;max-width:40rem;margin-inline:auto;color:var(--ink,#101828);font-family:var(--font-body,Arial,sans-serif);text-align:left;--tro-radius:var(--card-radius,var(--radius,14px));--tro-gold:var(--band-ink);--tro-marker:var(--warning-soft);--tro-marker-edge:var(--card-border,oklch(from var(--ink) l c h / 0.12));--tro-charge:var(--warning);--tro-line:var(--card-border,oklch(from var(--ink) l c h / 0.13));}
.cf-trial-offer *,.cf-trial-offer *::before,.cf-trial-offer *::after{box-sizing:border-box}
:where(.cf-trial-offer) .tro-card{position:relative;overflow:hidden;border:1px solid color-mix(in oklch,var(--band,#0f2747) 26%,var(--card));background:var(--card);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius));box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)));}
:where(.cf-trial-offer) .tro-head{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:1rem;padding:1.5rem 1.5rem 3.75rem;background:var(--band,#0f2747);color:var(--band-ink,var(--card));box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .1),inset 0 1px 3px oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / 0.35)}
:where(.cf-trial-offer) .tro-head-copy{position:relative;z-index:1;flex:1;min-width:0}
:where(.cf-trial-offer) .tro-title{margin:0;color:inherit;font-family:var(--font-display,Arial,sans-serif);font-size:clamp(2rem,8cqi,2.875rem);line-height:1.02;text-wrap:balance;font-weight:var(--display-weight,900);letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);}
:where(.cf-trial-offer) .tro-title-accent{color:var(--tro-gold);white-space:nowrap}
:where(.cf-trial-offer) .tro-lead{margin:.875rem 0 0;max-width:36ch;color:var(--band-ink);font-size:1.0625rem;font-weight:500;line-height:1.5;text-wrap:pretty}
:where(.cf-trial-offer) .tro-shot{position:relative;flex:none;order:-1;align-self:center;width:min(15.5rem,76%);margin:-.5rem 0 -.75rem}
:where(.cf-trial-offer) .tro-shot::before{content:'';position:absolute;inset:14% 10% 18%;border-radius:50%;opacity:.75;background:transparent;filter:none;}
:where(.cf-trial-offer) .tro-shot::after{content:'';position:absolute;left:16%;right:16%;bottom:7%;height:10%;border-radius:50%;filter:blur(12px);background:oklch(from var(--band) l c h / 0.55);}
:where(.cf-trial-offer) .tro-shot img{position:relative;z-index:1;display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));transition:transform .5s cubic-bezier(.2,.8,.2,1)}
:where(.cf-trial-offer) .tro-fan{position:relative;flex:none;order:-1;align-self:center;width:12rem;height:6.75rem}
:where(.cf-trial-offer) .tro-fan-tile{position:absolute;bottom:0;width:5.25rem;aspect-ratio:1;margin:0;padding:.3rem;border-radius:.8rem;transition:transform .4s cubic-bezier(.2,.8,.2,1);background:transparent;box-shadow:none;}
:where(.cf-trial-offer) .tro-fan-tile img{display:block;width:100%;height:100%;border-radius:.55rem;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));}
:where(.cf-trial-offer) .tro-fan-tile:nth-child(1){left:0;transform:rotate(-9deg)}
:where(.cf-trial-offer) .tro-fan-tile:nth-child(2){left:calc(50% - 2.625rem);z-index:2;transform:translateY(-.5rem)}
:where(.cf-trial-offer) .tro-fan-tile:nth-child(3){right:0;transform:rotate(9deg)}
:where(.cf-trial-offer) .tro-body{position:relative;padding:0 1.25rem 1.5rem}
:where(.cf-trial-offer) .tro-plate{position:relative;z-index:2;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.875rem 1.25rem;margin-top:-2.5rem;padding:1.125rem 1.25rem;border:1px solid oklch(from var(--ink) l c h / 0.08);background:color-mix(in oklch,var(--ink) 4%,var(--card));border-radius:var(--card-radius,var(--radius));}
:where(.cf-trial-offer) .tro-today{display:flex;align-items:flex-end;gap:.875rem;min-width:0}
:where(.cf-trial-offer) .tro-price{color:var(--ink,#101828);font-family:var(--font-display,Arial,sans-serif);font-size:clamp(3.75rem,18cqi,5rem);font-weight:900;line-height:.86;letter-spacing:-.045em;font-variant-numeric:tabular-nums}
:where(.cf-trial-offer) .tro-today-meta{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;padding-bottom:.2rem}
:where(.cf-trial-offer) .tro-today-label{color:var(--ink,#101828);font-size:.9375rem;font-weight:800;letter-spacing:.08em;line-height:1;text-transform:uppercase}
:where(.cf-trial-offer) .tro-trial-badge{display:inline-flex;align-items:center;gap:.4rem;padding:.4rem .8rem;border-radius:999px;background:var(--band,#0f2747);color:var(--band-ink,var(--card));font-size:.875rem;font-weight:800;line-height:1.1;white-space:nowrap;box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .16),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24)}
:where(.cf-trial-offer) .tro-trial-badge svg{width:1rem;height:1rem;flex:none}
:where(.cf-trial-offer) .tro-anchor{display:flex;flex-direction:column;align-items:flex-end;gap:.25rem;margin-left:auto;padding-bottom:.2rem;text-align:right}
:where(.cf-trial-offer) .tro-anchor-label{color:var(--muted,#4a5565);font-size:.875rem;font-weight:700;line-height:1.2}
:where(.cf-trial-offer) .tro-anchor-value{color:var(--danger);font-family:var(--font-display,Arial,sans-serif);font-size:1.5rem;font-weight:800;line-height:1.1;text-decoration:line-through;text-decoration-color:var(--danger);text-decoration-thickness:3px;font-variant-numeric:tabular-nums}
:where(.cf-trial-offer) .tro-plan{margin-top:1.625rem}
:where(.cf-trial-offer) .tro-plan-title{margin:0 0 .625rem;color:var(--ink,#101828);font-family:var(--font-display,Arial,sans-serif);font-size:1.3125rem;line-height:1.2;text-wrap:balance;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.01em);text-transform:var(--display-case,none);}
:where(.cf-trial-offer) .tro-steps{display:grid;gap:0;margin:0;padding:0;list-style:none}
:where(.cf-trial-offer) .tro-step{position:relative;display:grid;grid-template-columns:var(--tro-node) minmax(0,1fr) auto;align-items:start;gap:0 .875rem;padding:var(--tro-row) var(--tro-pad);border-radius:calc(var(--tro-radius) - 2px)}
:where(.cf-trial-offer) .tro-step::before,:where(.cf-trial-offer) .tro-step::after{content:'';position:absolute;left:calc(var(--tro-pad) + var(--tro-node) / 2 - 1.5px);width:3px;background:color-mix(in oklch,var(--band,#0f2747) 28%,var(--card));transform-origin:top}
:where(.cf-trial-offer) .tro-step::before{top:0;height:calc(var(--tro-row) + var(--tro-node) / 2)}
:where(.cf-trial-offer) .tro-step::after{top:calc(var(--tro-row) + var(--tro-node) / 2);bottom:0}
:where(.cf-trial-offer) .tro-step:first-child::before,:where(.cf-trial-offer) .tro-step:last-child::after{display:none}
:where(.cf-trial-offer) .tro-step[data-highlight]{background:var(--tro-marker);box-shadow:var(--card-shadow,inset 0 0 0 1px var(--tro-marker-edge));}
:where(.cf-trial-offer) .tro-step[data-highlight]::before,:where(.cf-trial-offer) .tro-step[data-highlight]::after{background:var(--warning)}
:where(.cf-trial-offer) .tro-node{position:relative;z-index:1;display:grid;place-items:center;width:var(--tro-node);height:var(--tro-node);border-radius:999px;background:var(--band,#0f2747);color:var(--band-ink,var(--card));box-shadow:0 0 0 4px var(--card,var(--card)),inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .18),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24)}
:where(.cf-trial-offer) .tro-step[data-kind=charge] .tro-node{background:var(--warning-soft);color:var(--warning);}
:where(.cf-trial-offer) .tro-step[data-kind=after] .tro-node{background:var(--success-soft);color:var(--success);}
:where(.cf-trial-offer) .tro-step[data-highlight] .tro-node{box-shadow:0 0 0 4px var(--tro-marker),inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .18),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24)}
:where(.cf-trial-offer) .tro-node svg{width:1.1875rem;height:1.1875rem;stroke-width:2.25}
:where(.cf-trial-offer) .tro-step-copy{min-width:0;padding-top:.1rem}
:where(.cf-trial-offer) .tro-when{display:block;color:var(--muted,#4a5565);font-size:.875rem;font-weight:800;letter-spacing:.07em;line-height:1.2;text-transform:uppercase}
:where(.cf-trial-offer) .tro-step[data-highlight] .tro-when{;color:var(--ink);}
:where(.cf-trial-offer) .tro-step-title{display:block;margin-top:.3rem;color:var(--ink,#101828);font-size:1.0625rem;font-weight:800;line-height:1.3;text-wrap:pretty}
:where(.cf-trial-offer) .tro-step-detail{display:block;margin-top:.25rem;color:var(--muted,#4a5565);font-size:.9375rem;font-weight:500;line-height:1.45;text-wrap:pretty}
:where(.cf-trial-offer) .tro-amount{padding-top:.1rem;color:var(--ink,#101828);font-family:var(--font-display,Arial,sans-serif);font-size:1.625rem;font-weight:900;line-height:1.05;letter-spacing:-.02em;white-space:nowrap;font-variant-numeric:tabular-nums}
:where(.cf-trial-offer) .tro-cancel{display:flex;align-items:flex-start;gap:.75rem;margin:1rem 0 0;padding:.9375rem 1rem;border:1px solid var(--warning);color:var(--ink,#101828);font-size:1rem;font-weight:700;line-height:1.45;text-wrap:pretty;background:var(--card);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius));}
:where(.cf-trial-offer) .tro-cancel svg{flex:none;width:1.375rem;height:1.375rem;margin-top:.05rem;color:var(--warning)}
:where(.cf-trial-offer) .tro-action{display:grid;gap:.75rem;margin-top:1.375rem}
:where(.cf-trial-offer) .tro-btn{position:relative;isolation:isolate;display:inline-flex;width:100%;min-height:4.125rem;align-items:center;justify-content:center;gap:.625rem;overflow:hidden;padding:.9rem 1.25rem;border:1px solid var(--cta-2,#b42318);letter-spacing:-.005em;text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease;-webkit-tap-highlight-color:transparent;background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));color:var(--button-ink,var(--cta-ink));border-color:var(--button-bg-2,var(--cta-2));border-radius:var(--button-radius,var(--radius));font:var(--button-weight,900) clamp(1.25rem,5cqi,1.5rem)/1 var(--button-font,var(--font-display));text-transform:var(--button-case,none);box-shadow:var(--button-shadow, inset 0 -2px 0 oklch(from var(--surface) min(0.24, calc(l - 0.12)) c h / .16),0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));}
:where(.cf-trial-offer) .tro-btn::after{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;transform:translateX(-120%);pointer-events:none;background:linear-gradient(105deg,transparent 35%,oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h / 0.14) 50%,transparent 65%);}
:where(.cf-trial-offer) .tro-btn-label{min-width:0;text-align:center;white-space:normal;text-wrap:balance}
:where(.cf-trial-offer) .tro-btn[data-force=hover]{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, 0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));}
:where(.cf-trial-offer) .tro-btn[data-force=active],:where(.cf-trial-offer) .tro-btn:not(:disabled):active{transform:translateY(3px);filter:none;box-shadow:var(--button-shadow, 0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));}
:where(.cf-trial-offer) .tro-btn:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:3px}
:where(.cf-trial-offer) .tro-btn[data-loading]{cursor:progress}
:where(.cf-trial-offer) .tro-btn:disabled{cursor:not-allowed;text-shadow:none;filter:none;transform:none;background:var(--button-2-bg,var(--card));color:var(--button-2-ink,var(--ink));border-color:var(--button-2-border,oklch(from var(--ink) l c h / 0.22));border-radius:var(--button-radius,var(--radius));box-shadow:var(--button-shadow, none);}
:where(.cf-trial-offer) .tro-spin{flex:none;width:1.375rem;height:1.375rem}
:where(.cf-trial-offer) .tro-note{margin:0;color:var(--ink,#101828);font-size:.9375rem;font-weight:700;line-height:1.4;text-align:center;text-wrap:pretty}
:where(.cf-trial-offer) .tro-trust{display:flex;flex-wrap:wrap;justify-content:center;gap:.5rem 1.25rem;margin:0;padding:0;list-style:none;color:var(--muted,#4a5565);font-size:.875rem;font-weight:700;line-height:1.3}
:where(.cf-trial-offer) .tro-trust li{display:inline-flex;align-items:center;gap:.4rem}
:where(.cf-trial-offer) .tro-trust svg{flex:none;width:1.0625rem;height:1.0625rem}
:where(.cf-trial-offer) .tro-trust .tro-ok{;color:var(--success);}
:where(.cf-trial-offer) .tro-error{display:flex;align-items:flex-start;gap:.625rem;margin:0;padding:.75rem .875rem;border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));font-size:.9375rem;font-weight:700;line-height:1.4;text-wrap:pretty;background:var(--danger-soft);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius));color:var(--danger);}
:where(.cf-trial-offer) .tro-error svg{flex:none;width:1.25rem;height:1.25rem;margin-top:.05rem}
@container (max-width:30rem){
:where(.cf-trial-offer) .tro-anchor{flex:1 0 100%;flex-direction:row;align-items:center;justify-content:space-between;margin-left:0;padding:.5rem .75rem;border-radius:calc(var(--tro-radius) - 6px);background:color-mix(in oklch,var(--band,#0f2747) 5%,var(--card));text-align:left}
:where(.cf-trial-offer) .tro-anchor-value{font-size:1.25rem}
}
@container (min-width:34rem){
.cf-trial-offer{--tro-pad:1rem}
:where(.cf-trial-offer) .tro-head{flex-direction:row;align-items:flex-start;justify-content:space-between;gap:1.25rem;padding:2.25rem 2rem 4.25rem}
:where(.cf-trial-offer) .tro-shot{order:0;align-self:flex-start;width:14.5rem;margin:-1rem -.75rem -2rem 0}
:where(.cf-trial-offer) .tro-fan{order:0;align-self:flex-start;width:11.75rem;height:8.5rem;margin-top:.5rem}
:where(.cf-trial-offer) .tro-fan-tile{width:5.5rem}
:where(.cf-trial-offer) .tro-fan-tile:nth-child(2){left:calc(50% - 2.75rem);transform:translateY(-1.25rem)}
:where(.cf-trial-offer) .tro-body{padding:0 2rem 2rem}
:where(.cf-trial-offer) .tro-plate{padding:1.25rem 1.5rem}
}
@media (hover:hover){
:where(.cf-trial-offer) .tro-btn:not(:disabled):not([data-loading]):hover{transform:translateY(-2px);filter:none;box-shadow:var(--button-shadow, 0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));}
:where(.cf-trial-offer) .tro-btn:not(:disabled):not([data-loading]):active{transform:translateY(3px)}
}
@media (prefers-reduced-motion:no-preference){
:where(.cf-trial-offer) .tro-card{animation:tro-in .5s cubic-bezier(.2,.8,.2,1) both}
:where(.cf-trial-offer) .tro-step{animation:tro-in .45s cubic-bezier(.2,.8,.2,1) both}
:where(.cf-trial-offer) .tro-step:nth-child(2){animation-delay:.08s}
:where(.cf-trial-offer) .tro-step:nth-child(3){animation-delay:.16s}
:where(.cf-trial-offer) .tro-step::before,:where(.cf-trial-offer) .tro-step::after{animation:tro-fill .45s cubic-bezier(.65,0,.35,1) both}
:where(.cf-trial-offer) .tro-step:nth-child(1)::after{animation-delay:.2s}
:where(.cf-trial-offer) .tro-step:nth-child(2)::before{animation-delay:.4s}
:where(.cf-trial-offer) .tro-step:nth-child(2)::after{animation-delay:.55s}
:where(.cf-trial-offer) .tro-step:nth-child(3)::before{animation-delay:.75s}
:where(.cf-trial-offer) .tro-spin{animation:tro-rotate .8s linear infinite}
:where(.cf-trial-offer) .tro-error{animation:tro-shake .35s ease both}
}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
:where(.cf-trial-offer) .tro-btn:not(:disabled):not([data-loading]):hover::after,:where(.cf-trial-offer) .tro-btn[data-force=hover]::after{transform:translateX(120%);transition:transform .75s ease}
:where(.cf-trial-offer) .tro-card:hover .tro-shot img{transform:translateY(-6px) rotate(-1deg)}
:where(.cf-trial-offer) .tro-card:hover .tro-fan-tile:nth-child(1){transform:rotate(-13deg) translateX(-.35rem)}
:where(.cf-trial-offer) .tro-card:hover .tro-fan-tile:nth-child(3){transform:rotate(13deg) translateX(.35rem)}
}
@media (prefers-reduced-motion:reduce){
:where(.cf-trial-offer) .tro-btn,:where(.cf-trial-offer) .tro-fan-tile,:where(.cf-trial-offer) .tro-shot img{transition:none}
}
@keyframes tro-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes tro-fill{from{transform:scaleY(0)}to{transform:scaleY(1)}}
@keyframes tro-rotate{to{transform:rotate(360deg)}}
@keyframes tro-shake{0%,100%{transform:none}30%{transform:translateX(-4px)}60%{transform:translateX(3px)}}
`
pieces/offer/trial-offer/specimen.tsx 65 lines
import __studioImage4935fa60 from "../assets/e9f2008844519635.webp";
import * as React from "react"
import { TrialOffer } from "../trial-offer"
import type { TrialOfferState } from "../trial-offer"
import { slot } from "../../slots"
import defaults from "../../studio-defaults.json"
export const states = ["default", "hover", "active", "disabled", "error"]
const sample = defaults.sample
export default function TrialOfferSpecimen({ state = "default" }: { state?: string }) {
const items = sample.items
const guide = items[0]
const workbook = items[1]
const checklist = items[2]
return (
<TrialOffer
state={state as TrialOfferState}
headline="Try the complete kit for"
accent={"just\u00a0$1"}
lead={`Get ${sample.name} today. Use the guide, workbook, and checklist for 14 days, then decide.`}
productImage={slot("product", __studioImage4935fa60)}
productImageAlt={`${sample.name}: ${guide.name}, ${workbook.name}, and ${checklist.name}`}
images={items.map((item, i) => ({ itemImage: slot(`item-${i + 1}`, item.image), alt: item.imageAlt }))}
trialPrice="$1"
todayLabel="Today"
trialLength="14-day trial"
valueLabel="Regular price"
regularValue={sample.regularPrice}
planTitle={"Exactly what you\u2019ll pay"}
steps={[
{
when: "Today",
amount: "$1",
title: "Instant access to the full kit",
detail: `Download the ${guide.name}, ${workbook.name}, and ${checklist.name}.`,
kind: "start",
},
{
when: "Day 14",
amount: sample.price,
title: "One payment, only if you keep it",
detail: "Charged once to the same card when your trial ends.",
kind: "charge",
highlight: true,
},
{
when: "After that",
amount: "$0",
title: "Lifetime access",
detail: "No subscription. Nothing else to pay.",
kind: "after",
},
]}
cancelLine={`Cancel any time before day 14 and the ${sample.price} is never charged.`}
ctaLabel="Start My $1 Trial"
ctaNote={`$1 today \u00b7 ${sample.price} on day 14 only if you keep it`}
guarantee={sample.guarantee}
secureLabel="Secure checkout"
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalTrialOffer |
string |
Default "Try the complete kit for"
|
accent OptionalTrialOffer |
string |
Default "just\u00a0$1"
|
lead OptionalTrialOffer |
string |
Default "Start today, use everything for 14 days, then decide."
|
productImage OptionalTrialOffer |
string |
|
productImageAlt OptionalTrialOffer |
string |
|
image OptionalTrialOffer |
TrialImage |
|
images OptionalTrialOffer |
TrialImage[] |
Default []
|
trialPrice OptionalTrialOffer |
string |
Default "$1"
|
todayLabel OptionalTrialOffer |
string |
Default "Today"
|
trialLength OptionalTrialOffer |
string |
Default "14-day trial"
|
valueLabel OptionalTrialOffer |
string |
Default "Regular price"
|
regularValue OptionalTrialOffer |
string |
|
planTitle OptionalTrialOffer |
string |
Default "Exactly what you\u2019ll pay"
|
steps OptionalTrialOffer |
TrialStep[] |
Default DEFAULT_STEPS
|
cancelLine OptionalTrialOffer |
string |
Default "Cancel any time before day 14 and you pay nothing more."
|
ctaLabel OptionalTrialOffer |
string |
Default "Start My $1 Trial"
|
ctaNote OptionalTrialOffer |
string |
Default "$1 today \u00b7 $47 on day 14 only if you keep it"
|
loadingLabel OptionalTrialOffer |
string |
Default "Starting your trial\u2026"
|
guarantee OptionalTrialOffer |
string |
|
secureLabel OptionalTrialOffer |
string |
Default ""
|
errorMessage OptionalTrialOffer |
string |
Default "We couldn\u2019t start your trial and nothing was charged. Please try again."
|
disabledNote OptionalTrialOffer |
string |
Default "This trial isn\u2019t open right now."
|
successTitle OptionalTrialOffer |
string |
|
successBody OptionalTrialOffer |
string |
|
chargeReceipt OptionalTrialOffer |
string |
|
state OptionalTrialOffer |
TrialOfferState |
Default "default"
|
disabled OptionalTrialOffer |
boolean |
Default false
|
onAction OptionalTrialOffer |
() => void | Promise<void> |
Default onStart
|
onStart OptionalTrialOffer |
() => void | Promise<void> |
|
className OptionalTrialOffer |
string |
|
style OptionalTrialOffer |
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-border--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.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-*- One image per offer item (item-1, item-2…), shown in stacks and lists.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e9f2008844519635.webp
image/webp · 163 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB