Payment Plan Choice 1
Pay in full or pay over time, set like a scoreboard: two big radio tiles with the pay-in-full saving flagged,
Use it in a prompt
Use offer/payment-plan-choice 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/payment-plan-choice.tsx. - Import it and pass your copy and images (Props tab):
import { PaymentPlanChoice } from "@/components/funneldna/offer/payment-plan-choice"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/payment-plan-choice/component.tsx 510 lines
// layout: fact-scoreboard
// Pay in full or pay over time, set like a scoreboard: two big radio tiles with the pay-in-full saving flagged,
// and one Add To Cart tile whose price line, payment schedule and checkout destination follow the visitor’s choice.
import * as React from 'react'
import { AnimatePresence, motion, useReducedMotion } from 'motion/react'
import { AlertCircle, Loader2, ShieldCheck, ShoppingCart } from 'lucide-react'
export type PaymentPlanOption = {
/** Stable id, also the radio value passed to onSelect. */
id: string
/** Tile title, e.g. Pay in full. */
label: string
/** How many payments this option takes. */
payments: number
/** Amount of each payment in major units (997 = $997). */
amount: number
/** Short line at the foot of the tile. */
note?: string
/** Checkout destination for this option; falls back to the component href. */
href?: string
}
/** Templates use named placeholders, replaced as plain text. */
export type PaymentPlanChoiceCopy = {
/** Accessible name of the radio group. */
groupLabel: string
/** {count} = number of payments. */
countSingular: string
countPlural: string
totalLabel: string
/** {saving} = money saved against the dearest option. */
saveFlag: string
/** Red subhead when the chosen option saves money. {saving}, {amount}. */
subheadSaving: string
/** Red subhead for a multi-payment option. {amount}, {count}. */
subheadPlan: string
/** Red subhead for a single payment with no saving. {amount}. */
subheadSingle: string
/** Red subhead before anything is chosen. */
subheadNone: string
scheduleLabel: string
scheduleToday: string
/** {n} = payment number. */
schedulePayment: string
/** {count} = payments folded into the last slot. */
scheduleMore: string
scheduleFull: string
scheduleNone: string
buttonLabel: string
/** Second line of the button. {count}, {amount}. */
buttonSub: string
buttonSubNone: string
pendingLabel: string
/** Inline error when Add To Cart is pressed with nothing chosen. */
error: string
}
export type PaymentPlanChoiceProps = {
headline?: React.ReactNode
options?: PaymentPlanOption[]
/** Uncontrolled starting choice; null starts with nothing chosen. Defaults to the first option. */
defaultSelected?: string | null
/** Controlled choice. */
selected?: string | null
onSelect?: (id: string) => void
productName?: string
/** Slot: product. Transparent cut-out of what they get. */
productImage?: string
productImageAlt?: string
/** One line under the product name. */
includes?: string
/** True reassurance facts shown under the button. Empty by default. */
reassurance?: string[]
/** ISO currency code for every price. */
currency?: string
locale?: string
/** Radio group name for form posts. */
name?: string
/** Checkout destination when the chosen option has no href. */
href?: string
/** Called with the chosen option when Add To Cart is pressed. */
onAction?: (option: PaymentPlanOption) => void
disabled?: boolean
/** Shows the loading label while the builder adds to cart. */
pending?: boolean
copy?: Partial<PaymentPlanChoiceCopy>
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error'
className?: string
}
export function PaymentPlanChoice(props: PaymentPlanChoiceProps) {
const {
headline = 'Get the whole kit today. Pay the way that suits you.',
options = DEFAULT_OPTIONS,
defaultSelected,
selected,
onSelect,
productName = 'The complete kit',
productImage,
productImageAlt = '',
includes = 'Same kit, whichever way you pay.',
reassurance = [],
currency = 'USD',
locale = 'en-US',
name,
href,
onAction,
disabled = false,
pending = false,
state = 'default',
className,
} = props
const copy: PaymentPlanChoiceCopy = { ...DEFAULT_COPY, ...props.copy }
const uid = React.useId()
const reduce = useReducedMotion()
const groupRef = React.useRef<HTMLFieldSetElement>(null)
const [inner, setInner] = React.useState<string | null>(
defaultSelected === undefined ? (options[0]?.id ?? null) : defaultSelected,
)
const [attempted, setAttempted] = React.useState(false)
const current = selected !== undefined ? selected : inner
const chosen = options.find((o) => o.id === current) ?? null
const isDisabled = disabled || state === 'disabled'
const showError = !chosen && (state === 'error' || attempted)
const errId = uid + '-error'
const groupName = name ?? uid + '-plan'
const fmt = (n: number) => money(n, currency, locale)
const countLabel = (n: number) => fill(n === 1 ? copy.countSingular : copy.countPlural, { count: String(n) })
const totalOf = (o: PaymentPlanOption) => o.payments * o.amount
const maxTotal = options.reduce((m, o) => Math.max(m, totalOf(o)), 0)
const savingOf = (o: PaymentPlanOption) => maxTotal - totalOf(o)
let subhead = copy.subheadNone
if (chosen) {
const saving = savingOf(chosen)
const amount = fmt(chosen.amount)
if (saving > 0) subhead = fill(copy.subheadSaving, { saving: fmt(saving), amount })
else if (chosen.payments > 1) subhead = fill(copy.subheadPlan, { amount, count: countLabel(chosen.payments) })
else subhead = fill(copy.subheadSingle, { amount })
}
const subLine = chosen
? fill(copy.buttonSub, { count: countLabel(chosen.payments), amount: fmt(chosen.amount) })
: copy.buttonSubNone
const slots = Math.min(4, options.reduce((m, o) => Math.max(m, o.payments), 1))
const visible = chosen ? Math.min(slots, chosen.payments) : 1
const segments = Array.from({ length: slots }, (_, i) => {
if (!chosen) return { label: copy.scheduleNone, value: '' }
const amount = fmt(chosen.amount)
if (chosen.payments === 1) return { label: copy.scheduleFull, value: amount }
if (i === 0) return { label: copy.scheduleToday, value: amount }
if (i === slots - 1 && chosen.payments > slots) {
return { label: fill(copy.scheduleMore, { count: String(chosen.payments - slots + 1) }), value: amount }
}
return { label: fill(copy.schedulePayment, { n: String(i + 1) }), value: amount }
})
function choose(id: string) {
if (selected === undefined) setInner(id)
setAttempted(false)
onSelect?.(id)
}
function act(event: React.MouseEvent<HTMLElement>) {
if (isDisabled || pending) {
event.preventDefault()
return
}
if (!chosen) {
event.preventDefault()
setAttempted(true)
groupRef.current?.querySelector<HTMLInputElement>('input')?.focus()
return
}
onAction?.(chosen)
}
const btnClass = cx('ppc-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active', pending && 'is-pending')
const btnBody = (
<>
<span className='ppc-btn__main'>
{pending ? (
<Loader2 className='ppc-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
) : (
<ShoppingCart size={20} strokeWidth={2.5} aria-hidden='true' />
)}
<span>{pending ? copy.pendingLabel : copy.buttonLabel}</span>
</span>
<span className='ppc-btn__sub'>
<Roll value={subLine} reduce={reduce} />
</span>
</>
)
const target = chosen ? (chosen.href ?? href) : undefined
const button =
target && !isDisabled && !pending ? (
<a className={btnClass} href={target} onClick={act}>
{btnBody}
</a>
) : (
<button
type='button'
className={btnClass}
onClick={act}
disabled={isDisabled}
aria-disabled={pending || undefined}
aria-busy={pending || undefined}
aria-describedby={showError ? errId : undefined}
>
{btnBody}
</button>
)
return (
<div className={cx('cf-payment-plan-choice', className)}>
<style>{CSS}</style>
<header className='ppc-head'>
{headline ? <h2 className='ppc-title'>{headline}</h2> : null}
<p className='ppc-sub'>
<Roll value={subhead} reduce={reduce} block />
</p>
</header>
<div className='ppc-board'>
<fieldset
ref={groupRef}
className='ppc-group'
disabled={isDisabled}
aria-describedby={showError ? errId : undefined}
>
<legend className='ppc-sr'>{copy.groupLabel}</legend>
{options.map((o, i) => {
const on = o.id === current
const saving = savingOf(o)
return (
<label
key={o.id}
className={cx('ppc-tile', on && 'is-selected', showError && 'is-invalid', isDisabled && 'is-disabled')}
style={{ '--i': i } as React.CSSProperties}
>
<input
type='radio'
className='ppc-input'
name={groupName}
value={o.id}
checked={on}
onChange={() => choose(o.id)}
/>
<span className='ppc-tile__head'>
<span className='ppc-dot' aria-hidden='true' />
<span className='ppc-tile__label'>{o.label}</span>
</span>
{saving > 0 ? <span className='ppc-flag'>{fill(copy.saveFlag, { saving: fmt(saving) })}</span> : null}
<span className='ppc-well'>
<span className='ppc-well__cap'>{countLabel(o.payments)}</span>
<span className='ppc-well__num'>{fmt(o.amount)}</span>
<span className='ppc-well__row'>
<span>{copy.totalLabel}</span>
<span className='ppc-well__total'>{fmt(totalOf(o))}</span>
</span>
</span>
{o.note ? <span className='ppc-tile__note'>{o.note}</span> : null}
</label>
)
})}
<p id={errId} className='ppc-error' role='alert'>
{showError ? (
<>
<AlertCircle className='ppc-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
{copy.error}
</>
) : null}
</p>
</fieldset>
<div className='ppc-act'>
<div className={cx('ppc-act__in', productImage && 'has-img')}>
{productImage ? (
<img
className='ppc-act__img'
src={productImage}
alt={productImageAlt}
width={320}
height={320}
loading='lazy'
decoding='async'
/>
) : null}
<div className='ppc-act__intro'>
{productName ? <h3 className='ppc-act__name'>{productName}</h3> : null}
{includes ? <p className='ppc-act__includes'>{includes}</p> : null}
</div>
<ol className='ppc-sched' aria-label={copy.scheduleLabel}>
{segments.map((s, i) => {
const on = i < visible
return (
<li
key={i}
className={cx('ppc-seg', on && 'is-on', i === 0 && chosen ? 'is-lit' : false)}
aria-hidden={on ? undefined : true}
>
<span className='ppc-seg__label'>{s.label}</span>
{s.value ? (
<span className='ppc-seg__value'>
<Roll value={s.value} reduce={reduce} />
</span>
) : null}
</li>
)
})}
</ol>
{button}
{reassurance.length ? (
<p className='ppc-assure'>
{reassurance.map((item, i) => (
<React.Fragment key={i}>
{i ? ' ' : null}
<span className='ppc-assure__item'>
{i === 0 ? (
<ShieldCheck className='ppc-inline-icon' size={16} strokeWidth={2.5} aria-hidden='true' />
) : null}
{item}
{i < reassurance.length - 1 ? (
<span className='ppc-assure__sep' aria-hidden='true'>
{' ·'}
</span>
) : null}
</span>
</React.Fragment>
))}
</p>
) : null}
</div>
</div>
</div>
</div>
)
}
export default PaymentPlanChoice
/** The signature move: a changed price rolls in on the button, the schedule and the subhead. Still under reduced motion. */
function Roll({ value, reduce, block = false }: { value: string; reduce: boolean | null; block?: boolean }) {
return (
<span className={block ? 'ppc-roll is-block' : 'ppc-roll'}>
<AnimatePresence initial={false}>
<motion.span
key={value}
className='ppc-roll__item'
initial={reduce ? false : { opacity: 0.82, y: '0.5em' }}
animate={{ opacity: 1, y: 0 }}
exit={reduce ? { opacity: 0, transition: { duration: 0 } } : { opacity: 0, y: '-0.5em', transition: { duration: 0.18 } }}
transition={{ duration: 0.28, ease: [0.2, 0.7, 0.2, 1] }}
>
{value}
</motion.span>
</AnimatePresence>
</span>
)
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((text, key) => text.split('{' + key + '}').join(values[key]), template)
}
function money(n: number, currency: string, locale: string) {
const whole = Number.isInteger(n)
try {
return new Intl.NumberFormat(locale, {
style: 'currency',
currency,
minimumFractionDigits: whole ? 0 : 2,
maximumFractionDigits: 2,
}).format(n)
} catch {
return String(n)
}
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ')
}
const DEFAULT_OPTIONS: PaymentPlanOption[] = [
{ id: 'full', label: 'Pay in full', payments: 1, amount: 997, note: 'One payment, nothing more to pay' },
{ id: 'plan', label: 'Payment plan', payments: 3, amount: 397, note: 'First payment today' },
]
const DEFAULT_COPY: PaymentPlanChoiceCopy = {
groupLabel: 'Choose how you pay',
countSingular: '{count} payment',
countPlural: '{count} payments',
totalLabel: 'Total',
saveFlag: 'Save {saving}',
subheadSaving: 'Pay in full and keep {saving} in your pocket.',
subheadPlan: 'Start today for {amount}, the first of {count}.',
subheadSingle: 'One payment of {amount}. Nothing more to pay.',
subheadNone: 'Pick how you want to pay, then add it to your cart.',
scheduleLabel: 'Your payment schedule',
scheduleToday: 'Today',
schedulePayment: 'Payment {n}',
scheduleMore: '+{count} more',
scheduleFull: 'Today · paid in full',
scheduleNone: 'Choose how you pay',
buttonLabel: 'Add To Cart',
buttonSub: '{count} of {amount}',
buttonSubNone: 'Choose an option first',
pendingLabel: 'Adding to cart…',
error: 'Choose how you’d like to pay to continue.',
}
const CSS = `
.cf-payment-plan-choice{container:ppc/inline-size;width:100%;max-width:1120px;margin-inline:auto;color:var(--ink);font-family:var(--font-body);--ppc-shadow:var(--shadow,oklch(0.22 0.03 260));--ppc-line:oklch(from var(--ink) l c h / 0.12);--ppc-subhead:var(--subhead-ink,color-mix(in oklab,var(--cta) 55%,var(--ink)));--ppc-ease:cubic-bezier(.2,.7,.2,1);--ppc-card-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--ppc-shadow) l c h / 0.22),0 4px 10px -2px oklch(from var(--ppc-shadow) l c h / 0.2)));--ppc-lift-shadow:var(--shadow-lg,0 2px 4px oklch(from var(--ppc-shadow) l c h / 0.22),0 12px 24px -8px oklch(from var(--ppc-shadow) l c h / 0.32))}
.cf-payment-plan-choice *,.cf-payment-plan-choice *::before,.cf-payment-plan-choice *::after{box-sizing:border-box}
.cf-payment-plan-choice :where(h2,h3,p,ol,li,fieldset,legend){margin:0;padding:0}
.cf-payment-plan-choice .ppc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cf-payment-plan-choice .ppc-head{margin-bottom:clamp(20px,2.6cqi,28px)}
.cf-payment-plan-choice .ppc-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,4.6cqi,3.25rem);line-height:1.06;color:var(--ink);text-wrap:balance}
.cf-payment-plan-choice .ppc-sub{margin-top:14px;font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,2.3cqi,1.625rem);line-height:1.2;letter-spacing:-0.01em;color:var(--ppc-subhead);text-wrap:balance}
.cf-payment-plan-choice .ppc-roll{display:inline-grid;overflow:hidden;vertical-align:top}
.cf-payment-plan-choice .ppc-roll.is-block{display:grid}
.cf-payment-plan-choice .ppc-roll__item{grid-area:1/1;min-width:0}
.cf-payment-plan-choice .ppc-board{display:grid;grid-template-columns:minmax(0,1fr);gap:clamp(16px,2cqi,20px);align-items:start;padding-top:16px}
.cf-payment-plan-choice .ppc-group{display:grid;grid-template-columns:minmax(0,1fr);align-content:start;min-width:0;border:0}
.cf-payment-plan-choice .ppc-tile+.ppc-tile{margin-top:28px}
.cf-payment-plan-choice .ppc-tile{position:relative;display:flex;flex-direction:column;gap:12px;min-width:0;padding:20px;background:var(--card);color:var(--ink);border:1px solid var(--card-border,var(--ppc-line));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--ppc-card-shadow);cursor:pointer;-webkit-tap-highlight-color:transparent;transition:translate .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease;animation:ppc-rise .45s var(--ppc-ease) backwards;animation-delay:calc(var(--i,0) * .07s)}
.cf-payment-plan-choice .ppc-tile.is-selected{background:color-mix(in oklch,var(--accent) 9%,var(--card));border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent),var(--ppc-lift-shadow);translate:0 -3px}
.cf-payment-plan-choice .ppc-tile.is-invalid{border-color:var(--danger);box-shadow:inset 0 0 0 1px var(--danger),var(--ppc-card-shadow)}
.cf-payment-plan-choice .ppc-tile:has(.ppc-input:focus-visible){outline:2px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-payment-plan-choice .ppc-tile.is-disabled{cursor:not-allowed;opacity:.6;animation:none}
@media (hover:hover){.cf-payment-plan-choice .ppc-tile:not(.is-disabled):not(.is-selected):hover{border-color:oklch(from var(--ink) l c h / 0.32);translate:0 -2px;box-shadow:var(--ppc-lift-shadow)}.cf-payment-plan-choice .ppc-tile:not(.is-disabled):not(.is-selected):hover:active{translate:0 0}}
.cf-payment-plan-choice .ppc-tile:not(.is-disabled):active{translate:0 0}
.cf-payment-plan-choice .ppc-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}
.cf-payment-plan-choice .ppc-tile__head{display:flex;align-items:center;gap:12px;min-width:0}
.cf-payment-plan-choice .ppc-dot{flex:none;position:relative;width:24px;height:24px;border-radius:999px;border:2px solid oklch(from var(--ink) l c h / 0.34);background:var(--field,var(--card));transition:background-color .16s ease,border-color .16s ease}
.cf-payment-plan-choice .ppc-dot::after{content:'';position:absolute;inset:0;margin:auto;width:10px;height:10px;border-radius:999px;background:var(--accent-fill-ink,var(--card));transform:scale(0);transition:transform .2s var(--ppc-ease)}
.cf-payment-plan-choice .is-selected .ppc-dot{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent))}
.cf-payment-plan-choice .is-selected .ppc-dot::after{transform:scale(1)}
.cf-payment-plan-choice .is-invalid .ppc-dot{border-color:var(--danger)}
.cf-payment-plan-choice .ppc-tile__label{min-width:0;font-family:var(--font-display);font-weight:800;font-size:clamp(1.125rem,2cqi,1.375rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
.cf-payment-plan-choice .ppc-flag{position:absolute;top:0;right:clamp(14px,2.4cqi,24px);z-index:2;transform:translateY(-50%);display:inline-flex;align-items:center;min-height:30px;padding:4px 12px;border-radius:999px;border:1px solid oklch(from var(--success) l c h / 0.35);background:var(--success-soft);color:var(--success);font-size:.875rem;font-weight:800;line-height:1.2;white-space:nowrap;box-shadow:var(--shadow-sm,0 1px 2px oklch(from var(--ppc-shadow) l c h / 0.2));pointer-events:none}
.cf-payment-plan-choice .ppc-well{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'cap num' 'row num';align-items:center;gap:4px 12px;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,transparent)}
.cf-payment-plan-choice .ppc-well__cap{grid-area:cap;font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.cf-payment-plan-choice .ppc-well__num{grid-area:num;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,5.4cqi,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ink)}
.cf-payment-plan-choice .ppc-well__row{grid-area:row;display:flex;align-items:baseline;gap:8px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--muted)}
.cf-payment-plan-choice .ppc-well__total{font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.cf-payment-plan-choice .ppc-tile__note{margin-top:auto;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-payment-plan-choice .ppc-error{grid-column:1/-1;margin-top:16px;font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--danger);text-wrap:pretty}
.cf-payment-plan-choice .ppc-error:empty{margin-top:0}
.cf-payment-plan-choice .ppc-inline-icon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-payment-plan-choice .ppc-act{container:ppc-act/inline-size;min-width:0;padding:clamp(20px,3cqi,32px);background:var(--band);color:var(--band-ink);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--ppc-lift-shadow);animation:ppc-rise .45s var(--ppc-ease) backwards;animation-delay:.14s}
.cf-payment-plan-choice .ppc-act__in{display:grid;grid-template-columns:minmax(0,1fr);grid-template-areas:'intro' 'sched' 'btn' 'assure';gap:16px}
.cf-payment-plan-choice .ppc-act__in.has-img{grid-template-columns:88px minmax(0,1fr);grid-template-areas:'img intro' 'sched sched' 'btn btn' 'assure assure';column-gap:16px}
.cf-payment-plan-choice .ppc-act__img{grid-area:img;display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;align-self:center;filter:drop-shadow(0 2px 3px oklch(from var(--ppc-shadow) l c h / 0.4)) drop-shadow(0 10px 12px oklch(from var(--ppc-shadow) l c h / 0.3))}
.cf-payment-plan-choice .ppc-act__intro{grid-area:intro;align-self:center;min-width:0}
.cf-payment-plan-choice .ppc-act__name{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--band-ink);text-wrap:balance}
.cf-payment-plan-choice .ppc-act__includes{margin-top:8px;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--band-ink);text-wrap:pretty}
.cf-payment-plan-choice .ppc-sched{grid-area:sched;display:flex;list-style:none;min-width:0}
.cf-payment-plan-choice .ppc-seg{flex:1 1 0px;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:56px;padding:8px 12px;border-radius:10px;background:oklch(from var(--band-ink) l c h / 0.1);box-shadow:inset 0 0 0 1px oklch(from var(--band-ink) l c h / 0.16);color:var(--band-ink);overflow:hidden;white-space:nowrap;transition:flex-grow .42s var(--ppc-ease),padding .42s var(--ppc-ease),margin .42s var(--ppc-ease),opacity .3s ease,background-color .2s ease,box-shadow .2s ease,visibility 0s}
.cf-payment-plan-choice .ppc-seg+.ppc-seg{margin-inline-start:8px}
.cf-payment-plan-choice .ppc-seg:not(.is-on){flex-grow:0;padding-inline:0;margin-inline-start:0;opacity:0;visibility:hidden;transition-delay:0s,0s,0s,0s,0s,0s,.42s}
.cf-payment-plan-choice .ppc-seg.is-lit{background:oklch(from var(--band-ink) l c h / 0.2);box-shadow:inset 0 0 0 1.5px oklch(from var(--band-ink) l c h / 0.6)}
.cf-payment-plan-choice .ppc-seg__label{overflow:hidden;text-overflow:ellipsis;font-size:.875rem;font-weight:800;line-height:1.2}
.cf-payment-plan-choice .ppc-seg__value{font-family:var(--font-display);font-size:1.125rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums}
.cf-payment-plan-choice .ppc-btn{grid-area:btn;--ppc-b:var(--button-bg,var(--cta));--ppc-b2:var(--button-bg-2,var(--cta-2));position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:72px;padding:10px 24px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--ppc-b) calc(l + 0.04) c h),oklch(from var(--ppc-b2) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--ppc-b) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--ppc-b) calc(l - 0.16) c h),0 1px 2px oklch(from var(--ppc-shadow) l c h / 0.35),0 8px 16px -6px oklch(from var(--ppc-shadow) l c h / 0.5));cursor:pointer;-webkit-tap-highlight-color:transparent;transition:translate .16s ease,box-shadow .16s ease}
.cf-payment-plan-choice .ppc-btn.is-hover,.cf-payment-plan-choice .ppc-btn:not(:disabled):hover{background:linear-gradient(oklch(from var(--ppc-b) calc(l - 0.01) c h),oklch(from var(--ppc-b2) calc(l - 0.07) c h));box-shadow:inset 0 1px 0 oklch(from var(--ppc-b) calc(l + 0.1) c h / 0.6),inset 0 -3px 0 oklch(from var(--ppc-b) calc(l - 0.2) c h),0 1px 2px oklch(from var(--ppc-shadow) l c h / 0.4),0 10px 18px -6px oklch(from var(--ppc-shadow) l c h / 0.6)}
.cf-payment-plan-choice .ppc-btn.is-active,.cf-payment-plan-choice .ppc-btn:not(:disabled):active{translate:0 1px;background:linear-gradient(oklch(from var(--ppc-b) calc(l - 0.06) c h),oklch(from var(--ppc-b2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--ppc-b) calc(l - 0.22) c h / 0.55),inset 0 -2px 0 oklch(from var(--ppc-b) calc(l - 0.16) c h),0 1px 1px oklch(from var(--ppc-shadow) l c h / 0.35)}
.cf-payment-plan-choice .ppc-btn:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-payment-plan-choice .ppc-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none;cursor:not-allowed}
.cf-payment-plan-choice .ppc-btn.is-pending{cursor:progress}
.cf-payment-plan-choice .ppc-btn__main{display:inline-flex;align-items:center;justify-content:center;gap:10px;font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15}
.cf-payment-plan-choice .ppc-btn__main svg{flex:none}
.cf-payment-plan-choice .ppc-btn__sub{font-family:var(--font-body);font-size:.9375rem;font-weight:600;line-height:1.3;font-variant-numeric:tabular-nums;text-wrap:pretty}
.cf-payment-plan-choice .ppc-spin{animation:ppc-spin .8s linear infinite}
.cf-payment-plan-choice .ppc-assure{grid-area:assure;text-align:center;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--band-ink);text-wrap:balance}
.cf-payment-plan-choice .ppc-assure__item{display:inline-block;max-width:100%}
.cf-payment-plan-choice .ppc-assure__sep{white-space:pre}
@container ppc (min-width: 560px){
.cf-payment-plan-choice .ppc-group{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr auto;column-gap:clamp(12px,1.8cqi,20px)}
.cf-payment-plan-choice .ppc-tile+.ppc-tile{margin-top:0}
.cf-payment-plan-choice .ppc-tile{gap:16px;padding:clamp(20px,2.6cqi,28px)}
.cf-payment-plan-choice .ppc-well{grid-template-columns:minmax(0,1fr);grid-template-areas:'cap' 'num' 'row';gap:8px;padding:16px 18px}
.cf-payment-plan-choice .ppc-well__num{margin-bottom:4px}
.cf-payment-plan-choice .ppc-well__row{justify-content:space-between;padding-top:12px;border-top:1px solid var(--ppc-line)}
}
@container ppc (min-width: 980px){
.cf-payment-plan-choice .ppc-board{grid-template-columns:minmax(0,1.7fr) minmax(0,1.2fr);column-gap:clamp(20px,2.2cqi,28px)}
.cf-payment-plan-choice .ppc-group{grid-template-columns:minmax(0,1fr);grid-template-rows:none}
.cf-payment-plan-choice .ppc-tile+.ppc-tile{margin-top:24px}
.cf-payment-plan-choice .ppc-tile{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'head note' 'well well';column-gap:16px;row-gap:14px;padding:24px 28px}
.cf-payment-plan-choice .ppc-tile__head{grid-area:head}
.cf-payment-plan-choice .ppc-tile__note{grid-area:note;margin-top:0;align-self:center;text-align:right}
.cf-payment-plan-choice .ppc-well{grid-area:well;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'cap num' 'row num';gap:6px 16px;padding:16px 20px}
.cf-payment-plan-choice .ppc-well__num{margin-bottom:0}
.cf-payment-plan-choice .ppc-well__row{justify-content:flex-start;padding-top:0;border-top:0}
}
@container ppc-act (min-width: 320px){
.cf-payment-plan-choice .ppc-act__in.has-img{grid-template-columns:104px minmax(0,1fr)}
}
@container ppc-act (min-width: 520px){
.cf-payment-plan-choice .ppc-act__in.has-img{grid-template-columns:168px minmax(0,1fr);grid-template-areas:'img intro' 'img sched' 'img btn' 'img assure';column-gap:28px}
.cf-payment-plan-choice .ppc-act__img{align-self:start}
}
@keyframes ppc-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes ppc-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.cf-payment-plan-choice *,.cf-payment-plan-choice *::before,.cf-payment-plan-choice *::after{animation:none !important;transition:none !important}}
`
pieces/offer/payment-plan-choice/specimen.tsx 29 lines
import __studioImagea87408e2 from "../assets/c68303e7e51b5d2e.webp";
import { PaymentPlanChoice } from '../payment-plan-choice'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
const sample = defaults.sample
export const states = ['default', 'hover', 'active', 'disabled', 'error'] as const
type SpecimenState = (typeof states)[number]
export default function PaymentPlanChoiceSpecimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<PaymentPlanChoice
key={state}
state={state}
headline='Get the whole kit today. Pay the way that suits you.'
productName={sample.name}
productImage={slot('product', __studioImagea87408e2)}
productImageAlt='The Funnel Starter Kit: planning guide, copy workbook and launch checklist'
includes='Guide, workbook and checklist. The same kit whichever way you pay.'
options={[
{ id: 'full', label: 'Pay in full', payments: 1, amount: 997, note: 'One payment, nothing more to pay' },
{ id: 'plan', label: 'Payment plan', payments: 3, amount: 397, note: 'First payment today' },
]}
defaultSelected={state === 'error' ? null : 'full'}
reassurance={sample.reassurance}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalPaymentPlanChoice |
React.ReactNode |
|
options OptionalPaymentPlanChoice |
PaymentPlanOption[] |
|
defaultSelected OptionalPaymentPlanChoice |
string | null |
|
selected OptionalPaymentPlanChoice |
string | null |
|
onSelect OptionalPaymentPlanChoice |
(id: string) => void |
|
productName OptionalPaymentPlanChoice |
string |
|
productImage OptionalPaymentPlanChoice |
string |
|
productImageAlt OptionalPaymentPlanChoice |
string |
|
includes OptionalPaymentPlanChoice |
string |
|
reassurance OptionalPaymentPlanChoice |
string[] |
|
currency OptionalPaymentPlanChoice |
string |
|
locale OptionalPaymentPlanChoice |
string |
|
name OptionalPaymentPlanChoice |
string |
|
href OptionalPaymentPlanChoice |
string |
|
onAction OptionalPaymentPlanChoice |
(option: PaymentPlanOption) => void |
|
disabled OptionalPaymentPlanChoice |
boolean |
|
pending OptionalPaymentPlanChoice |
boolean |
|
copy OptionalPaymentPlanChoice |
Partial<PaymentPlanChoiceCopy> |
|
state OptionalPaymentPlanChoice |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
|
className OptionalPaymentPlanChoice |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--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--field-focus- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c68303e7e51b5d2e.webp
image/webp · 149 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB