Whats Inside 2
Gives each book in the bundle its own moment in a large spotlight and keeps the rest on a shelf beneath.
Use it in a prompt
Use offer/whats-inside-2 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-2.tsx. - Import it and pass your copy and images (Props tab):
import { WhatsInside2 } from "@/components/funneldna/offer/whats-inside-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/whats-inside-2/component.tsx 578 lines
// layout: spotlight-row
// Gives each book in the bundle its own moment in a large spotlight and keeps the rest on a shelf beneath.
// Then it counts the whole box and asks with the risk reversal first and the price on the button.
'use client'
import * as React from 'react'
import { AlertCircle, Loader2, ShieldCheck } from 'lucide-react'
import { FX_HOST, Texture } from '../fx/fx'
import linen from '../fx/textures/linen'
/** States this piece implements: hover and active force the button look, disabled locks it, error shows the checkout message. */
export type WhatsInside2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type WhatsInside2Item = {
name: string
/** What the book teaches, in about two lines. */
detail?: string
/** Supplied value only, e.g. $34. Shown as a chip when present. */
value?: string
/** Supplied page count only. */
pages?: string | number
/** Supplied format only, e.g. Hardcover. */
format?: string
/** item-N slot: the cover, best as a transparent cut-out. */
image?: string
/** Alt text for the spotlight cover; defaults to the item name. */
imageAlt?: string
}
export type WhatsInside2Copy = {
/** Running count for one item; {count} is replaced with the number. */
countOne: string
/** Running count for several items; {count} is replaced with the number. */
countMany: string
/** Accessible name of the cover shelf. */
tabsLabel: string
/** {value} is replaced with the item value. */
itemValue: string
/** {pages} is replaced with the page count. */
pages: string
/** Word between today’s price and the alternative. */
vs: string
/** Line under today’s price. */
priceLabel: string
/** Line under the alternative price. */
alternativeLabel: string
}
export type WhatsInside2Props = {
/** Generated labels and accessible names; any key left out keeps its default. */
copy?: Partial<WhatsInside2Copy>
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
emphasis?: string | false
lead?: string | false
/** The bundle, in order. Every item gets a cover on the shelf and a turn in the spotlight. */
items?: WhatsInside2Item[]
/** Index of the item that starts in the spotlight. */
defaultActive?: number
/** One-sentence lines under the running count; the last line is set as the punch word. */
punch?: string[] | false
/** Risk reversal that leads the action. Supplied guarantee only. */
riskHeadline?: string | false
riskText?: string | false
/** Supplied price for the whole set. */
price?: string
/** What the supplied alternative costs. Left undefined, it is the sum of the item values when every item has one; false hides it. */
alternativePrice?: string | false
/** Button text; {price} is replaced with the price. */
label?: string
/** Button text while onAction is pending. */
loadingLabel?: string
/** Line under the button. Supplied facts only. */
reassurance?: 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?: WhatsInside2State
id?: string
className?: string
style?: React.CSSProperties
}
type Status = 'idle' | 'loading' | 'error'
const DEFAULT_COPY: WhatsInside2Copy = {
countOne: '{count} book, 1 box',
countMany: '{count} books, 1 box',
tabsLabel: 'Books in the bundle',
itemValue: '{value} value',
pages: '{pages} pages',
vs: 'vs.',
priceLabel: 'for the whole set',
alternativeLabel: 'bought one at a time',
}
const DEFAULT_ITEMS: WhatsInside2Item[] = [
{ name: 'The Backyard Harvest', detail: 'Plan beds that crop from spring to first frost. Sow, water and pick on a simple weekly rhythm.', value: '$34', pages: 288, format: 'Hardcover' },
{ name: 'Put Up the Harvest', detail: 'Can, ferment and dry what you grow. Fill a pantry that lasts the whole winter.', value: '$29', pages: 240, format: 'Hardcover' },
{ name: 'Bread from Scratch', detail: 'Raise a sourdough starter in a week. Bake a crackling loaf from your own kitchen.', value: '$32', pages: 256, format: 'Hardcover' },
]
const DEFAULT_PUNCH = ['From the first seed to the last slice.', 'Covered.']
export function WhatsInside2(props: WhatsInside2Props) {
const {
copy,
headline = 'Grow it, put it up, bake it. All from one shelf.',
emphasis = 'All from one shelf.',
lead = 'The Homestead Library is three hardcover books for the whole year. Tap any cover to look inside.',
items = DEFAULT_ITEMS,
defaultActive = 0,
punch = DEFAULT_PUNCH,
riskHeadline = 'Try all three for 30 days.',
riskText = 'Plant from them. Cook from them. If they don’t earn their spot on your shelf, send them back for a full refund.',
price = '$69',
alternativePrice,
label = 'Ship My Library for {price}',
loadingLabel = 'Opening secure checkout…',
reassurance = '30-day money-back guarantee',
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 count = items.length
const [active, setActive] = React.useState(() => clampIndex(defaultActive, count))
const [prev, setPrev] = React.useState<number | null>(null)
const [swaps, setSwaps] = React.useState(0)
const [status, setStatus] = React.useState<Status>(state === 'error' ? 'error' : 'idle')
const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([])
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setStatus(state === 'error' ? 'error' : 'idle')
}, [state])
React.useEffect(() => {
setActive((a) => clampIndex(a, count))
setPrev(null)
}, [count])
const isDisabled = disabled || state === 'disabled'
const loading = status === 'loading'
const current = count ? items[active] : undefined
const previous = prev !== null && prev !== active ? items[prev] : undefined
const hasCovers = items.some((item) => Boolean(item.image))
const pile = items.filter((item) => item.image).slice(0, 6)
const alt = alternativePrice === false ? null : alternativePrice ?? sumValues(items)
const showAlt = Boolean(alt) && (alternativePrice !== undefined || greater(alt as string, price))
const headId = `${uid}-h`
const panelId = `${uid}-panel`
const errId = `${uid}-err`
const tabId = (i: number) => `${uid}-tab-${i}`
const countText = fill(count === 1 ? text.countOne : text.countMany, { count: String(count) })
const lines = punch ? punch.filter(Boolean) : []
function select(i: number) {
if (i === active || i < 0 || i >= count) return
setPrev(active)
setActive(i)
setSwaps((s) => s + 1)
}
function onKey(e: React.KeyboardEvent<HTMLButtonElement>, i: number) {
let next: number | null = null
if (e.key === 'ArrowRight' || e.key === 'ArrowDown') next = (i + 1) % count
else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') next = (i - 1 + count) % count
else if (e.key === 'Home') next = 0
else if (e.key === 'End') next = count - 1
if (next === null) return
e.preventDefault()
select(next)
tabRefs.current[next]?.focus()
}
async function handleClick(e: React.MouseEvent<HTMLElement>) {
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 btnInner = (
<>
{loading ? <Loader2 className='wi2-spin' aria-hidden='true' strokeWidth={2.5} /> : null}
<span className='wi2-btn-label'>{loading ? loadingLabel : fill(label, { price })}</span>
</>
)
const described = status === 'error' ? errId : undefined
const button =
href && !onAction ? (
<a
className='wi2-btn'
href={isDisabled ? undefined : href}
aria-disabled={isDisabled || undefined}
aria-describedby={described}
onClick={handleClick}
>
{btnInner}
</a>
) : (
<button
type='button'
className='wi2-btn'
disabled={isDisabled}
aria-busy={loading || undefined}
aria-describedby={described}
onClick={handleClick}
>
{btnInner}
</button>
)
const rootClass = [
'cf-whats-inside-2',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-press' : '',
className || '',
]
.filter(Boolean)
.join(' ')
return (
<section id={id} className={rootClass} style={{ ...FX_HOST, ...style }} aria-labelledby={headId}>
<Texture src={linen} tone='ink' />
<style>{CSS}</style>
<div className='wi2-wrap'>
<header className='wi2-head'>
<h2 id={headId} className='wi2-h'>
<Headline text={headline} mark={emphasis} />
</h2>
{lead ? <p className='wi2-lead'>{lead}</p> : null}
</header>
{current ? (
<>
<div
id={panelId}
role='tabpanel'
aria-labelledby={tabId(active)}
tabIndex={0}
className={hasCovers ? 'wi2-spot' : 'wi2-spot is-solo'}
>
{hasCovers ? (
<div className='wi2-stage'>
{previous && previous.image ? (
<img
key={`out-${swaps}`}
className='wi2-out'
src={previous.image}
alt=''
aria-hidden='true'
width={1024}
height={1024}
decoding='async'
onAnimationEnd={() => setPrev(null)}
/>
) : null}
{current.image ? (
<img
key={`in-${swaps}`}
className={swaps > 0 ? 'wi2-in' : undefined}
src={current.image}
alt={current.imageAlt || current.name}
width={1024}
height={1024}
decoding='async'
/>
) : null}
</div>
) : null}
<div className='wi2-copy'>
<div key={`copy-${active}-${swaps}`} className={swaps > 0 ? 'wi2-swap' : undefined}>
<h3 className='wi2-title'>{current.name}</h3>
{current.detail ? <p className='wi2-teach'>{current.detail}</p> : null}
{current.value || current.pages || current.format ? (
<ul className='wi2-meta'>
{current.value ? (
<li className='wi2-chip is-value'>{fill(text.itemValue, { value: current.value })}</li>
) : null}
{current.format ? <li className='wi2-chip'>{current.format}</li> : null}
{current.pages ? (
<li className='wi2-chip'>{fill(text.pages, { pages: String(current.pages) })}</li>
) : null}
</ul>
) : null}
</div>
</div>
</div>
<div className='wi2-shelf'>
<div className='wi2-tabs' role='tablist' aria-label={text.tabsLabel} aria-orientation='horizontal'>
{items.map((item, i) => {
const on = i === active
return (
<button
key={`${item.name}-${i}`}
ref={(el) => {
tabRefs.current[i] = el
}}
id={tabId(i)}
type='button'
role='tab'
aria-selected={on}
aria-controls={panelId}
tabIndex={on ? 0 : -1}
className={on ? 'wi2-tab is-on' : 'wi2-tab'}
onClick={() => select(i)}
onKeyDown={(e) => onKey(e, i)}
>
{item.image ? (
<span className='wi2-tab-cover'>
<img src={item.image} alt='' width={256} height={256} decoding='async' />
</span>
) : null}
<span className='wi2-tab-name'>{item.name}</span>
{item.value ? <span className='wi2-tab-value'>{fill(text.itemValue, { value: item.value })}</span> : null}
</button>
)
})}
</div>
</div>
</>
) : null}
<div className='wi2-close'>
<div className='wi2-whole'>
{pile.length > 1 ? (
<div className='wi2-pile' aria-hidden='true'>
{pile.map((item, i) => (
<img key={`${item.name}-${i}`} src={item.image} alt='' width={144} height={144} decoding='async' />
))}
</div>
) : null}
{count ? <p className='wi2-count'>{countText}</p> : null}
{lines.length ? (
<div className='wi2-punch'>
{lines.map((line, i) => (
<p key={`${line}-${i}`} className={lines.length > 1 && i === lines.length - 1 ? 'wi2-punch-last' : undefined}>
{line}
</p>
))}
</div>
) : null}
</div>
<div className='wi2-act'>
{riskHeadline ? <h3 className='wi2-risk'>{riskHeadline}</h3> : null}
{riskText ? <p className='wi2-risk-text'>{riskText}</p> : null}
{price ? (
<div className='wi2-compare'>
<p className='wi2-today'>
<span className='wi2-price'>{price}</span>
<span className='wi2-plabel'>{text.priceLabel}</span>
</p>
{showAlt ? (
<>
<span className='wi2-vs'>{text.vs}</span>
<p className='wi2-alt'>
<span className='wi2-alt-price'>{alt}</span>
<span className='wi2-plabel'>{text.alternativeLabel}</span>
</p>
</>
) : null}
</div>
) : null}
{button}
{status === 'error' ? (
<p id={errId} className='wi2-error' role='alert'>
<AlertCircle className='wi2-ico' aria-hidden='true' strokeWidth={2.5} />
{errorMessage}
</p>
) : null}
{reassurance ? (
<p className='wi2-reassure'>
<ShieldCheck className='wi2-ico wi2-ico--accent' aria-hidden='true' strokeWidth={2.5} />
{reassurance}
</p>
) : null}
</div>
</div>
</div>
</section>
)
}
export default WhatsInside2
function Headline({ text, mark }: { text: string; mark?: string | false }) {
if (!mark) return <>{text}</>
const at = text.indexOf(mark)
if (at < 0) return <>{text}</>
return (
<>
{text.slice(0, at)}
<span className='wi2-mark'>{mark}</span>
{text.slice(at + mark.length)}
</>
)
}
function clampIndex(i: number, n: number) {
if (n <= 0) return 0
return Math.min(Math.max(0, Math.floor(i) || 0), n - 1)
}
function fill(template: string, vars: Record<string, string>) {
let out = template
for (const key of Object.keys(vars)) out = out.split(`{${key}}`).join(vars[key])
return out
}
function isDigit(c: string) {
return c >= '0' && c <= '9'
}
function parseMoney(value: string | undefined) {
if (!value) return null
const s = String(value).trim()
let i = 0
while (i < s.length && !isDigit(s[i])) i++
let j = i
while (j < s.length && (isDigit(s[j]) || s[j] === ',' || s[j] === '.')) j++
if (j === i || s.slice(j).trim()) return null
const raw = s.slice(i, j).split(',').join('')
const n = Number(raw)
if (!Number.isFinite(n)) return null
const dot = raw.indexOf('.')
return { prefix: s.slice(0, i).trim(), n, decimals: dot < 0 ? 0 : raw.length - dot - 1 }
}
/** The alternative price derived from supplied item values: only when every item carries one in the same currency. */
function sumValues(items: WhatsInside2Item[]) {
if (items.length < 2) return null
let total = 0
let decimals = 0
let prefix: string | null = null
for (const item of items) {
const m = parseMoney(item.value)
if (!m) return null
if (prefix !== null && m.prefix !== prefix) return null
prefix = m.prefix
total += m.n
decimals = Math.max(decimals, m.decimals)
}
return `${prefix ?? ''}${total.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals })}`
}
function greater(alt: string, price: string) {
const a = parseMoney(alt)
const p = parseMoney(price)
return Boolean(a && p && a.prefix === p.prefix && a.n > p.n)
}
const CSS = `
.cf-whats-inside-2{--wi2-sh:var(--shadow,oklch(0.22 0.03 256));position:relative;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-whats-inside-2 *,.cf-whats-inside-2 *::before,.cf-whats-inside-2 *::after{box-sizing:border-box}
.cf-whats-inside-2 .wi2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-whats-inside-2 .wi2-head{max-width:46rem;margin:0 0 clamp(32px,4.5vw,48px)}
.cf-whats-inside-2 .wi2-h{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance}
.cf-whats-inside-2 .wi2-mark{background-image:linear-gradient(transparent 56%,var(--marker,#fae37c) 56%,var(--marker,#fae37c) 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .08em;margin:0 -.04em;border-radius:.14em .22em .16em .26em}
.cf-whats-inside-2 .wi2-lead{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-whats-inside-2 .wi2-spot{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,6fr);gap:clamp(32px,5vw,72px);align-items:start;border-radius:var(--radius,12px)}
.cf-whats-inside-2 .wi2-spot.is-solo{grid-template-columns:minmax(0,1fr)}
.cf-whats-inside-2 .wi2-spot:focus{outline:none}
.cf-whats-inside-2 .wi2-spot:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .55);outline-offset:8px}
.cf-whats-inside-2 .wi2-stage{position:relative;width:100%;max-width:440px;aspect-ratio:1/1;justify-self:center}
.cf-whats-inside-2 .wi2-stage img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px oklch(from var(--wi2-sh) l c h / .32)) drop-shadow(0 16px 20px oklch(from var(--wi2-sh) l c h / .26))}
.cf-whats-inside-2 .wi2-copy{min-width:0;padding-top:clamp(0px,4.5vw,64px)}
.cf-whats-inside-2 .wi2-title{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.02em);text-transform:var(--display-case,none);font-size:clamp(1.625rem,2.6vw,2.25rem);line-height:1.1;text-wrap:balance}
.cf-whats-inside-2 .wi2-teach{margin:14px 0 0;max-width:34em;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-whats-inside-2 .wi2-meta{display:flex;flex-wrap:wrap;gap:8px;margin:24px 0 0;padding:0;list-style:none}
.cf-whats-inside-2 .wi2-chip{display:inline-flex;align-items:center;min-height:30px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--surface));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums}
.cf-whats-inside-2 .wi2-chip.is-value{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-whats-inside-2 .wi2-shelf{margin-top:clamp(32px,4.5vw,48px);padding:12px;border-radius:var(--card-radius,var(--radius,14px));background:color-mix(in oklch,var(--ink) 4%,var(--surface));box-shadow:inset 0 1px 3px oklch(from var(--wi2-sh) l c h / .12);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-padding-inline:12px;scrollbar-width:thin}
.cf-whats-inside-2 .wi2-tabs{display:flex;gap:12px;width:max-content;min-width:100%;justify-content:center}
.cf-whats-inside-2 .wi2-tab{appearance:none;flex:0 0 auto;width:176px;margin:0;display:flex;flex-direction:column;align-items:center;gap:8px;padding:18px 14px 16px;border:1px solid transparent;border-radius:var(--radius,12px);background:transparent;color:var(--ink);font:inherit;text-align:center;cursor:pointer;scroll-snap-align:center;transition:background .16s ease,box-shadow .16s ease,border-color .16s ease}
.cf-whats-inside-2 .wi2-tab:hover{background:color-mix(in oklch,var(--ink) 7%,var(--surface))}
.cf-whats-inside-2 .wi2-tab.is-on{background:var(--card);border-color:oklch(from var(--accent) l c h / .45);box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 256 / .22),0 4px 10px -2px oklch(0.22 0.03 256 / .2))}
.cf-whats-inside-2 .wi2-tab:focus{outline:none}
.cf-whats-inside-2 .wi2-tab:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-whats-inside-2 .wi2-tab-cover{display:block;width:112px;height:112px;filter:drop-shadow(0 1px 2px oklch(from var(--wi2-sh) l c h / .3)) drop-shadow(0 6px 8px oklch(from var(--wi2-sh) l c h / .18));transition:transform .22s cubic-bezier(.2,.7,.2,1),filter .22s ease}
.cf-whats-inside-2 .wi2-tab-cover img{display:block;width:100%;height:100%;object-fit:contain}
.cf-whats-inside-2 .wi2-tab:hover .wi2-tab-cover{transform:translateY(-4px)}
.cf-whats-inside-2 .wi2-tab.is-on .wi2-tab-cover{transform:translateY(-8px) scale(1.04);filter:drop-shadow(0 2px 3px oklch(from var(--wi2-sh) l c h / .32)) drop-shadow(0 12px 14px oklch(from var(--wi2-sh) l c h / .26))}
.cf-whats-inside-2 .wi2-tab-name{font-size:.9375rem;font-weight:700;line-height:1.25;text-wrap:balance}
.cf-whats-inside-2 .wi2-tab-value{font-size:.875rem;font-weight:600;line-height:1.2;color:var(--muted);font-variant-numeric:tabular-nums}
.cf-whats-inside-2 .wi2-close{margin-top:clamp(24px,3.5vw,40px);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:clamp(24px,4vw,56px);align-items:start;padding:clamp(24px,3.5vw,40px);background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 256 / .22),0 12px 24px -8px oklch(0.22 0.03 256 / .32)))}
.cf-whats-inside-2 .wi2-whole,.cf-whats-inside-2 .wi2-act{min-width:0}
.cf-whats-inside-2 .wi2-pile{display:flex;margin:0 0 16px;padding-left:12px}
.cf-whats-inside-2 .wi2-pile img{display:block;width:72px;height:72px;margin-left:-12px;object-fit:contain;filter:drop-shadow(0 1px 2px oklch(from var(--wi2-sh) l c h / .3)) drop-shadow(0 6px 8px oklch(from var(--wi2-sh) l c h / .18))}
.cf-whats-inside-2 .wi2-count{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:-0.03em;font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-variant-numeric:tabular-nums;text-wrap:balance}
.cf-whats-inside-2 .wi2-punch{margin-top:16px}
.cf-whats-inside-2 .wi2-punch p{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-whats-inside-2 .wi2-punch p + p{margin-top:4px}
.cf-whats-inside-2 .wi2-punch .wi2-punch-last{margin-top:8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--accent)}
.cf-whats-inside-2 .wi2-risk{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance}
.cf-whats-inside-2 .wi2-risk-text{margin:8px 0 0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-whats-inside-2 .wi2-compare{margin:24px 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;padding:16px 20px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-whats-inside-2 .wi2-today,.cf-whats-inside-2 .wi2-alt{margin:0;display:flex;flex-direction:column;gap:12px}
.cf-whats-inside-2 .wi2-alt{gap:8px}
.cf-whats-inside-2 .wi2-price{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-whats-inside-2 .wi2-alt-price{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;letter-spacing:-0.01em;font-variant-numeric:tabular-nums;color:var(--muted)}
.cf-whats-inside-2 .wi2-plabel{font-size:.9375rem;font-weight:600;line-height:1.3;color:var(--muted)}
.cf-whats-inside-2 .wi2-vs{font-size:.9375rem;font-weight:800;color:var(--muted)}
.cf-whats-inside-2 .wi2-btn{margin-top:24px;display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .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);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--wi2-sh) l c h / .3),0 8px 16px -6px oklch(from var(--wi2-sh) l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-whats-inside-2 .wi2-btn-label{text-wrap:balance}
.cf-whats-inside-2 .wi2-btn:hover,.cf-whats-inside-2.is-hover .wi2-btn{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--wi2-sh) l c h / .32),0 10px 20px -6px oklch(from var(--wi2-sh) l c h / .52))}
.cf-whats-inside-2 .wi2-btn:active,.cf-whats-inside-2.is-press .wi2-btn{background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--wi2-sh) l c h / .3),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 1px oklch(from var(--wi2-sh) l c h / .25)}
.cf-whats-inside-2 .wi2-btn:focus{outline:none}
.cf-whats-inside-2 .wi2-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-whats-inside-2 .wi2-btn:disabled,.cf-whats-inside-2 .wi2-btn[aria-disabled=true]{background:var(--secondary);color:var(--secondary-ink);text-shadow:none;cursor:not-allowed;transform:none;box-shadow:var(--button-2-shadow,var(--shadow-sm))}
.cf-whats-inside-2 .wi2-btn[aria-busy=true]{cursor:progress}
.cf-whats-inside-2 .wi2-spin{width:20px;height:20px;flex:none;animation:wi2-spin .8s linear infinite}
.cf-whats-inside-2 .wi2-error{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-whats-inside-2 .wi2-reassure{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted);text-align:center;text-wrap:pretty}
.cf-whats-inside-2 .wi2-ico{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-whats-inside-2 .wi2-ico--accent{color:var(--accent)}
.cf-whats-inside-2 .wi2-in{animation:wi2-cover-in .38s cubic-bezier(.2,.7,.2,1) both}
.cf-whats-inside-2 .wi2-out{animation:wi2-cover-out .26s ease both}
.cf-whats-inside-2 .wi2-swap{animation:wi2-copy-in .32s cubic-bezier(.2,.7,.2,1) both}
@keyframes wi2-cover-in{from{opacity:0;transform:translateY(12px) scale(.97)}to{opacity:1;transform:none}}
@keyframes wi2-cover-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY(-6px) scale(.99)}}
@keyframes wi2-copy-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes wi2-spin{to{transform:rotate(360deg)}}
@media (max-width:760px){
.cf-whats-inside-2 .wi2-spot{grid-template-columns:minmax(0,1fr);gap:16px}
.cf-whats-inside-2 .wi2-stage{max-width:300px}
.cf-whats-inside-2 .wi2-copy{padding-top:0}
.cf-whats-inside-2 .wi2-shelf{margin-inline:calc(clamp(16px,5vw,48px) * -1);padding:12px clamp(16px,5vw,48px);border-radius:0;scroll-padding-inline:clamp(16px,5vw,48px)}
.cf-whats-inside-2 .wi2-tab{width:148px;padding:16px 10px 14px}
.cf-whats-inside-2 .wi2-tab-cover{width:96px;height:96px}
.cf-whats-inside-2 .wi2-close{grid-template-columns:minmax(0,1fr);gap:24px}
.cf-whats-inside-2 .wi2-compare{padding:16px}
.cf-whats-inside-2 .wi2-btn{padding:0 20px}
}
@media (prefers-reduced-motion:reduce){
.cf-whats-inside-2 *,.cf-whats-inside-2 *::before,.cf-whats-inside-2 *::after{animation:none !important;transition:none !important}
.cf-whats-inside-2 .wi2-out{display:none}
.cf-whats-inside-2 .wi2-tab:hover .wi2-tab-cover{transform:none}
.cf-whats-inside-2 .wi2-btn:hover,.cf-whats-inside-2.is-hover .wi2-btn{transform:none}
}
`
pieces/offer/whats-inside-2/specimen.tsx 58 lines
import __studioImageee658620 from "../assets/3d1592f0762b15c2.webp";
import __studioImage9e92d106 from "../assets/b553c41885a5f9a6.webp";
import __studioImage036ee744 from "../assets/c55af03926914860.webp";
import * as React from 'react'
import { WhatsInside2, type WhatsInside2State } from '../whats-inside-2'
import { slot } from '../../slots'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function WhatsInside2Specimen({ state = 'default' }: { state?: WhatsInside2State }) {
const items = [
{
name: 'The Backyard Harvest',
detail: 'Plan beds that crop from spring to first frost. Sow, water and pick on a simple weekly rhythm.',
value: '$34',
pages: 288,
format: 'Hardcover',
image: slot('item-1', __studioImageee658620),
imageAlt: 'The Backyard Harvest hardcover, with a raised vegetable bed on the cover',
},
{
name: 'Put Up the Harvest',
detail: 'Can, ferment and dry what you grow. Fill a pantry that lasts the whole winter.',
value: '$29',
pages: 240,
format: 'Hardcover',
image: slot('item-2', __studioImage9e92d106),
imageAlt: 'Put Up the Harvest hardcover, with preserving jars on the cover',
},
{
name: 'Bread from Scratch',
detail: 'Raise a sourdough starter in a week. Bake a crackling loaf from your own kitchen.',
value: '$32',
pages: 256,
format: 'Hardcover',
image: slot('item-3', __studioImage036ee744),
imageAlt: 'Bread from Scratch hardcover, with a sourdough loaf on the cover',
},
]
return (
<WhatsInside2
headline='Grow it, put it up, bake it. All from one shelf.'
emphasis='All from one shelf.'
lead='The Homestead Library is three hardcover books for the whole year. Tap any cover to look inside.'
items={items}
punch={['From the first seed to the last slice.', 'Covered.']}
riskHeadline='Try all three for 30 days.'
riskText='Plant from them. Cook from them. If they don’t earn their spot on your shelf, send them back for a full refund.'
price='$69'
label='Ship My Library for {price}'
reassurance={`${defaults.sample.guarantee} · Ships in one box`}
onAction={() => undefined}
state={state}
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalWhatsInside2 |
Partial<WhatsInside2Copy> |
|
headline OptionalWhatsInside2 |
string |
|
emphasis OptionalWhatsInside2 |
string | false |
|
lead OptionalWhatsInside2 |
string | false |
|
items OptionalWhatsInside2 |
WhatsInside2Item[] |
|
defaultActive OptionalWhatsInside2 |
number |
|
punch OptionalWhatsInside2 |
string[] | false |
|
riskHeadline OptionalWhatsInside2 |
string | false |
|
riskText OptionalWhatsInside2 |
string | false |
|
price OptionalWhatsInside2 |
string |
|
alternativePrice OptionalWhatsInside2 |
string | false |
|
label OptionalWhatsInside2 |
string |
|
loadingLabel OptionalWhatsInside2 |
string |
|
reassurance OptionalWhatsInside2 |
string | false |
|
errorMessage OptionalWhatsInside2 |
string |
|
href OptionalWhatsInside2 |
string |
|
onAction OptionalWhatsInside2 |
() => void | Promise<unknown> |
|
disabled OptionalWhatsInside2 |
boolean |
|
state OptionalWhatsInside2 |
WhatsInside2State |
|
id OptionalWhatsInside2 |
string |
|
className OptionalWhatsInside2 |
string |
|
style OptionalWhatsInside2 |
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-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field-focus- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
2c539f422023a290.webp
image/webp · 115 KB
-
3d1592f0762b15c2.webp
image/webp · 80.2 KB
-
b553c41885a5f9a6.webp
image/webp · 84.5 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
c55af03926914860.webp
image/webp · 142 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB