Whats Inside 5
Puts the physical product on a lit stage so the buyer inspects it as in a store: every piece in the box or every spec stands beside it, then the total value, today’s price and one action.
Use it in a prompt
Use offer/whats-inside-5 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/offer/whats-inside-5.tsx. - Import it and pass your copy and images (Props tab):
import { WhatsInside5 } from "@/components/funneldna/offer/whats-inside-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/whats-inside-5/component.tsx 554 lines
// layout: product-stage
// Puts the physical product on a lit stage so the buyer inspects it as in a store: every piece in the box or every spec stands beside it, then the total value, today’s price and one action.
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, Package, Ruler, ShieldCheck } from 'lucide-react'
import { FX_HOST, Spotlight } from '../fx/fx'
/** States this piece implements: hover/active force the button look, disabled locks it, error shows the checkout message. */
export type WhatsInside5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
/** Which set of notes stands beside the product. */
export type WhatsInside5Tab = 'box' | 'specs'
export type WhatsInside5Item = {
name: string
/** One short line on what it does for the buyer. */
detail?: string
/** Supplied value only, e.g. $12. Summed into the total value when every item has one. */
value?: string
/** How many ship; shown as a chip when more than one. */
quantity?: number
}
export type WhatsInside5Spec = {
/** Short data label, e.g. Weight. */
label: string
/** The figure, e.g. 340 g. Supplied facts only. */
value: string
detail?: string
}
export type WhatsInside5Copy = {
boxTab: string
specsTab: string
/** Accessible name of the toggle. */
tabsLabel: string
/** Caption under the stage; {count} is the number of pieces. */
countOne: string
countMany: string
/** {value} is the item value. */
itemValue: string
/** {n} is the quantity. */
quantity: string
valueLabel: string
/** The reveal line between the total value and today’s price. */
valueBut: string
todayLabel: string
}
export type WhatsInside5Props = {
/** Generated labels and accessible names; any key left out keeps its default. */
copy?: Partial<WhatsInside5Copy>
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
emphasis?: string | false
lead?: string | false
/** Name under the stage. */
productName?: string | false
/** product slot: the physical product as a transparent cut-out, centred on the stage. */
productImage?: string
imageAlt?: string
/** Everything that ships, in order. The first half stands left of the product, the rest right. */
items?: WhatsInside5Item[]
/** Notes on the Specs side of the toggle. Supplied facts only. */
specs?: WhatsInside5Spec[]
defaultTab?: WhatsInside5Tab
/** Total value shown before the price. Left undefined, it is the sum of the item values when every item has one; false hides it. */
totalValue?: string | false
price?: string
/** Terms under the price. Supplied facts only. */
priceNote?: string | false
label?: string
/** Button text while onAction is pending. */
loadingLabel?: string
/** Quiet line under the button. Without secondaryHref it flips the notes to Specs. */
secondaryLine?: string | false
secondaryHref?: string
/** Guarantee under the button. Supplied facts only. */
guarantee?: string | false
/** Shown when onAction rejects, or in the error state. */
errorMessage?: string
/** Checkout destination, used when there is no onAction. */
href?: string
/** Called when the button is pressed. Nothing is sent by this component. */
onAction?: () => void | Promise<unknown>
disabled?: boolean
state?: WhatsInside5State
id?: string
className?: string
style?: React.CSSProperties
}
type Status = 'idle' | 'loading' | 'error'
const DEFAULT_COPY: WhatsInside5Copy = {
boxTab: 'In the box',
specsTab: 'Specs',
tabsLabel: 'Inspect the kit',
countOne: '{count} piece in one box',
countMany: '{count} pieces in one box',
itemValue: '{value} value',
quantity: '× {n}',
valueLabel: 'Total value',
valueBut: 'But you won’t pay that.',
todayLabel: 'Your price today',
}
const DEFAULT_ITEMS: WhatsInside5Item[] = [
{ name: 'Ridgeline Lantern', detail: '400-lumen lantern with warm and cool white light.', value: '$59' },
{ name: 'Diffuser shade', detail: 'Folds flat and spreads soft light over a whole table.', value: '$12' },
{ name: 'Tripod mount', detail: 'Screws into the base so the lantern stands on any tripod.', value: '$8' },
{ name: 'Braided USB-C cable', detail: 'Charge from a wall plug, a car port or a power bank.', value: '$9' },
{ name: 'Carabiner hook', detail: 'Hang it from a tent loop, a pack strap or a branch.', value: '$6' },
{ name: 'Roll-top carry pouch', detail: 'Padded, splash-proof and sized for the whole kit.', value: '$14' },
]
const DEFAULT_SPECS: WhatsInside5Spec[] = [
{ label: 'Weight', value: '340 g', detail: 'Lantern with its battery fitted.' },
{ label: 'Battery', value: '5,200 mAh', detail: 'Built in. Recharges in 4 hours over USB-C.' },
{ label: 'Run time', value: 'Up to 36 h', detail: 'On low. About 6 hours at full brightness.' },
{ label: 'Brightness', value: '400 lumens', detail: 'Three levels in warm or cool white.' },
{ label: 'Materials', value: 'Anodised aluminium', detail: 'Frosted, shatter-resistant polycarbonate globe.' },
{ label: 'Weather', value: 'IPX4', detail: 'Shrugs off rain and splashes from any side.' },
]
export function WhatsInside5(props: WhatsInside5Props) {
const {
copy,
headline = 'Open the box before you buy it',
emphasis = 'before you buy it',
lead = 'Every piece that ships and every number that matters, on one stage. Look it over like you would in the store.',
productName = 'Ridgeline Lantern Kit',
productImage,
imageAlt = 'The Ridgeline Lantern Kit: lantern, diffuser shade, tripod mount, USB-C cable, carabiner hook and carry pouch',
items = DEFAULT_ITEMS,
specs = DEFAULT_SPECS,
defaultTab = 'box',
totalValue,
price = '$69',
priceNote = 'One payment · Ships in one box',
label = 'Send Me the Ridgeline Kit',
loadingLabel = 'Opening secure checkout…',
secondaryLine = 'or flip to Specs and check every number first',
secondaryHref,
guarantee = false,
errorMessage = 'We couldn’t open checkout. Please try again.',
href,
onAction,
disabled = false,
state = 'default',
id,
className,
style,
} = props
const text = { ...DEFAULT_COPY, ...copy }
const uid = React.useId().replace(/:/g, '')
const tabs: WhatsInside5Tab[] = []
if (items.length) tabs.push('box')
if (specs.length) tabs.push('specs')
const [picked, setPicked] = React.useState<WhatsInside5Tab>(defaultTab)
const tab: WhatsInside5Tab = tabs.includes(picked) ? picked : tabs[0] || 'box'
const [status, setStatus] = React.useState<Status>(state === 'error' ? 'error' : 'idle')
const alive = React.useRef(true)
const tabRefs = React.useRef<Partial<Record<WhatsInside5Tab, HTMLButtonElement | null>>>({})
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setStatus(state === 'error' ? 'error' : 'idle')
}, [state])
const isDisabled = disabled || state === 'disabled'
const loading = status === 'loading'
const force = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-press' : ''
const value = totalValue === false ? undefined : totalValue || sumValues(items)
const count = items.reduce((n, item) => n + Math.max(1, item.quantity || 1), 0)
const noteCount = tab === 'specs' ? specs.length : items.length
const half = Math.ceil(noteCount / 2)
const hasTabs = tabs.length > 1
const index = Math.max(0, tabs.indexOf(tab))
const headId = `${uid}-h`
const panelId = `${uid}-p`
const tabId = (t: WhatsInside5Tab) => `${uid}-t-${t}`
function select(next: WhatsInside5Tab, focus = false) {
setPicked(next)
if (focus) tabRefs.current[next]?.focus()
}
function onTabKey(e: React.KeyboardEvent<HTMLButtonElement>, i: number) {
const last = tabs.length - 1
let n = -1
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') n = i === last ? 0 : i + 1
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') n = i === 0 ? last : i - 1
else if (e.key === 'Home') n = 0
else if (e.key === 'End') n = last
if (n < 0) return
e.preventDefault()
select(tabs[n], true)
}
function showSpecs() {
select('specs')
const el = tabRefs.current.specs
if (!el) return
const reduce = typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
el.focus({ preventScroll: true })
el.scrollIntoView({ block: 'center', behavior: reduce ? 'auto' : 'smooth' })
}
async function act(e: React.MouseEvent) {
if (isDisabled || loading) {
e.preventDefault()
return
}
if (!onAction) return
e.preventDefault()
setStatus('loading')
try {
await onAction()
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
const rows =
tab === 'specs'
? specs.map((spec, i) => (
<li key={spec.label + i} className='wi5-note wi5-note--spec' data-side={i < half ? 'l' : 'r'} style={noteStyle(i, half)}>
<p className='wi5-nl'>{spec.label}</p>
<p className='wi5-nt'>{spec.value}</p>
{spec.detail ? <p className='wi5-nd'>{spec.detail}</p> : null}
</li>
))
: items.map((item, i) => {
const qty = Math.max(1, item.quantity || 1)
return (
<li key={item.name + i} className='wi5-note' data-side={i < half ? 'l' : 'r'} style={noteStyle(i, half)}>
<p className='wi5-nt'>{item.name}</p>
{item.detail ? <p className='wi5-nd'>{item.detail}</p> : null}
{qty > 1 || item.value ? (
<p className='wi5-chips'>
{qty > 1 ? <span className='wi5-chip'>{fill(text.quantity, { n: qty })}</span> : null}
{item.value ? <span className='wi5-chip'>{fill(text.itemValue, { value: item.value })}</span> : null}
</p>
) : null}
</li>
)
})
const inner = loading ? (
<>
<Loader2 className='wi5-spin' size={20} strokeWidth={2.5} aria-hidden />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)
const btnClass = `wi5-btn${force}`
const button =
href && !onAction && !isDisabled ? (
<a className={btnClass} href={href} onClick={act}>
{inner}
</a>
) : (
<button type='button' className={btnClass} disabled={isDisabled} aria-busy={loading || undefined} onClick={act}>
{inner}
</button>
)
const secondary = !secondaryLine ? null : secondaryHref ? (
<a className='wi5-sec' href={secondaryHref}>
{secondaryLine}
</a>
) : hasTabs ? (
<button type='button' className='wi5-sec' onClick={showSpecs}>
{secondaryLine}
</button>
) : null
const caption = productName || count
return (
<section
id={id}
className={['cf-whats-inside-5', className].filter(Boolean).join(' ')}
style={{ ...FX_HOST, ...style }}
aria-labelledby={headId}
>
<Spotlight />
<style>{CSS}</style>
<div className='wi5-wrap'>
<header className='wi5-head'>
<h2 id={headId} className='wi5-h'>
<Marked text={headline} mark={emphasis} />
</h2>
{lead ? <p className='wi5-lead'>{lead}</p> : null}
</header>
<div className={`wi5-show${productImage ? '' : ' is-bare'}`}>
{hasTabs ? (
<div className='wi5-tabs' role='tablist' aria-label={text.tabsLabel} style={{ '--n': tabs.length, '--i': index } as React.CSSProperties}>
<span className='wi5-thumb' aria-hidden />
{tabs.map((t, i) => {
const on = t === tab
return (
<button
key={t}
ref={(el) => {
tabRefs.current[t] = el
}}
type='button'
role='tab'
id={tabId(t)}
aria-selected={on}
aria-controls={panelId}
tabIndex={on ? 0 : -1}
className='wi5-tab'
onClick={() => select(t)}
onKeyDown={(e) => onTabKey(e, i)}
>
{t === 'box' ? <Package size={18} strokeWidth={2.5} aria-hidden /> : <Ruler size={18} strokeWidth={2.5} aria-hidden />}
<span>{t === 'box' ? text.boxTab : text.specsTab}</span>
<span className='wi5-tabn' aria-hidden>
{t === 'box' ? items.length : specs.length}
</span>
</button>
)
})}
</div>
) : null}
{productImage ? (
<figure className='wi5-stage'>
<div className='wi5-pad'>
<div className='wi5-plat' aria-hidden>
<span className='wi5-plat-top' />
</div>
<img className='wi5-img' src={productImage} alt={imageAlt} width={1024} height={1024} decoding='async' />
</div>
{caption ? (
<figcaption className='wi5-cap'>
{productName ? <strong>{productName}</strong> : null}
{count ? <span>{fill(count === 1 ? text.countOne : text.countMany, { count })}</span> : null}
</figcaption>
) : null}
</figure>
) : null}
{noteCount ? (
<div
className='wi5-panel'
id={panelId}
role={hasTabs ? 'tabpanel' : undefined}
aria-labelledby={hasTabs ? tabId(tab) : undefined}
tabIndex={hasTabs ? 0 : undefined}
>
<ul key={tab} className='wi5-list'>
{rows}
</ul>
</div>
) : null}
</div>
<div className='wi5-close'>
<div className='wi5-price'>
{value ? (
<>
<p className='wi5-pv'>
<span className='wi5-micro'>{text.valueLabel}</span>
<span className='wi5-vnum'>{value}</span>
</p>
<p className='wi5-but'>{text.valueBut}</p>
</>
) : null}
{price ? (
<p className='wi5-pt'>
<span className='wi5-micro'>{text.todayLabel}</span>
<span className='wi5-pnum'>{price}</span>
</p>
) : null}
</div>
{priceNote ? <p className='wi5-pnote'>{priceNote}</p> : null}
<div className='wi5-act'>{button}</div>
{status === 'error' ? (
<p className='wi5-err' role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden />
{errorMessage}
</p>
) : null}
{secondary}
{guarantee ? (
<p className='wi5-g'>
<ShieldCheck size={16} strokeWidth={2.5} aria-hidden />
{guarantee}
</p>
) : null}
</div>
</div>
</section>
)
}
export default WhatsInside5
function Marked({ text, mark }: { text: string; mark?: string | false }) {
const at = mark ? text.indexOf(mark) : -1
if (!mark || at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className='wi5-mark'>{mark}</span>
{text.slice(at + mark.length)}
</>
)
}
function noteStyle(i: number, half: number) {
const row = i < half ? i : i - half
return { '--r': row + 1, '--d': `${Math.min(row * 0.07, 0.28)}s` } as React.CSSProperties
}
function fill(template: string, vars: Record<string, string | number>) {
return template.replace(/[{]([a-z]+)[}]/gi, (whole, key: string) => (key in vars ? String(vars[key]) : whole))
}
function sumValues(items: WhatsInside5Item[]): string | undefined {
if (!items.length) return undefined
let prefix: string | null = null
let total = 0
let decimals = 0
for (const item of items) {
const m = /^([^0-9]*)([0-9,]+(?:[.]([0-9]+))?)/.exec((item.value || '').trim())
if (!m) return undefined
const p = m[1].trim()
if (prefix !== null && p !== prefix) return undefined
prefix = p
total += Number(m[2].replace(/,/g, ''))
decimals = Math.max(decimals, m[3] ? m[3].length : 0)
}
return (prefix || '') + total.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals })
}
const CSS = `
.cf-whats-inside-5{--wi5-ink:var(--band-ink,oklch(1 0 0));--wi5-band:var(--band,oklch(0.27 0.067 256));--wi5-sh:var(--shadow,oklch(0.22 0.03 256));--wi5-soft:color-mix(in oklch,var(--wi5-ink) 80%,var(--wi5-band));--wi5-hair:oklch(from var(--wi5-ink) l c h / 0.16);--wi5-cols:minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr);--wi5-cg:clamp(24px,3vw,48px);position:relative;overflow:clip;box-sizing:border-box;background:var(--wi5-band);color:var(--wi5-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-whats-inside-5 *,.cf-whats-inside-5 *::before,.cf-whats-inside-5 *::after{box-sizing:border-box}
.cf-whats-inside-5 .wi5-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-whats-inside-5 .wi5-head{max-width:46rem;margin:0 auto clamp(32px,4vw,48px);text-align:center}
.cf-whats-inside-5 .wi5-h{margin:0;font-family:var(--font-display);font-size:clamp(2rem,3.6vw,3.25rem);font-weight:var(--display-weight,800);line-height:1.1;letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--wi5-ink);text-wrap:balance}
.cf-whats-inside-5 .wi5-mark{--wi5-m:oklch(from var(--marker,#fae37c) max(l,0.86) min(c,0.17) h);color:oklch(from var(--wi5-m) 0.22 0.04 h);background:linear-gradient(transparent 8%,var(--wi5-m) 8%,var(--wi5-m) 97%,transparent 97%);padding:0 .14em;border-radius:.12em .3em .16em .34em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-whats-inside-5 .wi5-lead{max-width:40rem;margin:16px auto 0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--wi5-soft);text-wrap:pretty}
.cf-whats-inside-5 .wi5-show{display:flex;flex-direction:column;gap:24px}
.cf-whats-inside-5 .wi5-stage{order:-1;align-self:center;width:min(100%,24rem);margin:0;animation:wi5-rise .45s cubic-bezier(.2,.7,.2,1) both}
.cf-whats-inside-5 .wi5-pad{position:relative;width:100%;aspect-ratio:1 / .92}
.cf-whats-inside-5 .wi5-plat{position:absolute;left:8%;right:8%;bottom:2%;height:24%;z-index:1}
.cf-whats-inside-5 .wi5-plat::before{content:'';position:absolute;left:0;right:0;top:28%;bottom:0;border-radius:0 0 50% 50% / 0 0 46% 46%;background:linear-gradient(oklch(from var(--wi5-band) calc(l + .06) c h),oklch(from var(--wi5-band) calc(l - .03) c h));box-shadow:0 2px 3px oklch(from var(--wi5-sh) calc(l - .1) c h / .5),0 14px 20px -8px oklch(from var(--wi5-sh) calc(l - .1) c h / .6)}
.cf-whats-inside-5 .wi5-plat-top{position:absolute;left:0;right:0;top:0;height:56%;border-radius:50%;background:radial-gradient(ellipse 62% 72% at 50% 44%,oklch(from var(--wi5-band) calc(l + .2) c h),oklch(from var(--wi5-band) calc(l + .1) c h) 64%,oklch(from var(--wi5-band) calc(l + .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--wi5-ink) l c h / .22),inset 0 -1px 0 oklch(from var(--wi5-band) calc(l - .04) c h)}
.cf-whats-inside-5 .wi5-img{position:absolute;left:6%;bottom:15%;z-index:2;width:88%;height:84%;object-fit:contain;object-position:50% 100%;filter:drop-shadow(0 2px 3px oklch(from var(--wi5-sh) calc(l - .08) c h / .55)) drop-shadow(0 16px 18px oklch(from var(--wi5-sh) calc(l - .08) c h / .45))}
.cf-whats-inside-5 .wi5-cap{margin-top:16px;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--wi5-soft);text-wrap:balance}
.cf-whats-inside-5 .wi5-cap strong{display:block;font-weight:800;color:var(--wi5-ink)}
.cf-whats-inside-5 .wi5-tabs{position:relative;display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));width:100%;padding:4px;border-radius:var(--radius,12px);background:oklch(from var(--wi5-ink) l c h / .1);box-shadow:inset 0 0 0 1px var(--wi5-hair)}
.cf-whats-inside-5 .wi5-thumb{position:absolute;top:4px;bottom:4px;left:4px;width:calc((100% - 8px) / var(--n));transform:translateX(calc(100% * var(--i)));border-radius:max(0px,calc(var(--radius,12px) - 4px));background:var(--wi5-ink);box-shadow:0 1px 2px oklch(from var(--wi5-sh) calc(l - .1) c h / .45),0 4px 10px -2px oklch(from var(--wi5-sh) calc(l - .1) c h / .4);transition:transform .28s cubic-bezier(.2,.7,.2,1)}
.cf-whats-inside-5 .wi5-tab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:52px;padding:0 16px;border:0;border-radius:max(0px,calc(var(--radius,12px) - 4px));background:transparent;color:var(--wi5-ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.15;white-space:nowrap;cursor:pointer;transition:color .16s ease,background-color .16s ease}
.cf-whats-inside-5 .wi5-tab:hover:not([aria-selected=true]){background:oklch(from var(--wi5-ink) l c h / .08)}
.cf-whats-inside-5 .wi5-tab svg{flex:none}
.cf-whats-inside-5 .wi5-tab[aria-selected=true]{color:var(--wi5-band);cursor:default}
.cf-whats-inside-5 .wi5-tab:focus-visible{outline:3px solid var(--wi5-ink);outline-offset:2px}
.cf-whats-inside-5 .wi5-tabn{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:28px;padding:0 8px;border-radius:999px;background:oklch(from var(--wi5-ink) l c h / .14);font-size:.875rem;font-weight:800;font-variant-numeric:tabular-nums;transition:background-color .16s ease}
.cf-whats-inside-5 .wi5-tab[aria-selected=true] .wi5-tabn{background:oklch(from var(--wi5-band) l c h / .12);color:var(--wi5-band)}
.cf-whats-inside-5 .wi5-panel{display:grid;border-radius:var(--radius,12px)}
.cf-whats-inside-5 .wi5-panel:focus-visible{outline:3px solid var(--wi5-ink);outline-offset:8px}
.cf-whats-inside-5 .wi5-list{display:grid;grid-template-columns:minmax(0,1fr);gap:24px 32px;margin:0;padding:0;list-style:none}
.cf-whats-inside-5 .wi5-note{min-width:0;animation:wi5-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:var(--d,0s)}
.cf-whats-inside-5 .wi5-nl{margin:0;font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;color:var(--wi5-soft)}
.cf-whats-inside-5 .wi5-nt{margin:0;font-family:var(--font-display);font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:var(--display-weight,800);line-height:1.2;letter-spacing:-.01em;color:var(--wi5-ink);font-variant-numeric:tabular-nums;text-wrap:balance}
.cf-whats-inside-5 .wi5-nd{margin:8px 0 0;font-size:1rem;line-height:1.45;color:var(--wi5-soft);text-wrap:pretty}
.cf-whats-inside-5 .wi5-chips{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 0}
.cf-whats-inside-5 .wi5-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:oklch(from var(--wi5-ink) l c h / .12);color:var(--wi5-ink);font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums}
.cf-whats-inside-5 .wi5-note--spec{display:grid;grid-template-columns:minmax(0,7.5rem) minmax(0,1fr);column-gap:16px;align-items:baseline}
.cf-whats-inside-5 .wi5-note--spec .wi5-nl{grid-row:1 / span 2}
.cf-whats-inside-5 .wi5-note--spec .wi5-nt,.cf-whats-inside-5 .wi5-note--spec .wi5-nd{grid-column:2}
.cf-whats-inside-5 .wi5-close{display:flex;flex-direction:column;align-items:center;margin-top:clamp(40px,5vw,64px);text-align:center}
.cf-whats-inside-5 .wi5-price{display:flex;flex-direction:column;align-items:center;gap:8px}
.cf-whats-inside-5 .wi5-pv,.cf-whats-inside-5 .wi5-pt{display:flex;flex-direction:column;align-items:center;gap:12px;margin:0}
.cf-whats-inside-5 .wi5-micro{font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;color:var(--wi5-soft)}
.cf-whats-inside-5 .wi5-vnum,.cf-whats-inside-5 .wi5-pnum{font-family:var(--font-display);font-weight:var(--display-weight,800);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.cf-whats-inside-5 .wi5-vnum{font-size:clamp(2.5rem,4.2vw,3.75rem);color:var(--wi5-soft);text-decoration:line-through;text-decoration-thickness:.06em;text-decoration-color:oklch(from var(--wi5-ink) l c h / .7)}
.cf-whats-inside-5 .wi5-pnum{font-size:clamp(3rem,5.6vw,4.75rem);color:var(--wi5-ink)}
.cf-whats-inside-5 .wi5-but{margin:4px 0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--wi5-ink);text-wrap:balance}
.cf-whats-inside-5 .wi5-pnote{margin:16px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--wi5-soft);text-wrap:pretty}
.cf-whats-inside-5 .wi5-act{width:100%;max-width:30rem;margin-top:24px}
.cf-whats-inside-5 .wi5-btn{--wi5-bg:var(--button-bg,var(--cta));--wi5-bg2:var(--button-bg-2,var(--cta-2));display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:72px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--wi5-bg) calc(l + .04) c h),oklch(from var(--wi5-bg2) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;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(--wi5-bg) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--wi5-bg) calc(l - .16) c h),0 1px 2px oklch(from var(--wi5-sh) l c h / .4),0 8px 16px -6px oklch(from var(--wi5-sh) l c h / .5));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-whats-inside-5 .wi5-btn span{text-wrap:balance}
.cf-whats-inside-5 .wi5-btn:hover:not(:disabled):not([aria-busy=true]),.cf-whats-inside-5 .wi5-btn.is-hover{background:linear-gradient(oklch(from var(--wi5-bg) calc(l - .01) c h),oklch(from var(--wi5-bg2) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--wi5-bg) calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from var(--wi5-bg) calc(l - .2) c h),0 1px 2px oklch(from var(--wi5-sh) l c h / .45),0 12px 20px -6px oklch(from var(--wi5-sh) l c h / .55);transform:translateY(-1px)}
.cf-whats-inside-5 .wi5-btn:active:not(:disabled):not([aria-busy=true]),.cf-whats-inside-5 .wi5-btn.is-press{background:linear-gradient(oklch(from var(--wi5-bg) calc(l - .06) c h),oklch(from var(--wi5-bg2) calc(l - .1) c h));box-shadow:inset 0 2px 3px oklch(from var(--wi5-bg) calc(l - .22) c h / .7),inset 0 -2px 0 oklch(from var(--wi5-bg) calc(l - .16) c h),0 1px 1px oklch(from var(--wi5-sh) l c h / .4);transform:translateY(1px)}
.cf-whats-inside-5 .wi5-btn:focus-visible{outline:3px solid var(--wi5-ink);outline-offset:3px}
.cf-whats-inside-5 .wi5-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed;transform:none}
.cf-whats-inside-5 .wi5-btn[aria-busy=true]{cursor:progress}
.cf-whats-inside-5 .wi5-spin{flex:none;animation:wi5-spin .8s linear infinite}
.cf-whats-inside-5 .wi5-sec{margin-top:16px;padding:4px 2px;border:0;border-radius:4px;background:none;color:var(--wi5-ink);font-family:var(--font-body);font-size:.9375rem;font-weight:500;line-height:1.4;text-decoration:underline;text-decoration-color:oklch(from var(--wi5-ink) l c h / .45);text-underline-offset:.18em;text-wrap:pretty;cursor:pointer}
.cf-whats-inside-5 .wi5-sec:hover{text-decoration-color:currentColor}
.cf-whats-inside-5 .wi5-sec:focus-visible{outline:3px solid var(--wi5-ink);outline-offset:3px}
.cf-whats-inside-5 .wi5-g{margin:12px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--wi5-soft);text-wrap:pretty}
.cf-whats-inside-5 .wi5-err{margin:12px 0 0;padding:8px 14px;border-radius:10px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-whats-inside-5 .wi5-g svg,.cf-whats-inside-5 .wi5-err svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
@media (max-width:479px){
.cf-whats-inside-5 .wi5-tab{padding:0 12px;gap:8px}
.cf-whats-inside-5 .wi5-tab svg{display:none}
}
@media (min-width:640px){
.cf-whats-inside-5 .wi5-list{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:900px){
.cf-whats-inside-5 .wi5-show{display:grid;grid-template-columns:var(--wi5-cols);column-gap:var(--wi5-cg);row-gap:clamp(28px,3vw,40px)}
.cf-whats-inside-5 .wi5-show.is-bare{--wi5-cols:repeat(2,minmax(0,1fr))}
.cf-whats-inside-5 .wi5-tabs{grid-column:1 / -1;grid-row:1;justify-self:center;width:min(100%,26rem)}
.cf-whats-inside-5 .wi5-stage{grid-column:2;grid-row:2;align-self:start;width:100%}
.cf-whats-inside-5 .wi5-panel{grid-column:1 / -1;grid-row:2;pointer-events:none}
.cf-whats-inside-5 .wi5-list{grid-template-columns:var(--wi5-cols);column-gap:var(--wi5-cg);row-gap:32px;align-content:center}
.cf-whats-inside-5 .is-bare .wi5-list{align-content:start}
.cf-whats-inside-5 .wi5-note{grid-row:var(--r);pointer-events:auto}
.cf-whats-inside-5 .wi5-note[data-side=l]{grid-column:1;text-align:end}
.cf-whats-inside-5 .wi5-note[data-side=l] .wi5-chips{justify-content:flex-end}
.cf-whats-inside-5 .wi5-note[data-side=r]{grid-column:3}
.cf-whats-inside-5 .is-bare .wi5-note[data-side=l]{text-align:start}
.cf-whats-inside-5 .is-bare .wi5-note[data-side=l] .wi5-chips{justify-content:flex-start}
.cf-whats-inside-5 .is-bare .wi5-note[data-side=r]{grid-column:2}
.cf-whats-inside-5 .wi5-note--spec{display:block}
.cf-whats-inside-5 .wi5-note--spec .wi5-nl{margin-bottom:12px}
.cf-whats-inside-5 .wi5-price{display:grid;grid-auto-flow:column;grid-template-rows:auto auto;justify-content:center;align-items:end;column-gap:40px;row-gap:12px}
.cf-whats-inside-5 .wi5-pv,.cf-whats-inside-5 .wi5-pt{grid-row:1 / span 2;display:grid;grid-template-rows:subgrid;justify-items:center;align-items:end;row-gap:12px}
.cf-whats-inside-5 .wi5-but{grid-row:2;margin:0 0 .4em}
}
@keyframes wi5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes wi5-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:no-preference){
@supports (animation-timeline:view()){
.cf-whats-inside-5 .wi5-price>*{animation:wi5-rise linear both;animation-timeline:view();animation-range:entry 10% entry 70%}
.cf-whats-inside-5 .wi5-price>.wi5-but{animation-range:entry 25% entry 85%}
.cf-whats-inside-5 .wi5-price>.wi5-pt{animation-range:entry 40% entry 100%}
}
}
@media (prefers-reduced-motion:reduce){
.cf-whats-inside-5 *,.cf-whats-inside-5 *::before,.cf-whats-inside-5 *::after{animation:none !important;transition:none !important}
}
`
pieces/offer/whats-inside-5/specimen.tsx 25 lines
import __studioImage87f3a310 from "../assets/a97cd9e5915da0a9.webp";
// Specimen: Trailhead Gear’s rechargeable Ridgeline lantern kit on the gear stage.
import * as React from 'react'
import { WhatsInside5, type WhatsInside5State } from '../whats-inside-5'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function WhatsInside5Specimen({ state = 'default' }: { state?: WhatsInside5State }) {
return (
<WhatsInside5
state={state}
lead='Every piece Trailhead Gear packs and every number that matters, on one stage. Look it over like you would in the store.'
productName='Trailhead Gear Ridgeline Lantern Kit'
productImage={slot(
'product',
__studioImage87f3a310,
)}
imageAlt='The Ridgeline Lantern Kit: lantern, diffuser shade, tripod mount, USB-C cable, carabiner hook and carry pouch'
guarantee={defaults.sample.guarantee}
onAction={() => undefined}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalWhatsInside5 |
Partial<WhatsInside5Copy> |
|
headline OptionalWhatsInside5 |
string |
|
emphasis OptionalWhatsInside5 |
string | false |
|
lead OptionalWhatsInside5 |
string | false |
|
productName OptionalWhatsInside5 |
string | false |
|
productImage OptionalWhatsInside5 |
string |
|
imageAlt OptionalWhatsInside5 |
string |
|
items OptionalWhatsInside5 |
WhatsInside5Item[] |
|
specs OptionalWhatsInside5 |
WhatsInside5Spec[] |
|
defaultTab OptionalWhatsInside5 |
WhatsInside5Tab |
|
totalValue OptionalWhatsInside5 |
string | false |
|
price OptionalWhatsInside5 |
string |
|
priceNote OptionalWhatsInside5 |
string | false |
|
label OptionalWhatsInside5 |
string |
|
loadingLabel OptionalWhatsInside5 |
string |
|
secondaryLine OptionalWhatsInside5 |
string | false |
|
secondaryHref OptionalWhatsInside5 |
string |
|
guarantee OptionalWhatsInside5 |
string | false |
|
errorMessage OptionalWhatsInside5 |
string |
|
href OptionalWhatsInside5 |
string |
|
onAction OptionalWhatsInside5 |
() => void | Promise<unknown> |
|
disabled OptionalWhatsInside5 |
boolean |
|
state OptionalWhatsInside5 |
WhatsInside5State |
|
id OptionalWhatsInside5 |
string |
|
className OptionalWhatsInside5 |
string |
|
style OptionalWhatsInside5 |
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.
--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.
product- The main product shot or cover (ebook, kit, bottle).
-
a97cd9e5915da0a9.webp
image/webp · 63.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB