Whats Inside 4
Future-paces a subscription. The first months' boxes sit on a path the visitor scrubs through, and the path's string runs into a hang-tag offer with the price, how often it ships, the cancel terms and one action.
Use it in a prompt
Use offer/whats-inside-4 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-4.tsx. - Import it and pass your copy and images (Props tab):
import { WhatsInside4 } from "@/components/funneldna/offer/whats-inside-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/offer/whats-inside-4/component.tsx 654 lines
// layout: path-to-action
// Future-paces a subscription. The first months' boxes sit on a path the visitor scrubs through, and the path's string runs into a hang-tag offer with the price, how often it ships, the cancel terms and one action.
'use client'
import * as React from 'react'
import { AlertCircle, CalendarX, Loader2, Truck } from 'lucide-react'
import { FX_HOST, Spot, Texture } from '../fx/fx'
import topo from '../fx/textures/topo'
import gift from '../fx/spots/gift'
/** States this piece implements: hover and active force the button look, disabled locks it, error shows the checkout message. */
export type WhatsInside4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type WhatsInside4Month = {
/** Stop label, e.g. Month 1 or Every month after. */
label: string
/** Shorter label for the scrubber; defaults to label. */
short?: string
/** First line: what this box is, in a few words. */
title: string
/** Second line: what is inside it. */
detail?: string
/** item-N slot: a photo of that month's opened box. A month without one shows the earlier boxes stacked up. */
image?: string
imageAlt?: string
}
export type WhatsInside4Copy = {
/** Caption above the scrubber. */
scrubCaption: string
/** Accessible name of each stop; {label} is replaced with the month label. */
stopAction: string
/** Accessible name of the path. */
pathLabel: string
/** Heading over the numbered reasons; {price} is replaced with the price. */
reasonsHeading: string
/** Read before the struck price. */
wasLabel: string
/** Read before today's price. */
nowLabel: string
/** Alt text for the stacked boxes on a month without its own photo. */
stackAlt: string
}
export type WhatsInside4Props = {
/** Generated labels and accessible names; any key left out keeps its default. */
copy?: Partial<WhatsInside4Copy>
headline?: string
/** Phrase inside the headline that gets the marker stroke. */
emphasis?: string | false
lead?: string | false
/** The path, in order. One month renders the single-box variant without the scrubber. */
months?: WhatsInside4Month[]
/** Index of the month that starts enlarged. */
defaultActive?: number
/** Name on the hang tag. */
productName?: string | false
/** Supplied subscription price. */
price?: string
/** Billing unit after the price, e.g. /month. */
per?: string | false
/** Supplied regular price, crossed out in marker on the tag. Hidden when absent. */
regularPrice?: string
/** Short words after the struck price. */
regularNote?: string | false
/** How often it ships. Supplied facts only. */
frequency?: string | false
/** The supplied cancel terms, under the button. */
cancelTerms?: string | false
/** Numbered reasons beside the tag. */
reasons?: React.ReactNode[]
/** Button text. */
label?: string
/** Button text while onAction is pending. */
loadingLabel?: string
/** 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?: WhatsInside4State
id?: string
className?: string
style?: React.CSSProperties
}
type Status = 'idle' | 'loading' | 'error'
type Reveal = 'off' | 'wait' | 'go'
const DEFAULT_COPY: WhatsInside4Copy = {
scrubCaption: 'Slide through your first boxes',
stopAction: 'Show {label}',
pathLabel: 'Your boxes, month by month',
reasonsHeading: 'Three reasons it’s {price} a month',
wasLabel: 'Regular price',
nowLabel: 'Your price',
stackAlt: 'The boxes stacked up, one for every month',
}
const DEFAULT_MONTHS: WhatsInside4Month[] = [
{ label: 'Month 1', title: 'Smoked, salty, crunchy', detail: 'Sea-salt almonds, rosemary rye crackers and a tin of salted caramel fudge.' },
{ label: 'Month 2', title: 'Sweet from the harbour', detail: 'Honey oat cookies, sea-salt dark chocolate bark and sun-dried apricots.' },
{ label: 'Month 3', title: 'Heat and seaweed', detail: 'Chili-lime cashews, toasted seaweed crisps and pickled ginger chews.' },
{ label: 'Every month after', short: 'After', title: 'A new maker’s box, every month', detail: 'Six to eight small-batch snacks. Never the same box twice.' },
]
const DEFAULT_REASONS: React.ReactNode[] = [
'You buy straight from small coastal makers, with no warehouse in between.',
'Every box is packed to order, so nothing sits on a shelf.',
'Shipping is already in the price.',
]
export function WhatsInside4(props: WhatsInside4Props) {
const {
copy,
headline = 'Here’s what lands on your doorstep, month after month',
emphasis = 'month after month',
lead = 'Small-batch snacks from coastal makers, packed to order and shipped to your door. Slide through your first three boxes and see what keeps arriving.',
months = DEFAULT_MONTHS,
defaultActive = 0,
productName = 'The Saltmarsh Snack Box',
price = '$34',
per = '/month',
regularPrice,
regularNote = false,
frequency = 'Ships the first week of every month',
cancelTerms = 'Skip a month or cancel anytime before your next box ships.',
reasons = DEFAULT_REASONS,
label = 'Yes! I want the Saltmarsh Snack Box',
loadingLabel = 'Opening secure checkout…',
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 n = months.length
const multi = n > 1
const [active, setActive] = React.useState(() => clampIndex(defaultActive, n))
const [status, setStatus] = React.useState<Status>(state === 'error' ? 'error' : 'idle')
const [dragging, setDragging] = React.useState(false)
const [reveal, setReveal] = React.useState<Reveal>('off')
const rootRef = React.useRef<HTMLElement>(null)
const dragRef = React.useRef(false)
const hitRefs = React.useRef<(HTMLButtonElement | null)[]>([])
const trackRef = React.useRef<HTMLDivElement>(null)
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
const el = rootRef.current
if (!el || typeof IntersectionObserver === 'undefined') return
if (typeof window.matchMedia === 'function' && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
setReveal('wait')
const io = new IntersectionObserver(
(entries) => {
if (entries.some((e) => e.isIntersecting)) {
setReveal('go')
io.disconnect()
}
},
{ rootMargin: '0px 0px -10% 0px' },
)
io.observe(el)
return () => io.disconnect()
}, [])
React.useEffect(() => {
setStatus(state === 'error' ? 'error' : 'idle')
}, [state])
React.useEffect(() => {
setActive((a) => clampIndex(a, n))
}, [n])
const isDisabled = disabled || state === 'disabled'
const loading = status === 'loading'
const current = clampIndex(active, n)
const headId = `${uid}-h`
const capId = `${uid}-c`
const pathId = `${uid}-p`
const go = (i: number, focus = false) => {
const j = clampIndex(i, n)
setActive(j)
if (focus) hitRefs.current[j]?.focus()
}
const pick = (clientX: number) => {
const el = trackRef.current
if (!el || !n) return
const r = el.getBoundingClientRect()
if (!r.width) return
go(Math.floor(((clientX - r.left) / r.width) * n))
}
const endDrag = () => {
dragRef.current = false
setDragging(false)
}
const onScrubKey = (e: React.KeyboardEvent<HTMLDivElement>) => {
const to = keyTarget(e.key, current, n, 'slider')
if (to === null) return
e.preventDefault()
go(to)
}
const onStopKey = (e: React.KeyboardEvent<HTMLButtonElement>) => {
const to = keyTarget(e.key, current, n, 'list')
if (to === null) return
e.preventDefault()
go(to, true)
}
const run = async () => {
if (isDisabled || loading || !onAction) return
setStatus('loading')
try {
await onAction()
if (alive.current) setStatus('idle')
} catch {
if (alive.current) setStatus('error')
}
}
const navigates = Boolean(href) && !onAction && !isDisabled
const btnClass = `wi4-btn${loading ? ' is-loading' : ''}`
const action = navigates ? (
<a className={btnClass} href={href}>
{label}
</a>
) : (
<button type='button' className={btnClass} disabled={isDisabled} aria-busy={loading || undefined} onClick={run}>
{loading ? (
<>
<Loader2 className='wi4-spin' size={20} strokeWidth={2.5} aria-hidden />
{loadingLabel}
</>
) : (
label
)}
</button>
)
const classes = [
'cf-whats-inside-4',
multi ? 'is-multi' : 'is-single',
n > 0 ? 'has-path' : '',
multi && current === n - 1 ? 'is-end' : '',
state === 'hover' ? 'is-hover' : '',
state === 'active' ? 'is-press' : '',
reveal === 'wait' ? 'rv-wait' : '',
reveal === 'go' ? 'rv-go' : '',
className ?? '',
]
.filter(Boolean)
.join(' ')
return (
<section ref={rootRef} id={id} className={classes} style={{ ...FX_HOST, ...style }} aria-labelledby={headId}>
<style>{CSS}</style>
<Texture src={topo} tone='band-ink' />
<div className='wi4-inner'>
<header className='wi4-head'>
<h2 id={headId} className='wi4-h'>
<Marked text={headline} mark={emphasis} />
</h2>
{lead && <p className='wi4-lead'>{lead}</p>}
</header>
{multi && (
<div className='wi4-scrub'>
<p id={capId} className='wi4-cap'>
{text.scrubCaption}
</p>
<div
className={`wi4-slider${dragging ? ' is-drag' : ''}`}
role='slider'
tabIndex={0}
aria-labelledby={capId}
aria-orientation='horizontal'
aria-valuemin={1}
aria-valuemax={n}
aria-valuenow={current + 1}
aria-valuetext={months[current]?.label}
aria-controls={pathId}
onKeyDown={onScrubKey}
onPointerDown={(e) => {
if (e.button !== 0) return
e.currentTarget.setPointerCapture(e.pointerId)
dragRef.current = true
setDragging(true)
pick(e.clientX)
}}
onPointerMove={(e) => {
if (dragRef.current) pick(e.clientX)
}}
onPointerUp={endDrag}
onPointerCancel={endDrag}
style={{ '--n': n, '--i': current } as React.CSSProperties}
>
<div ref={trackRef} className='wi4-track'>
<span className='wi4-thumb' aria-hidden />
{months.map((m, i) => (
<span key={`${m.label}-${i}`} className={`wi4-tick${i === current ? ' is-on' : ''}`} aria-hidden>
{m.short ?? m.label}
</span>
))}
</div>
</div>
</div>
)}
<div className='wi4-flow'>
{n > 0 && (
<ol id={pathId} className='wi4-path' aria-label={text.pathLabel}>
{months.map((m, i) => {
const on = i === current
const passed = multi && i < current
const earlier = m.image
? []
: months
.slice(0, i)
.map((x) => x.image)
.filter((src): src is string => Boolean(src))
.slice(-3)
const cls = ['wi4-stop', on ? 'is-active' : '', passed ? 'is-passed' : '', i === n - 1 ? 'is-last' : '']
.filter(Boolean)
.join(' ')
return (
<li key={`${m.label}-${i}`} className={cls} style={{ '--d': `${Math.min(i * 0.07, 0.28)}s` } as React.CSSProperties}>
<span className='wi4-dot' aria-hidden />
<p className='wi4-label'>{m.label}</p>
{m.image ? (
<div className='wi4-photo'>
<img src={m.image} alt={m.imageAlt ?? m.title} width={1280} height={960} loading='lazy' decoding='async' />
</div>
) : earlier.length > 0 ? (
<div className='wi4-photo'>
<div className='wi4-stack' role='img' aria-label={m.imageAlt ?? text.stackAlt}>
{earlier.map((src, k) => (
<img key={`${src.slice(-24)}-${k}`} src={src} alt='' loading='lazy' decoding='async' style={{ '--k': k, '--c': earlier.length } as React.CSSProperties} />
))}
</div>
</div>
) : (
<div className='wi4-photo is-spot'>
<Spot src={gift} size={96} />
</div>
)}
<div className='wi4-copy'>
<h3 className='wi4-title'>{m.title}</h3>
{m.detail && <p className='wi4-detail'>{m.detail}</p>}
</div>
{multi && (
<button
ref={(el) => {
hitRefs.current[i] = el
}}
type='button'
className='wi4-hit'
aria-pressed={on}
aria-label={fill(text.stopAction, { label: m.label })}
tabIndex={on ? 0 : -1}
onClick={() => go(i)}
onKeyDown={onStopKey}
/>
)}
</li>
)
})}
</ol>
)}
{multi && <span className='wi4-lane' aria-hidden />}
{reasons.length > 0 && (
<div className='wi4-reasons'>
<h3 className='wi4-rh'>{fill(text.reasonsHeading, { price })}</h3>
<ol className='wi4-rl'>
{reasons.map((r, i) => (
<li key={i} className='wi4-r'>
<span className='wi4-n' aria-hidden>
{i + 1}
</span>
<span className='wi4-rt'>{r}</span>
</li>
))}
</ol>
</div>
)}
</div>
<div className='wi4-tag'>
<span className='wi4-stub' aria-hidden />
<span className='wi4-eyelet' aria-hidden />
{productName && <h3 className='wi4-name'>{productName}</h3>}
<div className='wi4-price'>
{regularPrice && (
<p className='wi4-was'>
<s className='wi4-strike'>
<span className='wi4-sr'>{text.wasLabel} </span>
{regularPrice}
</s>
{regularNote && <span>{regularNote}</span>}
</p>
)}
<p className='wi4-now'>
<span className='wi4-sr'>{text.nowLabel} </span>
<span className='wi4-amt'>{price}</span>
{per && <span className='wi4-per'>{per}</span>}
</p>
</div>
{frequency && (
<p className='wi4-ship'>
<Truck className='wi4-ico' size={18} strokeWidth={2.5} aria-hidden />
{frequency}
</p>
)}
{action}
{status === 'error' && (
<p className='wi4-err' role='alert'>
<AlertCircle className='wi4-ico' size={18} strokeWidth={2.5} aria-hidden />
{errorMessage}
</p>
)}
{cancelTerms && (
<p className='wi4-terms'>
<CalendarX className='wi4-ico' size={16} strokeWidth={2.5} aria-hidden />
{cancelTerms}
</p>
)}
</div>
</div>
</section>
)
}
export default WhatsInside4
function Marked({ 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='wi4-mark'>{mark}</span>
{text.slice(at + mark.length)}
</>
)
}
function fill(template: string, values: Record<string, string>) {
return Object.keys(values).reduce((out, key) => out.split('{' + key + '}').join(values[key]), template)
}
function clampIndex(i: number, n: number) {
if (n <= 0) return 0
const v = Number.isFinite(i) ? Math.round(i) : 0
return Math.min(n - 1, Math.max(0, v))
}
function keyTarget(key: string, i: number, n: number, mode: 'slider' | 'list'): number | null {
const forward = mode === 'slider' ? ['ArrowRight', 'ArrowUp', 'PageUp'] : ['ArrowRight', 'ArrowDown']
const back = mode === 'slider' ? ['ArrowLeft', 'ArrowDown', 'PageDown'] : ['ArrowLeft', 'ArrowUp']
if (forward.includes(key)) return Math.min(n - 1, i + 1)
if (back.includes(key)) return Math.max(0, i - 1)
if (key === 'Home') return 0
if (key === 'End') return n - 1
return null
}
const CSS = `
.cf-whats-inside-4{
--wi4-gutter: clamp(16px, 5vw, 48px);
--wi4-line: color-mix(in oklch, var(--band-ink) 34%, var(--band));
--wi4-lit: var(--band-ink);
--wi4-marker: var(--marker, #fae37c);
--wi4-sh: var(--shadow, oklch(0.22 0.03 260));
--rail-y: 12px;
--dot-x: 22px;
--gap: 28px;
--tag-gap: 40px;
--gy: 32px;
--ex: 22px;
position: relative;
overflow: hidden;
box-sizing: border-box;
padding: clamp(56px, 8vw, 112px) 0 clamp(64px, 8.5vw, 120px);
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.5;
}
.cf-whats-inside-4 *, .cf-whats-inside-4 *::before, .cf-whats-inside-4 *::after{ box-sizing: border-box }
.cf-whats-inside-4 .wi4-inner{ position: relative; z-index: 1; width: min(46rem, calc(100% - 2 * var(--wi4-gutter))); margin-inline: auto; display: flex; flex-direction: column }
.cf-whats-inside-4 .wi4-head{ margin: 0 0 32px }
.cf-whats-inside-4 .wi4-h{ margin: 0 0 16px; 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; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-mark{ color: var(--ink); padding: 0 0.16em; margin: 0 -0.08em; background-image: linear-gradient(100deg, transparent 0.1em, var(--wi4-marker) 0.13em, var(--wi4-marker) calc(100% - 0.13em), transparent calc(100% - 0.1em)); background-repeat: no-repeat; background-size: 100% 0.98em; background-position: 0 56%; -webkit-box-decoration-break: clone; box-decoration-break: clone }
.cf-whats-inside-4 .wi4-lead{ margin: 0; max-width: 62ch; font-size: clamp(1.125rem, 1.5vw, 1.375rem); line-height: 1.4; font-weight: 500; text-wrap: pretty; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-scrub{ margin: 0 0 40px }
.cf-whats-inside-4 .wi4-cap{ margin: 0 0 12px; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-slider{ position: relative; padding: 4px; border-radius: 999px; background: oklch(from var(--band-ink) l c h / 0.12); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: background 0.16s ease }
.cf-whats-inside-4 .wi4-slider:hover{ background: oklch(from var(--band-ink) l c h / 0.17) }
.cf-whats-inside-4 .wi4-slider.is-drag{ cursor: grabbing }
.cf-whats-inside-4 .wi4-slider:focus-visible{ outline: 3px solid var(--band-ink); outline-offset: 3px }
.cf-whats-inside-4 .wi4-track{ position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)) }
.cf-whats-inside-4 .wi4-thumb{ position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% / var(--n)); border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px oklch(from var(--ink) l c h / 0.12), var(--shadow-sm, 0 1px 3px oklch(from var(--wi4-sh) l c h / 0.25)); transform: translateX(calc(var(--i) * 100%)); transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) }
.cf-whats-inside-4 .wi4-tick{ position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; font-size: 0.9375rem; font-weight: 700; line-height: 1.2; white-space: nowrap; color: var(--band-ink); transition: color 0.2s ease }
.cf-whats-inside-4 .wi4-tick.is-on{ color: var(--ink) }
.cf-whats-inside-4 .wi4-flow{ position: relative; z-index: 2 }
.cf-whats-inside-4.has-path .wi4-flow::before{ content: ''; position: absolute; left: calc(var(--dot-x) - 1.5px); width: 3px; top: var(--rail-y); bottom: calc(-1 * var(--tag-gap)); border-radius: 3px 3px 0 0; background: var(--wi4-line) }
.cf-whats-inside-4 .wi4-path{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap) }
.cf-whats-inside-4 .wi4-stop{ position: relative; margin: 0; padding-left: 52px; display: grid; grid-template-columns: 104px minmax(0, 1fr); grid-template-areas: 'label label' 'photo copy'; column-gap: 16px; row-gap: 12px; align-items: start }
.cf-whats-inside-4.rv-wait .wi4-stop{ opacity: 0.82; transform: translateY(8px) }
.cf-whats-inside-4.rv-go .wi4-stop{ animation: wi4-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: var(--d, 0s) }
.cf-whats-inside-4 .wi4-stop.is-active{ grid-template-columns: minmax(0, 1fr); grid-template-areas: 'label' 'photo' 'copy' }
.cf-whats-inside-4 .wi4-stop::before{ content: ''; position: absolute; left: calc(var(--dot-x) - 1.5px); width: 3px; top: var(--rail-y); bottom: calc(-1 * (var(--gap) + var(--rail-y))); background: var(--wi4-lit); transform: scaleY(0); transform-origin: 0 0; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) }
.cf-whats-inside-4 .wi4-stop.is-passed::before{ transform: scaleY(1) }
.cf-whats-inside-4 .wi4-dot{ position: absolute; z-index: 1; left: calc(var(--dot-x) - 9px); top: calc(var(--rail-y) - 9px); width: 18px; height: 18px; border-radius: 50%; background: var(--band); border: 3px solid var(--wi4-line); transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease }
.cf-whats-inside-4 .is-passed .wi4-dot{ background: var(--wi4-lit); border-color: var(--wi4-lit) }
.cf-whats-inside-4 .is-active .wi4-dot{ background: var(--accent-fill, var(--accent)); border-color: var(--band-ink); transform: scale(1.25) }
.cf-whats-inside-4 .wi4-label{ grid-area: label; margin: 0; font-size: 0.875rem; font-weight: 800; line-height: 24px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-photo{ grid-area: photo; position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: oklch(from var(--band-ink) l c h / 0.08); transition: transform 0.16s ease }
.cf-whats-inside-4 .is-active .wi4-photo{ aspect-ratio: 16 / 11 }
.cf-whats-inside-4 .wi4-photo.is-spot{ background: none; display: grid; place-items: center }
.cf-whats-inside-4 .wi4-photo > img{ display: block; width: 100%; height: 100%; object-fit: cover; object-position: center }
.cf-whats-inside-4 .wi4-photo img{ filter: saturate(0.8) brightness(0.88); transition: filter 0.3s ease }
.cf-whats-inside-4 .is-active .wi4-photo img{ filter: none }
.cf-whats-inside-4 .wi4-stack{ position: absolute; inset: 8% }
.cf-whats-inside-4 .wi4-stack img{ position: absolute; width: calc(100% - (var(--c) - 1) * 14%); height: calc(100% - (var(--c) - 1) * 14%); left: calc(var(--k) * 14%); top: calc(var(--k) * 14%); object-fit: cover; border-radius: 8px; outline: 3px solid var(--band) }
.cf-whats-inside-4 .wi4-copy{ grid-area: copy; min-width: 0 }
.cf-whats-inside-4 .wi4-title{ margin: 0 0 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; text-wrap: balance; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-detail{ margin: 0; text-wrap: pretty; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-hit{ position: absolute; inset: -8px; z-index: 2; margin: 0; padding: 0; border: 0; border-radius: 16px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent }
.cf-whats-inside-4 .wi4-hit[aria-pressed='true']{ cursor: default }
.cf-whats-inside-4 .wi4-hit:focus-visible{ outline: 3px solid var(--band-ink); outline-offset: 0 }
.cf-whats-inside-4 .wi4-stop:has(.wi4-hit:focus-visible) .wi4-photo img{ filter: none }
.cf-whats-inside-4 .wi4-stop:has(.wi4-hit:active) .wi4-photo{ transform: scale(0.985) }
@media (hover: hover){
.cf-whats-inside-4 .wi4-stop:hover .wi4-photo{ transform: translateY(-3px) }
.cf-whats-inside-4 .wi4-stop:hover .wi4-photo img{ filter: none }
}
.cf-whats-inside-4 .wi4-reasons{ margin: 48px 0 0; padding-left: 52px }
.cf-whats-inside-4 .wi4-rh{ margin: 0 0 16px; 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; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-rl{ list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 60ch }
.cf-whats-inside-4 .wi4-r{ display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: 12px; align-items: baseline }
.cf-whats-inside-4 .wi4-n{ 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.03em; font-variant-numeric: tabular-nums; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-rt{ line-height: 1.5; text-wrap: pretty; color: var(--band-ink) }
.cf-whats-inside-4 .wi4-tag{ position: relative; z-index: 1; margin: var(--tag-gap) 0 0; padding: 60px clamp(20px, 3vw, 32px) clamp(24px, 3vw, 32px); background: var(--card); color: var(--ink); border: 1px solid var(--card-border, oklch(from var(--ink) l c h / 0.12)); border-radius: var(--card-radius, var(--radius, 14px)); box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--wi4-sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--wi4-sh) l c h / 0.32))); transform: rotate(-0.8deg); transform-origin: var(--ex) var(--gy) }
.cf-whats-inside-4 .wi4-eyelet{ position: absolute; z-index: 2; top: calc(var(--gy) - 9px); left: calc(var(--ex) - 9px); width: 18px; height: 18px; border-radius: 50%; background: var(--band); border: 3px solid color-mix(in oklch, var(--ink) 18%, var(--card)); box-shadow: inset 0 1px 2px oklch(from var(--wi4-sh) l c h / 0.5) }
.cf-whats-inside-4 .wi4-stub{ position: absolute; z-index: 1; top: -1px; left: calc(var(--ex) - 1.5px); width: 3px; height: calc(var(--gy) + 1px); background: color-mix(in oklch, var(--ink) 30%, var(--card)) }
.cf-whats-inside-4:not(.has-path) .wi4-stub{ display: none }
.cf-whats-inside-4 .wi4-name{ margin: 0 0 16px; 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; color: var(--ink) }
.cf-whats-inside-4 .wi4-price{ margin: 0 0 16px }
.cf-whats-inside-4 .wi4-was{ margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 4px; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--muted) }
.cf-whats-inside-4 .wi4-strike{ position: relative; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--muted) }
.cf-whats-inside-4 .wi4-strike::after{ content: ''; position: absolute; left: -8%; right: -8%; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--danger); transform: rotate(-9deg) }
.cf-whats-inside-4 .wi4-now{ margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--ink) }
.cf-whats-inside-4 .wi4-was + .wi4-now{ margin-top: 12px }
.cf-whats-inside-4 .wi4-amt{ 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 }
.cf-whats-inside-4 .wi4-per{ font-size: 1.125rem; font-weight: 700; color: var(--muted) }
.cf-whats-inside-4 .wi4-ship{ margin: 16px 0 24px; font-weight: 600; line-height: 1.4; text-wrap: pretty; color: var(--ink) }
.cf-whats-inside-4 .wi4-ico{ display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; color: var(--accent) }
.cf-whats-inside-4 .wi4-terms{ margin: 16px 0 0; font-size: 0.9375rem; font-weight: 500; line-height: 1.4; text-align: center; text-wrap: pretty; color: var(--muted) }
.cf-whats-inside-4 .wi4-terms .wi4-ico{ color: var(--muted) }
.cf-whats-inside-4 .wi4-err{ margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft, color-mix(in oklch, var(--danger) 14%, var(--card))); color: var(--danger); font-size: 0.9375rem; font-weight: 600; line-height: 1.4; text-wrap: pretty }
.cf-whats-inside-4 .wi4-err .wi4-ico{ color: var(--danger) }
.cf-whats-inside-4 .wi4-sr{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap }
.cf-whats-inside-4 .wi4-btn{
--b: var(--button-bg, var(--cta));
--b2: var(--button-bg-2, var(--cta-2));
position: relative; display: flex; width: 100%; min-height: 64px; margin: 0; padding: 12px 24px;
align-items: center; justify-content: center; gap: 10px; text-align: center; text-wrap: balance; text-decoration: none;
border: 0; cursor: pointer;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--b) calc(l + 0.04) c h), oklch(from var(--b2) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.125rem, 1.55vw, 1.375rem); line-height: 1.15; letter-spacing: -0.005em;
text-shadow: var(--button-text-shadow, none);
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--wi4-sh) l c h / 0.3), 0 8px 16px -6px oklch(from var(--wi4-sh) l c h / 0.45));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
@media (hover: hover){
.cf-whats-inside-4 .wi4-btn:not(:disabled):hover{ background: linear-gradient(oklch(from var(--b) calc(l - 0.01) c h), oklch(from var(--b2) calc(l - 0.07) c h)); box-shadow: inset 0 1px 0 oklch(from var(--b) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--wi4-sh) l c h / 0.32), 0 10px 20px -6px oklch(from var(--wi4-sh) l c h / 0.52); transform: translateY(-1px) }
}
.cf-whats-inside-4.is-hover .wi4-btn:not(:disabled){ background: linear-gradient(oklch(from var(--b) calc(l - 0.01) c h), oklch(from var(--b2) calc(l - 0.07) c h)); box-shadow: inset 0 1px 0 oklch(from var(--b) calc(l + 0.1) c h / 0.6), inset 0 -3px 0 oklch(from var(--b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--wi4-sh) l c h / 0.32), 0 10px 20px -6px oklch(from var(--wi4-sh) l c h / 0.52); transform: translateY(-1px) }
.cf-whats-inside-4 .wi4-btn:not(:disabled):active, .cf-whats-inside-4.is-press .wi4-btn:not(:disabled){ background: linear-gradient(oklch(from var(--b) calc(l - 0.04) c h), oklch(from var(--b2) calc(l - 0.08) c h)); box-shadow: inset 0 2px 4px oklch(from var(--wi4-sh) l c h / 0.35), inset 0 -2px 0 oklch(from var(--b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--wi4-sh) l c h / 0.3); transform: translateY(1px) }
.cf-whats-inside-4 .wi4-btn:focus-visible{ outline: 3px solid var(--field-focus, var(--accent)); outline-offset: 3px }
.cf-whats-inside-4 .wi4-btn:disabled{ background: var(--button-2-bg, var(--secondary)); color: var(--button-2-ink, var(--secondary-ink)); text-shadow: none; box-shadow: none; cursor: not-allowed; transform: none }
.cf-whats-inside-4 .wi4-btn.is-loading{ cursor: progress }
.cf-whats-inside-4 .wi4-spin{ flex: 0 0 auto; animation: wi4-spin 0.8s linear infinite }
@keyframes wi4-rise{ from{ opacity: 0.82; transform: translateY(8px) } to{ opacity: 1; transform: none } }
@keyframes wi4-spin{ to{ transform: rotate(360deg) } }
@media (min-width: 1080px){
.cf-whats-inside-4{ --dot-x: 9px; --gap: 20px; --col-gap: 16px; --row-gap: 56px; --ex: 24px }
.cf-whats-inside-4 .wi4-inner{ width: min(1120px, calc(100% - 2 * var(--wi4-gutter))); display: grid; grid-template-columns: minmax(0, 1fr) 440px 48px; grid-template-areas: 'head scrub scrub' 'path path lane' 'reasons tag tag'; column-gap: var(--col-gap); row-gap: var(--row-gap); align-items: start }
.cf-whats-inside-4 .wi4-head{ grid-area: head; margin: 0; padding-right: 32px }
.cf-whats-inside-4 .wi4-scrub{ grid-area: scrub; margin: 0; align-self: end }
.cf-whats-inside-4 .wi4-flow{ display: contents }
.cf-whats-inside-4.has-path .wi4-flow::before{ display: none }
.cf-whats-inside-4 .wi4-path{ grid-area: path; position: relative; z-index: 2; flex-direction: row; align-items: flex-start }
.cf-whats-inside-4.has-path .wi4-path::before{ content: ''; position: absolute; left: var(--dot-x); right: calc(-1 * var(--col-gap)); top: calc(var(--rail-y) - 1.5px); height: 3px; background: var(--wi4-line) }
.cf-whats-inside-4 .wi4-stop{ flex: 1 1 0; min-width: 0; padding: 36px 0 0; display: flex; flex-direction: column; align-items: stretch; gap: 12px; transition: flex-grow 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) }
.cf-whats-inside-4 .wi4-stop.is-active{ flex-grow: 1.8 }
.cf-whats-inside-4 .wi4-stop::before{ top: calc(var(--rail-y) - 1.5px); bottom: auto; height: 3px; width: auto; left: var(--dot-x); right: calc(-1 * (var(--gap) + var(--dot-x))); transform: scaleX(0); transform-origin: 0 50% }
.cf-whats-inside-4 .wi4-stop.is-passed::before{ transform: scaleX(1) }
.cf-whats-inside-4.is-end .wi4-stop.is-last::before{ right: calc(-1 * var(--col-gap)); transform: scaleX(1) }
.cf-whats-inside-4 .wi4-label{ line-height: 1.2 }
.cf-whats-inside-4 .wi4-photo, .cf-whats-inside-4 .is-active .wi4-photo{ width: 100%; aspect-ratio: 5 / 4 }
.cf-whats-inside-4 .wi4-lane{ grid-area: lane; position: relative; z-index: 2; display: block; align-self: stretch }
.cf-whats-inside-4 .wi4-lane::before{ content: ''; position: absolute; top: calc(var(--rail-y) - 1.5px); left: 0; width: calc(var(--ex) + 1.5px); bottom: calc(-1 * var(--row-gap)); border-top: 3px solid var(--wi4-line); border-right: 3px solid var(--wi4-line); border-top-right-radius: 20px; transition: border-color 0.3s ease }
.cf-whats-inside-4.is-end .wi4-lane::before{ border-color: var(--wi4-lit) }
.cf-whats-inside-4 .wi4-reasons{ grid-area: reasons; margin: 0; padding: 0 32px 0 0 }
.cf-whats-inside-4 .wi4-tag{ grid-area: tag; margin: 0; transform: rotate(0.8deg); transform-origin: calc(100% - var(--ex)) var(--gy) }
.cf-whats-inside-4.is-multi .wi4-eyelet{ left: auto; right: calc(var(--ex) - 9px) }
.cf-whats-inside-4.is-multi .wi4-stub{ left: auto; right: calc(var(--ex) - 1.5px) }
.cf-whats-inside-4.is-single .wi4-inner{ --col-gap: 56px; grid-template-columns: minmax(0, 1fr) 440px; grid-template-areas: 'head head' 'path tag' 'reasons tag' }
.cf-whats-inside-4.is-single.has-path .wi4-tag{ margin-top: calc(var(--rail-y) - var(--gy)); transform: rotate(-0.8deg); transform-origin: var(--ex) var(--gy) }
.cf-whats-inside-4.is-single .wi4-stub{ top: calc(var(--gy) - 1.5px); left: -1px; width: calc(var(--ex) + 1px); height: 3px }
.cf-whats-inside-4.is-single .wi4-photo, .cf-whats-inside-4.is-single .is-active .wi4-photo{ aspect-ratio: 16 / 10 }
}
@media (prefers-reduced-motion: reduce){
.cf-whats-inside-4 .wi4-stop, .cf-whats-inside-4 .wi4-stop::before, .cf-whats-inside-4 .wi4-dot, .cf-whats-inside-4 .wi4-photo, .cf-whats-inside-4 .wi4-photo img, .cf-whats-inside-4 .wi4-thumb, .cf-whats-inside-4 .wi4-tick, .cf-whats-inside-4 .wi4-slider, .cf-whats-inside-4 .wi4-lane::before, .cf-whats-inside-4 .wi4-btn, .cf-whats-inside-4 .wi4-spin{ animation: none; transition: none }
.cf-whats-inside-4.rv-wait .wi4-stop{ opacity: 1; transform: none }
.cf-whats-inside-4 .wi4-stop:hover .wi4-photo, .cf-whats-inside-4 .wi4-btn:not(:disabled):hover, .cf-whats-inside-4.is-hover .wi4-btn:not(:disabled){ transform: none }
}
`
pieces/offer/whats-inside-4/specimen.tsx 53 lines
import __studioImage70e81ed0 from "../assets/e3ad8891fc959ccf.webp";
import __studioImage72aeb3fb from "../assets/a8ba9c261fe9a988.webp";
import __studioImage4d8d53aa from "../assets/55e208ae37d41e5c.webp";
// Specimen: the Saltmarsh Snack Box, a fictional monthly small-batch snack subscription.
import { WhatsInside4, type WhatsInside4State } from '../whats-inside-4'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function WhatsInside4Specimen({ state = 'default' }: { state?: WhatsInside4State }) {
return (
<WhatsInside4
state={state}
months={[
{
label: 'Month 1',
title: 'Smoked, salty, crunchy',
detail: 'Sea-salt almonds, rosemary rye crackers and a tin of salted caramel fudge.',
image: slot('item-1', __studioImage70e81ed0),
imageAlt: 'Opened Saltmarsh box with smoked almonds, rye crackers and salted fudge',
},
{
label: 'Month 2',
title: 'Sweet from the harbour',
detail: 'Honey oat cookies, sea-salt dark chocolate bark and sun-dried apricots.',
image: slot('item-2', __studioImage72aeb3fb),
imageAlt: 'Opened Saltmarsh box with honey oat cookies, chocolate bark and dried apricots',
},
{
label: 'Month 3',
title: 'Heat and seaweed',
detail: 'Chili-lime cashews, toasted seaweed crisps and pickled ginger chews.',
image: slot('item-3', __studioImage4d8d53aa),
imageAlt: 'Opened Saltmarsh box with chili-lime cashews, seaweed crisps and ginger chews',
},
{
label: 'Every month after',
short: 'After',
title: 'A new maker’s box, every month',
detail: 'Six to eight small-batch snacks. Never the same box twice.',
},
]}
productName='The Saltmarsh Snack Box'
price='$34'
per='/month'
regularPrice='$42'
regularNote='bought snack by snack'
frequency='Ships the first week of every month'
cancelTerms='Skip a month or cancel anytime before your next box ships.'
label='Yes! I want the Saltmarsh Snack Box'
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalWhatsInside4 |
Partial<WhatsInside4Copy> |
|
headline OptionalWhatsInside4 |
string |
|
emphasis OptionalWhatsInside4 |
string | false |
|
lead OptionalWhatsInside4 |
string | false |
|
months OptionalWhatsInside4 |
WhatsInside4Month[] |
|
defaultActive OptionalWhatsInside4 |
number |
|
productName OptionalWhatsInside4 |
string | false |
|
price OptionalWhatsInside4 |
string |
|
per OptionalWhatsInside4 |
string | false |
|
regularPrice OptionalWhatsInside4 |
string |
|
regularNote OptionalWhatsInside4 |
string | false |
|
frequency OptionalWhatsInside4 |
string | false |
|
cancelTerms OptionalWhatsInside4 |
string | false |
|
reasons OptionalWhatsInside4 |
React.ReactNode[] |
|
label OptionalWhatsInside4 |
string |
|
loadingLabel OptionalWhatsInside4 |
string |
|
errorMessage OptionalWhatsInside4 |
string |
|
href OptionalWhatsInside4 |
string |
|
onAction OptionalWhatsInside4 |
() => void | Promise<unknown> |
|
disabled OptionalWhatsInside4 |
boolean |
|
state OptionalWhatsInside4 |
WhatsInside4State |
|
id OptionalWhatsInside4 |
string |
|
className OptionalWhatsInside4 |
string |
|
style OptionalWhatsInside4 |
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- 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.
-
55e208ae37d41e5c.webp
image/webp · 97.4 KB
-
63571cb07acc4626.webp
image/webp · 17.3 KB
-
a57ca5c86a05001f.webp
image/webp · 108 KB
-
a8ba9c261fe9a988.webp
image/webp · 198 KB
-
e3ad8891fc959ccf.webp
image/webp · 173 KB