Trial Offer 3
Trial offer that closes by transparency: the four billing questions a buyer has, each answered in one plain line beside a product photo, with today's receipt, the exact reminder date and the start-trial button as the last answer.
Use it in a prompt
Use offer/trial-offer-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/trial-offer-3.tsx. - Import it and pass your copy and images (Props tab):
import { TrialOffer3 } from "@/components/funneldna/offer/trial-offer-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/trial-offer-3/component.tsx 527 lines
// layout: interview-qa
// Trial offer that closes by transparency: the four billing questions a buyer has, each answered in one plain line beside a product photo, with today's receipt, the exact reminder date and the start-trial button as the last answer.
import * as React from 'react'
import { CircleAlert as AlertIcon, LoaderCircle as SpinnerIcon } from 'lucide-react'
import { Spot } from '../fx/fx'
import calendar from '../fx/spots/calendar'
export type TrialOffer3State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
/** One line on today's receipt, e.g. { label: '14-day pouch', amount: '$29' }. */
export type TrialOffer3ReceiptItem = { label: string; amount: string }
/** Every other visible word. Templates: {trialPrice}, {trialDays}, {chargeAmount}, {chargeDetail}, {chargeDate}, {reminderDays}, {reminderDate}, {reminderChannel}. */
export type TrialOffer3Copy = { [K in keyof typeof DEFAULT_COPY]: string }
export type TrialOffer3Props = {
/** Headline before the marker phrase; supports the templates. */
headline?: string
/** Phrase swiped with the marker; supports the templates. */
accent?: string
lead?: string
/** Product scene photo beside the answers (slot 'scene'); crops to a short banner on phones. */
sceneImage?: string
sceneImageAlt?: string
/** Plain line under the photo; omitted when empty. */
sceneCaption?: string
/** Paid today to start the trial. The first answer hides when empty. */
trialPrice?: string
/** Trial length in days; sets the charge and reminder dates. */
trialDays?: number
/** Lines on today's receipt. Subtotal and trial discount are worked out when every amount is plain money in one currency. */
receiptItems?: TrialOffer3ReceiptItem[]
/** Next charge after the trial. The second answer hides when empty. */
chargeAmount?: string
/** Words after the charge amount, e.g. 'for a 30-day pouch, then every 30 days'. */
chargeDetail?: string
/** How to cancel, in one plain line; supports the templates. The third answer hides when empty. */
cancelMethod?: string
/** Days before the charge that the reminder goes out. The fourth answer hides when null. */
reminderDaysBefore?: number | null
/** How the reminder arrives, used as a verb: 'email', 'email and text'. */
reminderChannel?: string
/** Day the trial starts; defaults to today. */
startDate?: Date | string
/** Locale for the computed dates and receipt sums. */
locale?: string
/** Button label, the last answer; supports the templates. */
ctaLabel?: string
/** Button label while onAction is pending. */
loadingLabel?: string
/** Line after the P.S. label under the button; supports the templates; omitted when empty. */
ps?: string
/** Shown when onAction rejects or state is 'error'. */
errorMessage?: string
/** Shown under the button when it is disabled. */
disabledNote?: string
copy?: Partial<TrialOffer3Copy>
state?: TrialOffer3State
disabled?: boolean
/** Checkout destination; the button becomes a link. */
href?: string
/** Start-trial click. The builder wires what happens next; a rejected promise shows the error line. */
onAction?: () => void | Promise<void>
className?: string
style?: React.CSSProperties
}
type Phase = 'idle' | 'loading' | 'error'
type Row = { key: string; q: string; a: React.ReactNode; act?: boolean }
export function TrialOffer3({
headline = 'Your {trialPrice} trial,',
accent = 'minus the fine print',
lead = 'Four questions everyone asks before a trial. Here are the straight answers.',
sceneImage,
sceneImageAlt = '',
sceneCaption,
trialPrice = '$1',
trialDays = 14,
receiptItems = [],
chargeAmount = '$47',
chargeDetail = 'once, only if you keep it',
cancelMethod = 'Cancel from your account before {chargeDate} and you pay nothing more.',
reminderDaysBefore = 3,
reminderChannel = 'email',
startDate,
locale = 'en-US',
ctaLabel = 'I’m in, start my {trialPrice} trial',
loadingLabel = 'Starting your trial…',
ps = 'Everything you pay, and when, is right here on this page.',
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,
href,
onAction,
className,
style,
}: TrialOffer3Props) {
const t: TrialOffer3Copy = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const titleId = uid + '-title'
const statusId = uid + '-status'
const psId = uid + '-ps'
const [phase, setPhase] = React.useState<Phase>(state === 'error' ? 'error' : 'idle')
const [mode, setMode] = React.useState<'reminder' | 'charge'>('reminder')
const alive = React.useRef(true)
const pending = React.useRef(false)
React.useEffect(() => {
setPhase(state === 'error' ? 'error' : 'idle')
}, [state])
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const days = typeof trialDays === 'number' && Number.isFinite(trialDays) && trialDays > 0 ? Math.round(trialDays) : 0
const remind = typeof reminderDaysBefore === 'number' && Number.isFinite(reminderDaysBefore) && reminderDaysBefore >= 0 ? Math.round(reminderDaysBefore) : null
const start = toDay(startDate)
const chargeOn = addDays(start, days)
const remindOn = remind === null || !days ? null : addDays(start, Math.max(0, days - remind))
const shortDate = dateFormat(locale, { weekday: 'short', month: 'short', day: 'numeric' })
const monthDay = dateFormat(locale, { month: 'short', day: 'numeric' })
const weekday = dateFormat(locale, { weekday: 'long' })
const values: Record<string, string> = {
trialPrice: trialPrice ?? '',
trialDays: String(days),
chargeAmount: chargeAmount ?? '',
chargeDetail: chargeDetail ?? '',
chargeDate: days ? shortDate.format(chargeOn) : '',
reminderDays: remind === null ? '' : String(remind),
reminderDate: remindOn ? shortDate.format(remindOn) : '',
reminderChannel: reminderChannel ?? '',
}
const fill = (text: string) => keepNumberHyphens(fillTemplate(text, values))
const isDisabled = disabled || state === 'disabled'
const busy = phase === 'loading'
const force = !isDisabled && phase === 'idle' && (state === 'hover' || state === 'active') ? state : undefined
const handleStart = async () => {
if (isDisabled || busy || pending.current || !onAction) return
pending.current = true
setPhase('loading')
try {
await onAction()
if (alive.current) setPhase('idle')
} catch {
if (alive.current) setPhase('error')
} finally {
pending.current = false
}
}
const lines = (receiptItems || []).filter((item) => item && item.label && item.amount)
const sums = lines.length && trialPrice ? receiptSums(lines, trialPrice, locale) : null
const receipt = lines.length ? (
<ul className='t3-receipt' aria-label={t.receiptLabel}>
{lines.map((item, index) => (
<li key={item.label + index} className='t3-r'>
<span className='t3-r-label'>{keepNumberHyphens(item.label)}</span>
<span className='t3-amt'>{item.amount}</span>
</li>
))}
{sums ? (
<li className='t3-r t3-r--sub'>
<span className='t3-r-label'>{t.subtotalLabel}</span>
<span className='t3-amt'>{sums.subtotal}</span>
</li>
) : null}
{sums && sums.discount ? (
<li className='t3-r t3-r--off'>
<span className='t3-r-label'>{t.discountLabel}</span>
<span className='t3-amt'>{sums.discount}</span>
</li>
) : null}
<li className='t3-r t3-r--total'>
<span className='t3-r-label'>{t.totalLabel}</span>
<span className='t3-amt'>{trialPrice}</span>
</li>
</ul>
) : null
const hasCharge = Boolean(chargeAmount && days)
const shown = mode === 'charge' && hasCharge ? 'charge' : 'reminder'
const faceDate = shown === 'charge' ? chargeOn : remindOn
const cancelText = cancelMethod ? fill(cancelMethod) : ''
const rows: Row[] = []
if (trialPrice) {
rows.push({
key: 'today',
q: fill(t.qToday),
a: (
<>
<p className='t3-line'>{fill(t.aToday)}</p>
{receipt}
</>
),
})
}
if (hasCharge) {
rows.push({ key: 'charge', q: fill(t.qCharge), a: <p className='t3-line'>{fill(t.aCharge)}</p> })
}
if (cancelText) {
rows.push({ key: 'cancel', q: fill(t.qCancel), a: <p className='t3-line'>{cancelText}</p> })
}
if (remindOn && faceDate) {
rows.push({
key: 'forget',
q: fill(t.qForget),
a: (
<>
<p className='t3-line'>{fill(t.aForget)}</p>
<div className='t3-cal'>
<span className='t3-spot' aria-hidden='true'>
<Spot src={calendar} size={72} />
</span>
<div aria-live='polite'>
<div className='t3-face' key={shown}>
<p className='t3-when'>
{shown === 'charge' ? t.chargeWhen : t.reminderWhen} · {weekday.format(faceDate)}
</p>
<p className='t3-date'>
<time dateTime={isoDay(faceDate)}>{monthDay.format(faceDate)}</time>
</p>
<p className='t3-note'>{fill(shown === 'charge' ? t.chargeNote : t.reminderNote)}</p>
</div>
</div>
{hasCharge ? (
<div className='t3-toggle' role='group' aria-label={t.toggleLabel}>
<button type='button' className='t3-tab' aria-pressed={shown === 'reminder'} onClick={() => setMode('reminder')}>
{t.reminderTab}
</button>
<button type='button' className='t3-tab' aria-pressed={shown === 'charge'} onClick={() => setMode('charge')}>
{t.chargeTab}
</button>
</div>
) : null}
</div>
</>
),
})
}
const showStatus = phase === 'error' || isDisabled
const describedBy = [showStatus ? statusId : '', ps ? psId : ''].filter(Boolean).join(' ') || undefined
const label = busy ? (
<>
<SpinnerIcon className='t3-spin' aria-hidden='true' strokeWidth={2.5} />
<span>{loadingLabel}</span>
</>
) : (
<span>{fill(ctaLabel)}</span>
)
rows.push({
key: 'action',
act: true,
q: fill(t.qAction),
a: (
<>
{href && !isDisabled ? (
<a
className='t3-cta'
href={href}
data-force={force}
aria-describedby={describedBy}
onClick={() => {
if (onAction) void onAction()
}}
>
{label}
</a>
) : (
<button
type='button'
className='t3-cta'
data-force={force}
disabled={isDisabled}
aria-busy={busy || undefined}
aria-describedby={describedBy}
onClick={handleStart}
>
{label}
</button>
)}
{phase === 'error' ? (
<p id={statusId} className='t3-status' data-tone='error' role='alert'>
<AlertIcon aria-hidden='true' strokeWidth={2.5} />
{errorMessage}
</p>
) : isDisabled ? (
<p id={statusId} className='t3-status'>
{disabledNote}
</p>
) : null}
{ps ? (
<p id={psId} className='t3-ps'>
<strong>{t.psLabel}</strong> {fill(ps)}
</p>
) : null}
</>
),
})
return (
<section className={['cf-trial-offer-3', className].filter(Boolean).join(' ')} style={style} aria-labelledby={titleId}>
<style>{CSS}</style>
{sceneImage ? <span className='t3-block' aria-hidden='true' /> : null}
<div className={sceneImage ? 't3-wrap' : 't3-wrap t3-wrap--solo'}>
{sceneImage ? (
<figure className='t3-media'>
<img className='t3-photo' src={sceneImage} alt={sceneImageAlt} width={800} height={1000} loading='lazy' decoding='async' />
{sceneCaption ? <figcaption className='t3-cap'>{sceneCaption}</figcaption> : null}
</figure>
) : null}
<div className='t3-body'>
<h2 id={titleId} className='t3-title'>
{fill(headline)}
{accent ? (
<>
{' '}
<span className='t3-mark'>{fill(accent)}</span>
</>
) : null}
</h2>
{lead ? <p className='t3-lead'>{fill(lead)}</p> : null}
<dl className='t3-qa' aria-label={t.listLabel}>
{rows.map((row, index) => (
<div key={row.key} className={row.act ? 't3-row t3-row--act' : 't3-row'} style={{ '--t3-i': index } as React.CSSProperties}>
<dt className='t3-q'>
<span className='t3-n' aria-hidden='true'>
{index + 1}
</span>
<span>{row.q}</span>
</dt>
<dd className='t3-a'>{row.a}</dd>
</div>
))}
</dl>
</div>
</div>
</section>
)
}
export default TrialOffer3
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.replace(/ +([.,:;])/g, '$1').replace(/ {2,}/g, ' ').trim()
}
/** Keeps "14-day" and "30-day" together on narrow screens (non-breaking hyphen after a number). */
function keepNumberHyphens(text: string) {
return (text || '').replace(/(\d)-(?=[A-Za-z])/g, '$1\u2011')
}
function toDay(value?: Date | string) {
const raw = value instanceof Date ? value : value ? new Date(value) : new Date()
const day = Number.isNaN(raw.getTime()) ? new Date() : raw
return new Date(day.getFullYear(), day.getMonth(), day.getDate())
}
function addDays(day: Date, n: number) {
return new Date(day.getFullYear(), day.getMonth(), day.getDate() + n)
}
function isoDay(day: Date) {
const m = String(day.getMonth() + 1).padStart(2, '0')
const d = String(day.getDate()).padStart(2, '0')
return day.getFullYear() + '-' + m + '-' + d
}
function dateFormat(locale: string, options: Intl.DateTimeFormatOptions) {
try {
return new Intl.DateTimeFormat(locale, options)
} catch {
return new Intl.DateTimeFormat('en-US', options)
}
}
function parseMoney(value: string) {
const s = (value || '').trim()
let i = 0
while (i < s.length && (s[i] < '0' || s[i] > '9')) i++
const num = s.slice(i).split(',').join('')
if (!num || !/^[0-9]+([.][0-9]+)?$/.test(num)) return null
return { sym: s.slice(0, i).trim(), n: Number(num), dec: num.includes('.') ? 2 : 0 }
}
function formatNumber(n: number, dec: number, locale: string) {
try {
return n.toLocaleString(locale, { minimumFractionDigits: dec, maximumFractionDigits: dec })
} catch {
return n.toFixed(dec)
}
}
function receiptSums(items: TrialOffer3ReceiptItem[], total: string, locale: string) {
const today = parseMoney(total)
if (!today) return null
let sum = 0
let dec = today.dec
for (const item of items) {
const part = parseMoney(item.amount)
if (!part || part.sym !== today.sym) return null
sum += part.n
dec = Math.max(dec, part.dec)
}
const money = (n: number) => today.sym + formatNumber(n, dec, locale)
const off = Math.round((sum - today.n) * 100) / 100
return { subtotal: money(sum), discount: off > 0 ? '−' + money(off) : '' }
}
const DEFAULT_COPY = {
qToday: 'What do I pay today?',
aToday: 'Just {trialPrice} today. That covers your first {trialDays} days.',
qCharge: 'When am I charged next, and how much?',
aCharge: 'On {chargeDate}: {chargeAmount} {chargeDetail}.',
qCancel: 'How do I cancel?',
qForget: 'What if I forget?',
aForget: 'We {reminderChannel} you on {reminderDate}, {reminderDays} days before any charge.',
qAction: 'Ready to try it for {trialDays} days?',
subtotalLabel: 'Subtotal',
discountLabel: 'Trial discount',
totalLabel: 'Due today',
receiptLabel: 'What you pay today',
listLabel: 'Your trial, answered',
toggleLabel: 'Show the date of',
reminderTab: 'Reminder',
chargeTab: 'First charge',
reminderWhen: 'We remind you',
chargeWhen: 'We charge you',
reminderNote: '{reminderDays} days before any charge',
chargeNote: '{chargeAmount}, unless you cancel first',
psLabel: 'P.S.',
}
const CSS = `
.cf-trial-offer-3{--t3-num:2.25rem;--t3-gap:16px;--t3-shadow:var(--shadow, oklch(0.22 0.03 260));position:relative;isolation:isolate;overflow:hidden;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-trial-offer-3 *,.cf-trial-offer-3 *::before,.cf-trial-offer-3 *::after{box-sizing:border-box}
.cf-trial-offer-3 :where(h2,p,dl,dd,ul,figure){margin:0}
.cf-trial-offer-3 .t3-block{position:absolute;z-index:-1;inset:0 auto 0 0;width:34%;background:color-mix(in oklch, var(--accent-fill, var(--accent)) 16%, var(--surface))}
.cf-trial-offer-3 .t3-wrap{position:relative;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-trial-offer-3 .t3-wrap--solo{grid-template-columns:minmax(0,1fr);max-width:46rem}
.cf-trial-offer-3 .t3-media{position:sticky;top:32px}
.cf-trial-offer-3 .t3-photo{display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:cover;object-position:50% 55%;border-radius:12px;background:color-mix(in oklch, var(--ink) 6%, var(--surface))}
.cf-trial-offer-3 .t3-cap{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-trial-offer-3 .t3-body{min-width:0}
.cf-trial-offer-3 .t3-title{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}
.cf-trial-offer-3 .t3-mark{background:linear-gradient(transparent 60%, color-mix(in oklch, var(--marker, #fae37c) 72%, transparent) 60%, color-mix(in oklch, var(--marker, #fae37c) 72%, transparent) 94%, transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .06em}
.cf-trial-offer-3 .t3-lead{margin-top:16px;max-width:40rem;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-3 .t3-qa{margin-top:clamp(24px,3vw,32px)}
.cf-trial-offer-3 .t3-row{padding:clamp(20px,2.4vw,28px) 0;animation:t3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--t3-i,0) * .07s), .28s)}
.cf-trial-offer-3 .t3-row + .t3-row{border-top:1px solid oklch(from var(--ink) l c h / .12)}
.cf-trial-offer-3 .t3-row:last-child{padding-bottom:0}
.cf-trial-offer-3 .t3-q{display:grid;grid-template-columns:var(--t3-num) minmax(0,1fr);column-gap:var(--t3-gap);align-items:baseline;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
.cf-trial-offer-3 .t3-n{color:var(--accent);font-variant-numeric:tabular-nums}
.cf-trial-offer-3 .t3-a{margin-top:8px;padding-inline-start:calc(var(--t3-num) + var(--t3-gap));font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-trial-offer-3 .t3-row--act .t3-a{margin-top:16px}
.cf-trial-offer-3 .t3-receipt{list-style:none;margin:16px 0 0;padding:16px 20px;border-radius:10px;background:color-mix(in oklch, var(--ink) 4%, var(--surface));font-variant-numeric:tabular-nums}
.cf-trial-offer-3 .t3-r{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:4px 0;font-size:1rem;line-height:1.4}
.cf-trial-offer-3 .t3-r-label{min-width:0}
.cf-trial-offer-3 .t3-amt{white-space:nowrap;font-weight:600}
.cf-trial-offer-3 .t3-r--sub{color:var(--muted);font-weight:600}
.cf-trial-offer-3 .t3-r--off{color:var(--success);font-weight:700}
.cf-trial-offer-3 .t3-r--off .t3-amt{font-weight:800}
.cf-trial-offer-3 .t3-r--total{margin-top:12px;font-weight:800}
.cf-trial-offer-3 .t3-r--total .t3-amt{font-family:var(--font-display);font-weight:800;letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15}
.cf-trial-offer-3 .t3-cal{margin-top:16px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:16px;padding:clamp(20px,3vw,24px);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(--t3-shadow) l c h / .22), 0 4px 10px -2px oklch(from var(--t3-shadow) l c h / .2)))}
.cf-trial-offer-3 .t3-spot{display:block;line-height:0}
.cf-trial-offer-3 .t3-face{animation:t3-pop .3s cubic-bezier(.2,.7,.2,1) both}
.cf-trial-offer-3 .t3-when{font-size:.875rem;line-height:1.2;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.cf-trial-offer-3 .t3-date{margin-top:8px;font-family:var(--font-display);font-weight:800;letter-spacing:-0.03em;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-trial-offer-3 .t3-note{margin-top:20px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-trial-offer-3 .t3-toggle{grid-column:1 / -1;display:flex;gap:4px;padding:4px;border-radius:999px;background:color-mix(in oklch, var(--ink) 6%, var(--card))}
.cf-trial-offer-3 .t3-tab{flex:1 1 0;min-height:44px;padding:0 12px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-family:var(--font-body);font-size:.9375rem;font-weight:700;line-height:1.2;cursor:pointer;transition:background .16s ease,color .16s ease,box-shadow .16s ease}
.cf-trial-offer-3 .t3-tab:hover{color:var(--ink)}
.cf-trial-offer-3 .t3-tab[aria-pressed=true]{background:var(--card);color:var(--ink);box-shadow:inset 0 0 0 1px oklch(from var(--ink) l c h / .14), var(--shadow-sm, 0 1px 1px oklch(from var(--t3-shadow) l c h / .18), 0 1px 3px oklch(from var(--t3-shadow) l c h / .14))}
.cf-trial-offer-3 .t3-tab:focus-visible{outline:3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55);outline-offset:2px}
.cf-trial-offer-3 .t3-cta{--t3-bg:var(--button-bg, var(--cta));--t3-bg2:var(--button-bg-2, var(--cta-2));appearance:none;border:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin-inline:auto;min-height:72px;padding:12px 28px;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;text-decoration:none;color:var(--button-ink, var(--cta-ink));text-shadow:var(--button-text-shadow, none);background:linear-gradient(oklch(from var(--t3-bg) calc(l + .04) c h), oklch(from var(--t3-bg2) calc(l - .02) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--t3-bg) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--t3-bg) calc(l - .16) c h), 0 1px 2px oklch(from var(--t3-shadow) l c h / .3), 0 8px 16px -6px oklch(from var(--t3-shadow) l c h / .42));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-trial-offer-3 .t3-cta:not(:disabled):hover,.cf-trial-offer-3 .t3-cta[data-force=hover]{transform:translateY(-1px);background:linear-gradient(oklch(from var(--t3-bg) calc(l - .01) c h), oklch(from var(--t3-bg2) calc(l - .07) c h));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--t3-bg) calc(l + .1) c h / .6), inset 0 -3px 0 oklch(from var(--t3-bg) calc(l - .2) c h), 0 1px 2px oklch(from var(--t3-shadow) l c h / .34), 0 12px 20px -8px oklch(from var(--t3-shadow) l c h / .5))}
.cf-trial-offer-3 .t3-cta:not(:disabled):active,.cf-trial-offer-3 .t3-cta[data-force=active]{transform:translateY(1px);background:linear-gradient(oklch(from var(--t3-bg) calc(l - .05) c h), oklch(from var(--t3-bg2) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--t3-bg2) calc(l - .2) c h / .55), inset 0 -2px 0 oklch(from var(--t3-bg) calc(l - .16) c h), 0 1px 1px oklch(from var(--t3-shadow) l c h / .3)}
.cf-trial-offer-3 .t3-cta:focus-visible{outline:3px solid var(--field-focus, var(--accent));outline-offset:3px}
.cf-trial-offer-3 .t3-cta:disabled{cursor:not-allowed;transform:none;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))}
.cf-trial-offer-3 .t3-cta[aria-busy=true]{cursor:progress}
.cf-trial-offer-3 .t3-spin{flex:0 0 auto;width:20px;height:20px;animation:t3-spin .8s linear infinite}
.cf-trial-offer-3 .t3-status{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:pretty}
.cf-trial-offer-3 .t3-status[data-tone=error]{color:var(--danger)}
.cf-trial-offer-3 .t3-status svg{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-trial-offer-3 .t3-ps{margin-top:16px;max-width:64ch;font-size:1rem;line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-trial-offer-3 .t3-ps strong{font-weight:800}
@keyframes t3-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes t3-pop{from{opacity:.82;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes t3-spin{to{transform:rotate(360deg)}}
@media (max-width:860px){
.cf-trial-offer-3 .t3-wrap{grid-template-columns:minmax(0,1fr);gap:24px}
.cf-trial-offer-3 .t3-media{position:static}
.cf-trial-offer-3 .t3-photo{aspect-ratio:auto;height:clamp(180px,46vw,280px);object-position:50% 62%}
.cf-trial-offer-3 .t3-block{inset:0 0 auto 0;width:auto;height:calc(clamp(56px,8vw,112px) + clamp(100px,26vw,180px))}
}
@media (max-width:520px){
.cf-trial-offer-3{--t3-num:1.5rem;--t3-gap:12px}
.cf-trial-offer-3 .t3-row--act .t3-a{padding-inline-start:0}
.cf-trial-offer-3 .t3-receipt{padding:12px 16px}
.cf-trial-offer-3 .t3-cal{padding:20px;column-gap:12px}
.cf-trial-offer-3 .t3-spot{width:56px}
.cf-trial-offer-3 .t3-spot > *{width:100%;height:auto}
}
@media (prefers-reduced-motion:reduce){
.cf-trial-offer-3 .t3-row,.cf-trial-offer-3 .t3-face,.cf-trial-offer-3 .t3-spin{animation:none}
.cf-trial-offer-3 .t3-cta,.cf-trial-offer-3 .t3-tab{transition:none}
.cf-trial-offer-3 .t3-cta:not(:disabled):hover,.cf-trial-offer-3 .t3-cta[data-force=hover],.cf-trial-offer-3 .t3-cta:not(:disabled):active,.cf-trial-offer-3 .t3-cta[data-force=active]{transform:none}
}
`
pieces/offer/trial-offer-3/specimen.tsx 37 lines
import __studioImage87785451 from "../assets/38972c8e7bab5350.webp";
import * as React from 'react'
import { slot } from '../../slots'
import { TrialOffer3, type TrialOffer3State } from '../trial-offer-3'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function TrialOffer3Specimen({ state = 'default' }: { state?: TrialOffer3State }) {
return (
<TrialOffer3
state={state}
headline='Your {trialPrice} Vitalroot trial,'
accent='minus the fine print'
lead='Four questions everyone asks before a supplement trial. Here are the straight answers, in plain words.'
sceneImage={slot(
'scene',
__studioImage87785451
)}
sceneImageAlt='A pouch of Vitalroot Daily Greens beside a full glass on a kitchen counter'
sceneCaption='Vitalroot Daily Greens: one scoop, one glass of water.'
trialPrice='$1'
trialDays={14}
receiptItems={[
{ label: 'Vitalroot Daily Greens, 14-day pouch', amount: '$29' },
{ label: 'Shipping', amount: '$5' },
]}
chargeAmount='$58'
chargeDetail='for your next 30-day pouch, then every 30 days until you cancel'
cancelMethod='Reply “cancel” to any Vitalroot email, or tap Cancel in your account. No phone call.'
reminderDaysBefore={3}
reminderChannel='email and text'
ctaLabel='I’m in, send my {trialPrice} pouch'
ps='We remind you {reminderDays} days before any charge, and cancelling takes one reply.'
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalTrialOffer3 |
string |
Default 'Your {trialPrice} trial,'
|
accent OptionalTrialOffer3 |
string |
Default 'minus the fine print'
|
lead OptionalTrialOffer3 |
string |
Default 'Four questions everyone asks before a trial. Here are the straight answers.'
|
sceneImage OptionalTrialOffer3 |
string |
|
sceneImageAlt OptionalTrialOffer3 |
string |
Default ''
|
sceneCaption OptionalTrialOffer3 |
string |
|
trialPrice OptionalTrialOffer3 |
string |
Default '$1'
|
trialDays OptionalTrialOffer3 |
number |
Default 14
|
receiptItems OptionalTrialOffer3 |
TrialOffer3ReceiptItem[] |
Default []
|
chargeAmount OptionalTrialOffer3 |
string |
Default '$47'
|
chargeDetail OptionalTrialOffer3 |
string |
Default 'once, only if you keep it'
|
cancelMethod OptionalTrialOffer3 |
string |
Default 'Cancel from your account before {chargeDate} and you pay nothing more.'
|
reminderDaysBefore OptionalTrialOffer3 |
number | null |
Default 3
|
reminderChannel OptionalTrialOffer3 |
string |
Default 'email'
|
startDate OptionalTrialOffer3 |
Date | string |
|
locale OptionalTrialOffer3 |
string |
Default 'en-US'
|
ctaLabel OptionalTrialOffer3 |
string |
Default 'I’m in, start my {trialPrice} trial'
|
loadingLabel OptionalTrialOffer3 |
string |
Default 'Starting your trial…'
|
ps OptionalTrialOffer3 |
string |
Default 'Everything you pay, and when, is right here on this page.'
|
errorMessage OptionalTrialOffer3 |
string |
Default 'We couldn’t start your trial and nothing was charged. Please try again.'
|
disabledNote OptionalTrialOffer3 |
string |
Default 'This trial isn’t open right now.'
|
copy OptionalTrialOffer3 |
Partial<TrialOffer3Copy> |
|
state OptionalTrialOffer3 |
TrialOffer3State |
Default 'default'
|
disabled OptionalTrialOffer3 |
boolean |
Default false
|
href OptionalTrialOffer3 |
string |
|
onAction OptionalTrialOffer3 |
() => void | Promise<void> |
|
className OptionalTrialOffer3 |
string |
|
style OptionalTrialOffer3 |
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.
scene- A wide atmosphere photo behind or beside the copy.
-
321240b3188e2da4.webp
image/webp · 18.7 KB
-
38972c8e7bab5350.webp
image/webp · 25.7 KB