Whats Inside 1
Unpacks a kit with interactive item callouts, value and an order action.
Use it in a prompt
Use offer/whats-inside 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/whats-inside.tsx. - Import it and pass your copy and images (Props tab):
import { WhatsInside } from "@/components/funneldna/offer/whats-inside"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/whats-inside/component.tsx 554 lines
// Unpacks a kit with interactive item callouts, value and an order action.
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, Lock, PackageOpen, ShieldCheck } from 'lucide-react'
import { AmericanExpress, Discover, Mastercard, Visa } from 'react-svg-credit-card-payment-icons/icons/flat-rounded'
export type WhatsInsideProps = {
/** Supporting labels and plain-text templates; named placeholders are documented below. */
copy?: Partial<WhatsInsideCopy>
headline?: string
highlight?: string
lead?: string
/** Image for this item’s item-N slot; takes precedence over legacy image. */
itemImage?: string
/** productImage is the canonical slot image; image is retained for compatibility. */
productImage?: string
image?: string
imageAlt?: string
caption?: string
stageTag?: string
items?: WhatsInsideItem[]
regularLabel?: string
/** Struck-through total value. Shown only when supplied. */
regularPrice?: string
todayLabel?: string
price?: string
/** Line under the price, e.g. billing terms. Shown only when supplied. */
note?: string
saveLabel?: string | false
label?: string
loadingLabel?: string
sublabel?: string
href?: string
linkLabel?: string
guarantee?: string
paymentMarks?: WhatsInsidePaymentMark[]
/** Deprecated: ignored. The builder wires what happens after the action. */
successMessage?: string
errorMessage?: string
onAction?: () => void | Promise<unknown>
disabled?: boolean
state?: WhatsInsideState
id?: string
className?: string
style?: React.CSSProperties
}
export function WhatsInside({
headline = 'Here’s everything inside the kit',
highlight = 'everything inside',
lead = 'Get the guide, workbook, and checklist in one download. One payment. Yours to keep.',
image: legacyImage,
productImage: image = legacyImage,
imageAlt = 'Everything included in the kit, laid out together',
caption = 'Everything shown arrives together in one download.',
stageTag,
items: suppliedItems = DEFAULT_ITEMS,
regularLabel = 'Total value',
regularPrice,
todayLabel = 'Get the complete kit for',
price = '$47',
note,
saveLabel,
label = 'Yes! Give Me Access',
loadingLabel = 'Opening secure checkout',
sublabel = '',
href = '#order',
linkLabel,
guarantee = '30-day money-back guarantee',
paymentMarks = ['visa', 'mastercard', 'amex', 'discover'],
errorMessage = 'Checkout didn’t open. Please try again.',
onAction,
disabled = false,
state = 'default',
id,
className = '',
style,
copy,
}: WhatsInsideProps) {
const text = { ...DEFAULT_COPY, ...copy }
const items = suppliedItems.map(item => ({ ...item, image: item.itemImage === undefined ? item.image : item.itemImage }))
const uid = React.useId()
const headId = `${uid}-h`
const [active, setActive] = React.useState<number | null>(null)
const [status, setStatus] = React.useState<'idle' | 'loading' | 'error'>(statusFor(state))
React.useEffect(() => {
setStatus(statusFor(state))
}, [state])
const isDisabled = disabled || state === 'disabled'
const forced = state === 'hover' || state === 'active' ? state : undefined
const loading = status === 'loading'
const saved = savings(regularPrice, price)
const save = saveLabel === false ? null : saveLabel ?? (saved ? copyText(text.savings, { amount: saved }) : null)
const tagText = stageTag ?? copyText(text.itemCount, { count: items.length })
const n = items.length
const handle = async (e: React.MouseEvent<HTMLElement>) => {
if (isDisabled || loading) {
e.preventDefault()
return
}
if (!onAction) return
e.preventDefault()
setStatus('loading')
try {
await onAction()
setStatus('idle')
} catch {
setStatus('error')
}
}
const inner = (
<>
<span className='wi-btn-lab'>{loading ? loadingLabel : label}</span>
{loading && <Loader2 className='wi-btn-ico wi-spin' aria-hidden='true' strokeWidth={2.75} />}
</>
)
const button =
href && !onAction ? (
<a
className='wi-btn'
href={href}
aria-disabled={isDisabled || undefined}
data-disabled={isDisabled ? '' : undefined}
data-force={forced}
onClick={handle}
>
{inner}
</a>
) : (
<button
type='button'
className='wi-btn'
disabled={isDisabled}
data-disabled={isDisabled ? '' : undefined}
data-force={forced}
aria-busy={loading || undefined}
onClick={handle}
>
{inner}
</button>
)
const marks = paymentMarks.filter((m) => MARKS[m])
const thumbFor = (item: WhatsInsideItem, i: number): { style?: React.CSSProperties; img: boolean; fill: boolean } => {
if (image) {
const f = item.focus ?? item.spot ?? { x: ((i + 1) / (n + 1)) * 100, y: 50 }
return { img: true, fill: false, style: { backgroundImage: `url("${image}")`, backgroundPosition: cropAt(f.x, f.y) } }
}
if (item.image) return { img: true, fill: true, style: { backgroundImage: `url("${item.image}")` } }
return { img: false, fill: false }
}
return (
<section id={id} className={`cf-whats-inside ${className}`.trim()} style={style} aria-labelledby={headId}>
<style>{CSS}</style>
<BoxMotif className='wi-motif wi-motif--a' />
<BoxMotif className='wi-motif wi-motif--b' />
<div className='wi-wrap'>
<header className='wi-head'>
<h2 id={headId} className='wi-h'>
<Headline text={headline} mark={highlight} />
</h2>
{lead && <p className='wi-lead'>{lead}</p>}
</header>
<div className='wi-grid'>
<figure className='wi-stage'>
<div className='wi-card'>
{tagText && (
<span className='wi-stagetag'>
<PackageOpen aria-hidden='true' strokeWidth={2.5} />
{tagText}
</span>
)}
<div className='wi-photo' data-has-active={active !== null ? '' : undefined}>
{image ? (
<img src={image} alt={imageAlt} width={1536} height={1024} decoding='async' />
) : (
<div className='wi-fan' aria-hidden='true'>
{items.slice(0, 4).map((item, i) => (
<span key={item.name} className='wi-fan-item' style={{ '--r': FAN[i % FAN.length] } as React.CSSProperties}>
{item.image && <img src={item.image} alt='' />}
<span className='wi-fan-n'>{i + 1}</span>
</span>
))}
</div>
)}
{image &&
items.map((item, i) => {
const x = item.spot?.x ?? ((i + 1) / (n + 1)) * 100
const y = item.spot?.y ?? 50
return (
<button
key={item.name}
type='button'
className='wi-pin'
data-active={active === i ? '' : undefined}
data-side={item.spot?.side ?? 'top'}
style={{ '--x': `${x}%`, '--y': `${y}%`, '--i': i } as React.CSSProperties}
aria-pressed={active === i}
aria-label={copyText(text.pinAria, { number: i + 1, name: item.name })}
aria-describedby={`${uid}-d${i}`}
onPointerEnter={() => setActive(i)}
onPointerLeave={() => setActive(null)}
onFocus={() => setActive(i)}
onBlur={() => setActive(null)}
onClick={() => setActive(i)}
>
<span aria-hidden='true'>{i + 1}</span>
<span className='wi-tag' aria-hidden='true'>
{item.tag || item.name}
</span>
</button>
)
})}
</div>
{caption && <figcaption className='wi-cap'>{caption}</figcaption>}
</div>
</figure>
<div className='wi-side'>
<div className='wi-slip'>
<ol className='wi-list'>
{items.map((item, i) => {
const t = thumbFor(item, i)
return (
<li
key={item.name}
className='wi-row'
data-active={active === i ? '' : undefined}
style={{ '--i': i } as React.CSSProperties}
onPointerEnter={() => setActive(i)}
onPointerLeave={() => setActive(null)}
>
<span
className='wi-thumb'
data-img={t.img ? '' : undefined}
data-fill={t.fill ? '' : undefined}
style={t.style}
aria-hidden='true'
>
<span className='wi-tn'>{i + 1}</span>
</span>
<div>
<h3 className='wi-name'>{item.name}</h3>
<p className='wi-detail' id={`${uid}-d${i}`}>
{item.detail}
</p>
</div>
{item.value && (
<span className='wi-val'>
<b>{item.value}</b> {text.itemValue}
</span>
)}
</li>
)
})}
</ol>
<div className='wi-offer'>
{regularPrice && (
<p className='wi-was'>
{regularLabel}
<s>{regularPrice}</s>
</p>
)}
{todayLabel && <p className='wi-for'>{todayLabel}</p>}
<div className='wi-now'>
<span className='wi-amt'>{price}</span>
{save && <span className='wi-save'>{save}</span>}
</div>
{note && <p className='wi-note'>{note}</p>}
<div className='wi-act'>
{button}
{status === 'error' && (
<p className='wi-err' role='alert'>
<AlertCircle aria-hidden='true' strokeWidth={2.5} />
{errorMessage}
</p>
)}
{sublabel && (
<p className='wi-sub'>
<Lock aria-hidden='true' strokeWidth={2.5} />
{sublabel}
</p>
)}
{linkLabel && (
<a className='wi-link' href={href} onClick={handle}>
{linkLabel}
</a>
)}
</div>
{(guarantee || marks.length > 0) && (
<div className='wi-trust'>
{guarantee && (
<span className='wi-guar'>
<ShieldCheck aria-hidden='true' strokeWidth={2.5} />
{guarantee}
</span>
)}
{marks.length > 0 && (
<span className='wi-pays'>
{marks.map((m) => {
const { Icon } = MARKS[m]
const markLabel = text[m]
return (
<span key={m} className='wi-pay' role='img' aria-label={markLabel}>
<Icon width={38} height={24} aria-hidden='true' />
</span>
)
})}
</span>
)}
</div>
)}
</div>
</div>
</div>
</div>
</div>
</section>
)
}
export default WhatsInside
export type WhatsInsideItem = {
name: string
detail: string
value?: string
tag?: string
/** Pin position on the main image, in % of its width and height. */
spot?: { x: number; y: number; side?: 'top' | 'bottom' }
/** Centre of this item in the main image, in %, used for its close-up thumbnail. Defaults to spot. */
focus?: { x: number; y: number }
/** Image for this item’s item-N slot; takes precedence over legacy image. */
itemImage?: string
image?: string
imageAlt?: string
}
export type WhatsInsidePaymentMark = 'visa' | 'mastercard' | 'amex' | 'discover'
export type WhatsInsideState = 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
const DEFAULT_ITEMS: WhatsInsideItem[] = [
{ name: 'Funnel Planning Guide', detail: 'Map your offer and the pages your funnel needs.', tag: 'Planning Guide' },
{ name: 'Page Copy Workbook', detail: 'Draft your headline, offer, and call to action.', tag: 'Copy Workbook' },
{ name: 'Launch Checklist', detail: 'Review the links, forms, and next steps before launch.', tag: 'Launch Checklist' },
]
const MARKS = {
visa: { Icon: Visa },
mastercard: { Icon: Mastercard },
amex: { Icon: AmericanExpress },
discover: { Icon: Discover },
}
const FAN = ['-6deg', '2deg', '7deg', '-3deg']
function toNumber(v?: string) {
if (!v) return null
const n = parseFloat(v.replace(/[^0-9.]/g, ''))
return Number.isFinite(n) ? n : null
}
function savings(regular?: string, now?: string) {
const a = toNumber(regular)
const b = toNumber(now)
if (a === null || b === null || a <= b) return null
const cur = (now || '').match(/^[^0-9]*/)?.[0] || ''
const d = a - b
return cur + (Number.isInteger(d) ? String(d) : d.toFixed(2))
}
function clamp(n: number) {
return Math.max(0, Math.min(100, n))
}
function cropAt(x: number, y: number) {
const w = 1 / 3
const h = 1 / 2
const px = clamp(((x / 100 - w / 2) / (1 - w)) * 100)
const py = clamp(((y / 100 - h / 2) / (1 - h)) * 100)
return `${px.toFixed(1)}% ${py.toFixed(1)}%`
}
function Headline({ text, mark }: { text: string; mark?: string }) {
const at = mark ? text.indexOf(mark) : -1
if (!mark || at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className='wi-mark'>{mark}</span>
{text.slice(at + mark.length)}
</>
)
}
function statusFor(state: WhatsInsideState) {
return state === 'error' ? 'error' : 'idle'
}
// Designed images, official payment marks and black/white alpha shadows retain their colours.
const CSS = `
.cf-whats-inside{--wi-band:var(--band,#0f2747);--wi-on:var(--band-ink,#ffffff);--wi-ink:var(--ink,#101828);--wi-muted:var(--muted,#4a5565);--wi-card:var(--card,#ffffff);--wi-marker:var(--marker, #fae37c);--wi-cream:var(--card);--wi-accent:var(--accent,#0f5fc2);--wi-r:var(--radius,14px);position:relative;isolation:isolate;overflow:hidden;overflow:clip;background:var(--wi-band);color:var(--wi-on);font-family:var(--font-body,Arial,sans-serif);padding:clamp(60px,8vw,112px) clamp(16px,4vw,40px) clamp(68px,8.5vw,120px)}
.cf-whats-inside *,.cf-whats-inside *::before,.cf-whats-inside *::after{box-sizing:border-box}
:where(.cf-whats-inside) .wi-motif{position:absolute;z-index:-1;pointer-events:none;color:var(--wi-on);opacity:.07}
:where(.cf-whats-inside) .wi-motif--a{width:clamp(300px,40vw,560px);top:-50px;right:-110px;transform:rotate(8deg)}
:where(.cf-whats-inside) .wi-motif--b{width:clamp(220px,28vw,400px);bottom:-70px;left:-90px;transform:rotate(-10deg)}
:where(.cf-whats-inside) .wi-wrap{position:relative;max-width:1200px;margin:0 auto}
:where(.cf-whats-inside) .wi-head{text-align:center;max-width:1000px;margin:0 auto clamp(48px,5.5vw,76px)}
:where(.cf-whats-inside) .wi-h{margin:0 auto;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight, 800);font-size:clamp(2.25rem,5.6vw,4.5rem);line-height:1.06;letter-spacing:var(--display-tracking, -.02em);color:var(--wi-on);text-wrap:balance;text-transform:var(--display-case, none)}
:where(.cf-whats-inside) .wi-mark{color:var(--wi-ink);background-image:none;padding:0 .14em;margin:0 -.03em;border-radius:.18em .42em .26em .5em;-webkit-box-decoration-break:clone;box-decoration-break:clone;background-color:var(--wi-marker)}
:where(.cf-whats-inside) .wi-lead{margin:clamp(18px,1.8vw,24px) auto 0;max-width:46ch;font-size:clamp(1.0625rem,1.6vw,1.3125rem);font-weight:500;line-height:1.5;color:var(--band-ink);text-wrap:pretty}
:where(.cf-whats-inside) .wi-grid{display:grid;gap:clamp(40px,4.5vw,56px);align-items:start}
:where(.cf-whats-inside) .wi-stage{position:relative;margin:18px 0 0;min-width:0}
@media (min-width:1000px){:where(.cf-whats-inside) .wi-grid{grid-template-columns:minmax(0,1.12fr) minmax(0,.88fr);align-items:start}:where(.cf-whats-inside) .wi-stage{position:sticky;top:calc(var(--wi-sticky-top,24px) + 22px);align-self:start}}
:where(.cf-whats-inside) .wi-stage::before{content:'';position:absolute;inset:22px -12px -16px 18px;z-index:0;border-radius:calc(var(--wi-r) + 6px);background:color-mix(in oklch,var(--wi-band) 82%,var(--card));transform:rotate(-2.2deg)}
:where(.cf-whats-inside) .wi-card{position:relative;z-index:1;background:var(--wi-card);color:var(--wi-ink);border-radius:var(--card-radius, var(--radius, calc(var(--wi-r) + 4px)));padding:clamp(10px,1.3vw,14px);box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));border-color:var(--card-border, oklch(from var(--ink) l c h / 0.12))}
:where(.cf-whats-inside) .wi-stagetag{position:absolute;z-index:3;top:-17px;left:clamp(16px,2.4vw,28px);display:inline-flex;align-items:center;gap:8px;padding:9px 15px;border-radius:999px;background:var(--wi-band);color:var(--wi-on);font:var(--display-weight, 800) 14px/1 var(--font-display,Arial,sans-serif);letter-spacing:.01em;white-space:nowrap;box-shadow:0 0 0 3px var(--wi-card),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-whats-inside) .wi-stagetag svg{width:17px;height:17px;color:var(--wi-marker);flex:none}
:where(.cf-whats-inside) .wi-photo{position:relative;container-type:inline-size;aspect-ratio:3/2;border-radius:var(--wi-r);overflow:hidden;background:var(--card)}
:where(.cf-whats-inside) .wi-photo>img{display:block;width:100%;height:100%;object-fit:cover}
:where(.cf-whats-inside) .wi-pin{position:absolute;left:var(--x);top:var(--y);z-index:2;width:42px;height:42px;margin:-21px 0 0 -21px;padding:0;border:3px solid var(--card);border-radius:var(--button-radius, var(--radius, 50%));background:var(--button-2-bg, var(--card));color:var(--button-2-ink, var(--ink));font:var(--button-weight, 800) 16px/1 var(--font-display,Arial,sans-serif);display:grid;place-items:center;cursor:pointer;box-shadow:var(--button-shadow, var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)));transition:transform .2s ease,background-color .2s ease,box-shadow .2s ease;animation:wi-pop .42s cubic-bezier(.2,.9,.3,1.3) backwards;animation-delay:calc(var(--i) * 90ms + 120ms);border-color:var(--button-2-border, oklch(from var(--ink) l c h / 0.22));font-family:var(--button-font, var(--font-display));text-transform:var(--button-case, none)}
:where(.cf-whats-inside) .wi-pin::before{content:'';position:absolute;inset:-7px;border-radius:50%}
:where(.cf-whats-inside) .wi-pin::after{content:'';position:absolute;inset:-3px;border-radius:50%;border:3px solid var(--wi-marker);opacity:0;pointer-events:none;animation:wi-ping 1.5s ease-out 2;animation-delay:calc(var(--i) * 220ms + 600ms)}
:where(.cf-whats-inside) .wi-photo[data-has-active] .wi-pin:not([data-active]){background:var(--button-2-bg, var(--card));color:var(--button-2-ink, var(--ink))}
:where(.cf-whats-inside) .wi-pin:hover,:where(.cf-whats-inside) .wi-pin[data-active]{background:var(--button-2-bg, var(--card));transform:scale(1.12);box-shadow:var(--button-shadow, var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)));color:var(--button-2-ink, var(--ink))}
:where(.cf-whats-inside) .wi-pin:active{transform:scale(1.02)}
:where(.cf-whats-inside) .wi-pin:focus-visible{outline:3px solid var(--wi-band);outline-offset:7px}
:where(.cf-whats-inside) .wi-tag{position:absolute;left:50%;bottom:calc(100% + 14px);transform:translateX(-50%);display:none;white-space:nowrap;padding:8px 13px;border-radius:999px;background:var(--card);color:var(--wi-ink);font:var(--display-weight, 800) 15px/1.1 var(--font-display,Arial,sans-serif);box-shadow:0 0 0 1px oklch(from var(--accent-fill,var(--accent)) l c h / 0.12),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14));pointer-events:none;transition:background-color .2s ease,color .2s ease}
:where(.cf-whats-inside) .wi-tag::after{content:'';position:absolute;left:50%;top:100%;width:2px;height:12px;margin-left:-1px;background:var(--card)}
:where(.cf-whats-inside) .wi-pin[data-side=bottom] .wi-tag{bottom:auto;top:calc(100% + 14px)}
:where(.cf-whats-inside) .wi-pin[data-side=bottom] .wi-tag::after{top:auto;bottom:100%}
:where(.cf-whats-inside) .wi-pin[data-active] .wi-tag{background:var(--band);color:var(--band-ink)}
:where(.cf-whats-inside) .wi-pin[data-active] .wi-tag::after{background:var(--wi-band)}
@container (min-width:500px){:where(.cf-whats-inside) .wi-tag{display:block}}
:where(.cf-whats-inside) .wi-fan{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:8%}
:where(.cf-whats-inside) .wi-fan-item{position:relative;width:34%;aspect-ratio:4/3;margin:0 -2.5%;border-radius:10px;overflow:hidden;background:var(--card);box-shadow:0 0 0 1px var(--card),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14));transform:rotate(var(--r))}
:where(.cf-whats-inside) .wi-fan-item img{display:block;width:100%;height:100%;object-fit:cover}
:where(.cf-whats-inside) .wi-fan-n{position:absolute;top:8px;left:8px;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:2px solid var(--card);background:var(--band);color:var(--band-ink);font:var(--display-weight, 800) 14px/1 var(--font-display,Arial,sans-serif)}
:where(.cf-whats-inside) .wi-cap{margin:0;padding:15px 10px 5px;font-size:15px;font-weight:600;line-height:1.4;color:var(--wi-muted);text-align:center;text-wrap:pretty}
:where(.cf-whats-inside) .wi-side{position:relative;min-width:0}
:where(.cf-whats-inside) .wi-slip{position:relative;container-type:inline-size;overflow:hidden;background:var(--wi-card);color:var(--wi-ink);border-radius:var(--card-radius, var(--radius, calc(var(--wi-r) + 4px)));box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));border-color:var(--card-border, oklch(from var(--ink) l c h / 0.12))}
:where(.cf-whats-inside) .wi-list{list-style:none;margin:0;padding:clamp(16px,2vw,22px) clamp(8px,1.6vw,16px) clamp(10px,1.4vw,14px);display:grid;gap:4px}
:where(.cf-whats-inside) .wi-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;column-gap:16px;align-items:start;padding:14px 12px;border-radius:calc(var(--wi-r) - 2px);transition:background-color .2s ease,box-shadow .2s ease;animation:wi-in .45s ease backwards;animation-delay:calc(var(--i) * 70ms)}
:where(.cf-whats-inside) .wi-row[data-active]{background:color-mix(in oklch,var(--accent-fill,var(--wi-accent)) 7%,var(--card));box-shadow:inset 0 0 0 1px color-mix(in oklch,var(--accent-fill,var(--wi-accent)) 28%,var(--card))}
:where(.cf-whats-inside) .wi-thumb{position:relative;width:66px;height:66px;margin-top:2px;border-radius:12px;background-color:transparent;background-repeat:no-repeat;background-size:auto 200%;box-shadow:none;transition:box-shadow .2s ease,transform .2s ease;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.28))}
:where(.cf-whats-inside) .wi-thumb[data-fill]{background-size:cover;background-position:center}
:where(.cf-whats-inside) .wi-row[data-active] .wi-thumb{transform:translateY(-2px);box-shadow:none}
:where(.cf-whats-inside) .wi-tn{position:absolute;top:-8px;left:-8px;display:grid;place-items:center;width:27px;height:27px;border-radius:50%;border:2px solid var(--card);background:var(--band);color:var(--band-ink);font:var(--display-weight, 800) 13px/1 var(--font-display,Arial,sans-serif);box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14));transition:background-color .2s ease}
:where(.cf-whats-inside) .wi-thumb:not([data-img]) .wi-tn{position:static;width:100%;height:100%;border:0;border-radius:12px;font-size:20px;box-shadow:none}
:where(.cf-whats-inside) .wi-row[data-active] .wi-tn{background:var(--band)}
:where(.cf-whats-inside) .wi-name{margin:4px 0 6px;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight, 800);font-size:clamp(1.125rem,1.5vw,1.25rem);line-height:1.22;letter-spacing:var(--display-tracking, -.01em);color:var(--wi-ink);text-wrap:balance;text-transform:var(--display-case, none)}
:where(.cf-whats-inside) .wi-detail{margin:0;font-size:16px;line-height:1.5;color:var(--wi-muted);text-wrap:pretty}
:where(.cf-whats-inside) .wi-val{margin-top:4px;white-space:nowrap;padding:7px 12px;border-radius:999px;background:var(--card);box-shadow:inset 0 0 0 1px var(--card),inset 0 1px 0 var(--card);font-size:14px;font-weight:600;line-height:1.1;color:var(--wi-muted)}
:where(.cf-whats-inside) .wi-val b{color:var(--wi-ink);font-weight:800}
@container (max-width:430px){:where(.cf-whats-inside) .wi-row{grid-template-columns:auto minmax(0,1fr);column-gap:14px}:where(.cf-whats-inside) .wi-thumb{width:58px;height:58px;background-color:transparent;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.28))}:where(.cf-whats-inside) .wi-val{grid-column:2;justify-self:start;margin-top:12px}}
:where(.cf-whats-inside) .wi-offer{position:relative;margin-top:6px;padding:clamp(24px,2.8vw,32px) clamp(18px,2.6vw,30px) clamp(22px,2.6vw,28px);background:var(--wi-cream);text-align:center;border-color:var(--card-border, oklch(from var(--ink) l c h / 0.12))}
:where(.cf-whats-inside) .wi-was{margin:0;font-size:17px;font-weight:600;line-height:1.3;color:var(--wi-muted)}
:where(.cf-whats-inside) .wi-was s{margin-left:7px;font-size:19px;font-weight:800;color:var(--danger);text-decoration-line:line-through;text-decoration-color:var(--danger);text-decoration-thickness:3px}
:where(.cf-whats-inside) .wi-for{margin:14px 0 0;font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight, 800);font-size:clamp(1.125rem,1.5vw,1.25rem);line-height:1.25;color:var(--wi-ink);text-wrap:balance;text-transform:var(--display-case, none)}
:where(.cf-whats-inside) .wi-now{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 14px;margin-top:12px}
:where(.cf-whats-inside) .wi-amt{font-family:var(--font-display,Arial,sans-serif);font-weight:var(--display-weight, 800);font-size:clamp(3.5rem,6vw,4.5rem);line-height:1;letter-spacing:var(--display-tracking, -.03em);color:var(--wi-ink);font-variant-numeric:tabular-nums;text-transform:var(--display-case, none)}
:where(.cf-whats-inside) .wi-save{display:inline-flex;align-items:center;padding:9px 14px;border-radius:999px;background:var(--success-soft);color:var(--success);font:var(--display-weight, 800) 15px/1 var(--font-display,Arial,sans-serif);white-space:nowrap;transform:rotate(-4deg);box-shadow:inset 0 1px 0 oklch(from var(--card) calc(l + 0.04) c h / .25),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-whats-inside) .wi-note{margin:22px 0 0;font-size:16px;font-weight:600;line-height:1.4;color:var(--wi-muted);text-wrap:pretty}
:where(.cf-whats-inside) .wi-act{margin-top:20px}
:where(.cf-whats-inside) .wi-btn{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:68px;margin:0 auto;padding:14px 20px;border:1px solid var(--cta-2,#b42318);border-radius:var(--button-radius, var(--radius, calc(var(--wi-r) - 2px)));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));text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));font-family:var(--button-font, var(--font-display));font-weight:var(--button-weight, 800);font-size:clamp(1.125rem,1.7vw,1.375rem);line-height:1.15;letter-spacing:-.005em;text-align:center;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent;box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));transition:transform .16s ease,box-shadow .16s ease;border-color:var(--button-bg-2, var(--cta-2));text-transform:var(--button-case, none)}
:where(.cf-whats-inside) .wi-btn::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(105deg,transparent 30%,oklch(from var(--card) l c h / 0.2) 48%,transparent 66%);transform:translateX(-110%);transition:transform .7s ease}
:where(.cf-whats-inside) .wi-btn:not([data-disabled]):hover,:where(.cf-whats-inside) .wi-btn[data-force=hover]{transform:translateY(-2px);box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)))}
:where(.cf-whats-inside) .wi-btn:not([data-disabled]):hover::before,:where(.cf-whats-inside) .wi-btn[data-force=hover]::before{transform:translateX(110%)}
:where(.cf-whats-inside) .wi-btn:not([data-disabled]):active,:where(.cf-whats-inside) .wi-btn[data-force=active]{transform:translateY(3px);box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)))}
:where(.cf-whats-inside) .wi-btn:focus-visible{outline:3px solid var(--wi-accent);outline-offset:3px}
:where(.cf-whats-inside) .wi-btn[data-disabled]{background:var(--button-2-bg, var(--card));border-color:var(--button-2-border, oklch(from var(--ink) l c h / 0.22));color:var(--button-2-ink, var(--ink));text-shadow:none;box-shadow:var(--button-shadow, var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14)));cursor:not-allowed}
:where(.cf-whats-inside) .wi-btn[data-disabled]::before{display:none}
:where(.cf-whats-inside) .wi-btn[aria-busy=true]{cursor:progress}
:where(.cf-whats-inside) .wi-btn-lab{text-wrap:balance}
:where(.cf-whats-inside) .wi-btn-ico{flex:none;width:1.05em;height:1.05em;transition:transform .2s ease}
:where(.cf-whats-inside) .wi-spin{animation:wi-spin .8s linear infinite}
@container (max-width:400px){:where(.cf-whats-inside) .wi-btn{font-size:1.0625rem;padding-inline:14px;gap:8px;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));box-shadow:var(--button-shadow, inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));font-family:var(--button-font, var(--font-display));text-transform:var(--button-case, none)}}
:where(.cf-whats-inside) .wi-err{display:flex;align-items:center;justify-content:center;gap:8px;margin:14px 0 0;font-size:15px;font-weight:700;line-height:1.4;color:var(--ink);text-wrap:pretty}
:where(.cf-whats-inside) .wi-err svg{flex:none;width:18px;height:18px}
:where(.cf-whats-inside) .wi-sub{display:flex;align-items:center;justify-content:center;gap:7px;margin:14px 0 0;font-size:15px;font-weight:600;line-height:1.4;color:var(--wi-muted);text-wrap:pretty}
:where(.cf-whats-inside) .wi-sub svg{flex:none;width:15px;height:15px}
:where(.cf-whats-inside) .wi-link{display:inline-block;margin-top:10px;font-size:16px;font-weight:700;color:var(--link,var(--wi-accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--wi-accent)) l c h / 0.45);text-underline-offset:.18em}
:where(.cf-whats-inside) .wi-link:hover,:where(.cf-whats-inside) .wi-link:focus-visible{color:oklch(from var(--link,var(--wi-accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
:where(.cf-whats-inside) .wi-link:focus-visible{outline:3px solid var(--wi-accent);outline-offset:3px;border-radius:4px}
:where(.cf-whats-inside) .wi-trust{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 16px;margin-top:16px}
:where(.cf-whats-inside) .wi-guar{display:inline-flex;align-items:center;gap:7px;font-size:15px;font-weight:700;line-height:1.3;color:var(--wi-ink)}
:where(.cf-whats-inside) .wi-guar svg{flex:none;width:18px;height:18px;color:var(--success);background:var(--success-soft)}
:where(.cf-whats-inside) .wi-pays{display:inline-flex;gap:6px}
:where(.cf-whats-inside) .wi-pay{display:inline-flex;width:38px;height:24px;border-radius:4px;overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14))}
:where(.cf-whats-inside) .wi-pay svg{display:block;width:100%;height:100%}
@keyframes wi-in{from{opacity:.82;transform:translateY(8px)}}
@keyframes wi-pop{from{transform:scale(.6)}}
@keyframes wi-ping{0%{opacity:.9;transform:scale(1)}100%{opacity:0;transform:scale(1.9)}}
@keyframes wi-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.cf-whats-inside *,.cf-whats-inside *::before,.cf-whats-inside *::after{animation:none!important;transition:none!important}:where(.cf-whats-inside) .wi-btn::before{display:none}}
`
function BoxMotif({ className }: { className: string }) {
return (
<svg className={className} viewBox='0 0 200 160' fill='none' stroke='currentColor' strokeWidth='1.6' strokeLinejoin='round' aria-hidden='true'>
<path d='M40 70 L100 96 L160 70 L100 46 Z' />
<path d='M40 70 V128 L100 154 V96' />
<path d='M160 70 V128 L100 154' />
<path d='M40 70 L18 44 L78 20 L100 46' />
<path d='M160 70 L182 44 L122 20 L100 46' />
<path d='M40 70 L14 98 L74 124 L100 96' />
<path d='M160 70 L186 98 L126 124 L100 96' />
</svg>
)
}
type WhatsInsideCopy = {
/** Uses {number} and {name}. */
pinAria: string
visa: string
mastercard: string
amex: string
discover: string
itemValue: string
/** Uses {amount}. */
savings: string
/** Uses {count}; stageTag overrides this template. */
itemCount: string
}
const DEFAULT_COPY: WhatsInsideCopy = {
"pinAria": "{number}. {name}",
"visa": "Visa",
"mastercard": "Mastercard",
"amex": "American Express",
"discover": "Discover",
"itemValue": "value",
"savings": "You save {amount}",
"itemCount": "{count} items inside"
}
function copyText(template: string, values: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => Object.hasOwn(values, key) ? String(values[key]) : match)
}
pieces/offer/whats-inside/specimen.tsx 50 lines
import __studioImage20928944 from "../assets/f85b4e628b63ef82.webp";
import * as React from 'react'
import WhatsInside from '../whats-inside'
import { slot } from '../../slots'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error'
const TAGS = ['Planning Guide', 'Copy Workbook', 'Launch Checklist']
const SPOTS = [
{ x: 23, y: 52 },
{ x: 51, y: 56 },
{ x: 79, y: 48 },
]
const FOCUS = [
{ x: 16, y: 60 },
{ x: 49, y: 56 },
{ x: 84, y: 58 },
]
export default function WhatsInsideSpecimen({ state = 'default' }: { state?: SpecimenState }) {
const s = defaults.sample
const items = s.items.map((item, i) => ({ ...item, itemImage: slot(`item-${i + 1}`, item.image), tag: TAGS[i], spot: SPOTS[i], focus: FOCUS[i] }))
return (
<div>
<WhatsInside
headline={`Here’s everything inside ${s.name}`}
highlight='everything inside'
lead={s.reason}
productImage={slot("product", __studioImage20928944)}
imageAlt={`Flat-lay of ${s.name}: the planning guide, copy workbook, and launch checklist`}
caption='The guide, workbook, and checklist, delivered together as one instant download.'
stageTag={`${items.length} tools inside`}
items={items}
regularLabel='Total value'
regularPrice={s.regularPrice}
todayLabel={s.todayLabel}
price={s.price}
note={s.note}
label={s.label}
sublabel={s.sublabel}
guarantee={s.guarantee}
state={state}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalWhatsInside |
Partial<WhatsInsideCopy> |
|
headline OptionalWhatsInside |
string |
Default 'Here’s everything inside the kit'
|
highlight OptionalWhatsInside |
string |
Default 'everything inside'
|
lead OptionalWhatsInside |
string |
Default 'Get the guide, workbook, and checklist in one download. One payment. Yours to keep.'
|
itemImage OptionalWhatsInside |
string |
|
productImage OptionalWhatsInside |
string |
Default legacyImage
|
image OptionalWhatsInside |
string |
|
imageAlt OptionalWhatsInside |
string |
Default 'Everything included in the kit, laid out together'
|
caption OptionalWhatsInside |
string |
Default 'Everything shown arrives together in one download.'
|
stageTag OptionalWhatsInside |
string |
|
items OptionalWhatsInside |
WhatsInsideItem[] |
Default DEFAULT_ITEMS
|
regularLabel OptionalWhatsInside |
string |
Default 'Total value'
|
regularPrice OptionalWhatsInside |
string |
|
todayLabel OptionalWhatsInside |
string |
Default 'Get the complete kit for'
|
price OptionalWhatsInside |
string |
Default '$47'
|
note OptionalWhatsInside |
string |
|
saveLabel OptionalWhatsInside |
string | false |
|
label OptionalWhatsInside |
string |
Default 'Yes! Give Me Access'
|
loadingLabel OptionalWhatsInside |
string |
Default 'Opening secure checkout'
|
sublabel OptionalWhatsInside |
string |
Default ''
|
href OptionalWhatsInside |
string |
Default '#order'
|
linkLabel OptionalWhatsInside |
string |
|
guarantee OptionalWhatsInside |
string |
Default '30-day money-back guarantee'
|
paymentMarks OptionalWhatsInside |
WhatsInsidePaymentMark[] |
Default ['visa', 'mastercard', 'amex', 'discover']
|
successMessage OptionalWhatsInside |
string |
|
errorMessage OptionalWhatsInside |
string |
Default 'Checkout didn’t open. Please try again.'
|
onAction OptionalWhatsInside |
() => void | Promise<unknown> |
|
disabled OptionalWhatsInside |
boolean |
Default false
|
state OptionalWhatsInside |
WhatsInsideState |
Default 'default'
|
id OptionalWhatsInside |
string |
|
className OptionalWhatsInside |
string |
Default ''
|
style OptionalWhatsInside |
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.
--marker- The highlighter colour behind key phrases.
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
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f85b4e628b63ef82.webp
image/webp · 154 KB