VSL Spoiler Box 1
The box under a VSL listing what the presentation actually reveals, so skimmers go back to the video.
Use it in a prompt
Use hero/vsl-spoiler-box 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/hero/vsl-spoiler-box.tsx. - Import it and pass your copy and images (Props tab):
import { VslSpoilerBox } from "@/components/funneldna/hero/vsl-spoiler-box"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/vsl-spoiler-box/component.tsx 313 lines
// Previews the video’s contents and returns skimmers to the presentation.
// layout: clipboard-checklist
import * as React from 'react'
import { AlertCircle, Check, Play } from 'lucide-react'
export type Spoiler = {
/** Short bold line, e.g. 'Map your funnel'. */
title?: React.ReactNode
/** What the viewer learns. Every item must actually be in the video. */
text: React.ReactNode
/** Where it happens in the video, e.g. '6:42'. Must match the media. */
timestamp?: string
}
export type VslSpoilerBoxState = 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
export type VslSpoilerBoxProps = {
/** Headline lead-in, set before the highlighted phrase. */
title?: React.ReactNode
/** The key phrase that gets the marker-highlighter stroke. */
highlight?: React.ReactNode
subtitle?: React.ReactNode
spoilers?: Spoiler[]
/** Bold line above the button. */
closing?: React.ReactNode
actionLabel?: string
/** One short line under the button. */
note?: React.ReactNode
/** Printed on the clipboard's bottom lip, e.g. the offer name. */
brand?: React.ReactNode
/** id of the video element on the page; the button scrolls back to it. */
videoTarget?: string
/** Optional hook (e.g. resume the player). Return false to show the error state. */
onAction?: () => boolean | void
/** Legacy alias for onAction. */
onReturn?: () => boolean | void
/** Called when a spoiler's timestamp chip is pressed. */
onSeek?: (timestamp: string) => void
/** Replaces {timestamp} with the supplied media timestamp. */
seekLabel?: string
disabled?: boolean
disabledNote?: React.ReactNode
/** @deprecated No longer rendered: the return is immediate. */
loadingLabel?: string
/** @deprecated No longer rendered: the builder wires what happens after the click. */
successMessage?: React.ReactNode
errorMessage?: React.ReactNode
/** Forces a visual state (studio previews). "success" is accepted for older callers and renders as default. */
state?: VslSpoilerBoxState
className?: string
style?: React.CSSProperties
}
export function VslSpoilerBox({
title = 'Here’s what the',
highlight = 'presentation reveals',
subtitle = 'A clear plan for your first funnel.',
spoilers = DEFAULT_SPOILERS,
closing = 'See how it comes together.',
actionLabel = 'Back to the presentation',
note = 'Takes you straight back up to the video.',
brand,
videoTarget = 'vsl',
onReturn,
onAction = onReturn,
onSeek,
seekLabel = 'Watch this part at {timestamp}',
disabled = false,
disabledNote = 'The presentation is still loading.',
errorMessage = 'We couldn’t find the video on this page. Scroll up to watch it.',
state,
className,
style,
}: VslSpoilerBoxProps) {
const rootRef = React.useRef<HTMLDivElement>(null)
const timers = React.useRef<number[]>([])
const [reveal, setReveal] = React.useState<'static' | 'armed' | 'in'>('static')
const [status, setStatus] = React.useState<'idle' | 'error'>('idle')
const uid = React.useId().replace(/:/g, '')
const headingId = `${uid}-h`
const footId = `${uid}-foot`
React.useEffect(() => () => timers.current.forEach((t) => window.clearTimeout(t)), [])
useIsoLayoutEffect(() => {
const el = rootRef.current
if (!el || typeof IntersectionObserver === 'undefined' || prefersReduced()) return
setReveal('armed')
let frame: number | undefined
const io = new IntersectionObserver(
(entries) => {
if (entries.some((e) => e.isIntersecting)) {
io.disconnect()
frame = window.requestAnimationFrame(() => setReveal('in'))
}
},
{ threshold: 0.2 }
)
io.observe(el)
return () => {
io.disconnect()
if (frame !== undefined) window.cancelAnimationFrame(frame)
}
}, [])
const isDisabled = disabled || state === 'disabled'
const shown = state === 'error' ? state : status
const force = state === 'hover' || state === 'active' ? state : undefined
const later = (fn: () => void, ms: number) => {
timers.current.push(window.setTimeout(fn, ms))
}
const handleReturn = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault()
if (isDisabled) return
timers.current.forEach((t) => window.clearTimeout(t))
timers.current = []
const reduce = prefersReduced()
let ok = false
const target = videoTarget ? document.getElementById(videoTarget) : null
if (target) {
target.scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'center' })
if (!target.hasAttribute('tabindex')) target.setAttribute('tabindex', '-1')
later(() => target.focus({ preventScroll: true }), reduce ? 0 : 500)
ok = true
}
if (onAction) ok = onAction() !== false
setStatus(ok ? 'idle' : 'error')
}
const tone = isDisabled ? 'disabled' : shown === 'error' ? 'error' : 'note'
return (
<div ref={rootRef} className={cx('cf-vsl-spoiler-box vsb', className)} data-reveal={reveal} style={style}>
<style>{CSS}</style>
<Clip uid={uid} />
<div className='vsb-board'>
<div className='vsb-stack'>
<span className='vsb-sheet-back' aria-hidden='true' />
<section className='vsb-paper' aria-labelledby={headingId}>
<h2 id={headingId} className='vsb-h'>
{title}
{title && highlight ? ' ' : null}
{highlight ? <span className='vsb-mark'>{highlight}</span> : null}
</h2>
{subtitle ? <p className='vsb-sub'>{subtitle}</p> : null}
<ul className='vsb-list'>
{spoilers.map((s, i) => (
<li key={i} className='vsb-row' style={{ '--i': i } as React.CSSProperties}>
<span className='vsb-box' aria-hidden='true'>
<span className='vsb-fill' />
<Check className='vsb-check' strokeWidth={3.5} aria-hidden='true' />
</span>
<div className='vsb-copy'>
{s.title ? <p className='vsb-row-title'>{s.title}</p> : null}
<p className='vsb-row-text'>{s.text}</p>
</div>
{s.timestamp ? (
onSeek ? (
<button type='button' className='vsb-time' onClick={() => onSeek(s.timestamp as string)} aria-label={seekLabel.replaceAll('{timestamp}', () => s.timestamp ?? '')}>
<Play aria-hidden='true' />
{s.timestamp}
</button>
) : (
<span className='vsb-time vsb-time--static'>
<Play aria-hidden='true' />
{s.timestamp}
</span>
)
) : null}
</li>
))}
</ul>
{closing ? <p className='vsb-close'>{closing}</p> : null}
<button
type='button'
className='vsb-btn'
data-force={force}
data-status={shown}
disabled={isDisabled}
aria-describedby={footId}
onClick={handleReturn}
>
<span className='vsb-btn-label'>{actionLabel}</span>
</button>
<p id={footId} className='vsb-foot' data-tone={tone} role='status' aria-live='polite'>
{tone === 'error' ? <AlertCircle aria-hidden='true' /> : null}
<span>{tone === 'disabled' ? disabledNote : tone === 'error' ? errorMessage : note}</span>
</p>
</section>
</div>
{brand ? <p className='vsb-brand'>{brand}</p> : null}
</div>
</div>
)
}
export default VslSpoilerBox
const DEFAULT_SPOILERS: Spoiler[] = [
{ title: 'Map your funnel', text: 'Map your offer and the pages your funnel needs.' },
{ title: 'Write your page copy', text: 'Draft your headline, offer, and call to action.' },
{ title: 'Check before you launch', text: 'Review the links, forms, and next steps before launch.' },
]
const cx = (...c: Array<string | false | null | undefined>) => c.filter(Boolean).join(' ')
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect
const prefersReduced = () =>
typeof window !== 'undefined' && (window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ?? false)
function Clip({ uid }: { uid: string }) {
const m = `${uid}-metal`
const p = `${uid}-plate`
const r = `${uid}-rivet`
return (
<svg className='vsb-clip' viewBox='0 0 220 92' aria-hidden='true' focusable='false'>
<defs>
<linearGradient id={m} x1='0' y1='0' x2='0' y2='1'>
<stop offset='0' stopColor='var(--card)' />
<stop offset='0.38' stopColor='color-mix(in oklch,var(--ink) 16%,var(--card))' />
<stop offset='0.52' stopColor='color-mix(in oklch,var(--ink) 40%,var(--card))' />
<stop offset='0.64' stopColor='color-mix(in oklch,var(--ink) 24%,var(--card))' />
<stop offset='1' stopColor='color-mix(in oklch,var(--ink) 6%,var(--card))' />
</linearGradient>
<linearGradient id={p} x1='0' y1='0' x2='0' y2='1'>
<stop offset='0' stopColor='color-mix(in oklch,var(--ink) 34%,var(--card))' />
<stop offset='0.5' stopColor='color-mix(in oklch,var(--ink) 8%,var(--card))' />
<stop offset='1' stopColor='color-mix(in oklch,var(--ink) 28%,var(--card))' />
</linearGradient>
<radialGradient id={r} cx='0.35' cy='0.35' r='0.7'>
<stop offset='0' stopColor='var(--card)' />
<stop offset='0.5' stopColor='color-mix(in oklch,var(--ink) 22%,var(--card))' />
<stop offset='1' stopColor='color-mix(in oklch,var(--ink) 60%,var(--card))' />
</radialGradient>
</defs>
<path d='M110 2a18 18 0 1 1 0 36a18 18 0 1 1 0-36zM110 12a8 8 0 1 0 0 16a8 8 0 1 0 0-16z' fillRule='evenodd' fill={`url(#${p})`} stroke='color-mix(in oklch,var(--ink) 66%,var(--card))' strokeWidth='1.5' />
<path d='M97 30h26l4 10H93z' fill={`url(#${m})`} stroke='color-mix(in oklch,var(--ink) 66%,var(--card))' strokeWidth='1.2' />
<path d='M20 36h180a8 8 0 0 1 7.8 6.2l8.6 36A8 8 0 0 1 208.6 88H11.4a8 8 0 0 1-7.8-9.8l8.6-36A8 8 0 0 1 20 36z' fill={`url(#${m})`} stroke='color-mix(in oklch,var(--ink) 70%,var(--card))' strokeWidth='1.5' />
<path d='M22 39.5h176' stroke='var(--card)' strokeOpacity='0.85' strokeWidth='1.5' strokeLinecap='round' />
<rect x='40' y='50' width='140' height='24' rx='12' fill={`url(#${p})`} stroke='color-mix(in oklch,var(--ink) 62%,var(--card))' strokeWidth='1' />
<path d='M54 54.5h112' stroke='var(--card)' strokeOpacity='0.65' strokeWidth='1.2' strokeLinecap='round' />
<circle cx='24' cy='66' r='5.5' fill={`url(#${r})`} stroke='color-mix(in oklch,var(--ink) 74%,var(--card))' strokeWidth='1' />
<circle cx='196' cy='66' r='5.5' fill={`url(#${r})`} stroke='color-mix(in oklch,var(--ink) 74%,var(--card))' strokeWidth='1' />
</svg>
)
}
// Neutral alpha shadows provide close depth; the clip artwork follows the theme surfaces.
const CSS = `
.cf-vsl-spoiler-box{--vsb-paper:var(--card,#ffffff);--vsb-line:oklch(from var(--ink,#101828) l c h / 0.13);--vsb-marker:color-mix(in oklch,var(--marker,#fae37c) 20%,var(--card));--vsb-board:var(--band,#0f2747);position:relative;width:100%;max-width:46rem;margin-inline:auto;padding-top:24px;font-family:var(--font-body,system-ui,sans-serif);color:var(--ink,#101828);-webkit-font-smoothing:antialiased}
.cf-vsl-spoiler-box *,.cf-vsl-spoiler-box *::before,.cf-vsl-spoiler-box *::after{box-sizing:border-box}
:where(.cf-vsl-spoiler-box) .vsb-clip{position:absolute;top:0;left:50%;z-index:3;width:210px;height:auto;transform:translateX(-50%);pointer-events:none;filter:drop-shadow(0 2px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24))}
:where(.cf-vsl-spoiler-box) .vsb-board{position:relative;padding:44px 18px 0;border-radius:var(--card-radius,var(--radius,24px));background:var(--vsb-board);box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12))}
:where(.cf-vsl-spoiler-box) .vsb-stack{position:relative}
:where(.cf-vsl-spoiler-box) .vsb-sheet-back{position:absolute;left:8px;right:8px;top:14px;bottom:-9px;border-radius:var(--card-radius,var(--radius,6px));background:color-mix(in oklch,var(--ink) 14%,var(--vsb-paper));transform:rotate(1.1deg);transform-origin:50% 0;box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12))}
:where(.cf-vsl-spoiler-box) .vsb-paper{position:relative;z-index:1;margin:0;padding:62px 44px 32px;border-radius:var(--card-radius,var(--radius,6px));background-color:var(--vsb-paper);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12))}
:where(.cf-vsl-spoiler-box) .vsb-h{margin:0 0 .3em;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(2rem,1.3rem + 3vw,3.5rem);line-height:1.04;letter-spacing:var(--display-tracking,-.03em);color:var(--ink,#101828);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-vsl-spoiler-box) .vsb-mark{padding:0 .14em;margin:0 -.06em;background-image:linear-gradient(var(--vsb-marker),var(--vsb-marker));background-repeat:no-repeat;background-size:100% 62%;background-position:0 92%;border-radius:.18em .5em .28em .55em/.5em .3em .6em .35em;-webkit-box-decoration-break:clone;box-decoration-break:clone;transition:background-size .75s cubic-bezier(.22,.8,.24,1) .1s}
.cf-vsl-spoiler-box[data-reveal='armed'] .vsb-mark{background-size:0% 62%}
.cf-vsl-spoiler-box[data-reveal='in'] .vsb-mark{background-size:100% 62%}
:where(.cf-vsl-spoiler-box) .vsb-sub{margin:0 0 24px;max-width:40ch;font-size:clamp(1.125rem,1rem + .6vw,1.4375rem);font-weight:500;line-height:1.35;color:color-mix(in oklch,var(--ink,#101828) 62%,var(--muted,#4a5565));text-wrap:pretty}
:where(.cf-vsl-spoiler-box) .vsb-list{list-style:none;margin:0;padding:0}
:where(.cf-vsl-spoiler-box) .vsb-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;column-gap:18px;padding:18px 4px}
:where(.cf-vsl-spoiler-box) .vsb-row+.vsb-row{border-top:1px solid var(--vsb-line)}
:where(.cf-vsl-spoiler-box) .vsb-box{position:relative;display:grid;place-items:center;width:38px;height:38px;margin-top:0;overflow:hidden;border-radius:var(--card-radius,var(--radius,10px));background:var(--card,#ffffff);border:2px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12))}
:where(.cf-vsl-spoiler-box) .vsb-fill{position:absolute;inset:0;background:var(--success-soft);box-shadow:inset 0 -2px 0 oklch(from var(--surface) calc(l - 0.12) c h / .18);transform-origin:50% 100%;transition:transform .35s cubic-bezier(.3,1.4,.5,1) calc(var(--i,0) * 140ms + 300ms)}
:where(.cf-vsl-spoiler-box) .vsb-check{position:relative;width:24px;height:24px;color:var(--success);filter:drop-shadow(0 1px 0 oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.18));transition:transform .35s cubic-bezier(.3,1.6,.5,1) calc(var(--i,0) * 140ms + 420ms),opacity .2s linear calc(var(--i,0) * 140ms + 420ms)}
.cf-vsl-spoiler-box[data-reveal='armed'] .vsb-fill{transform:scale(0)}
.cf-vsl-spoiler-box[data-reveal='armed'] .vsb-check{transform:scale(.3) rotate(-12deg);opacity:0}
.cf-vsl-spoiler-box[data-reveal='in'] .vsb-fill{transform:none}
.cf-vsl-spoiler-box[data-reveal='in'] .vsb-check{transform:none;opacity:1}
:where(.cf-vsl-spoiler-box) .vsb-copy{min-width:0}
:where(.cf-vsl-spoiler-box) .vsb-row-title{margin:0 0 5px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.1875rem,1.05rem + .6vw,1.5rem);line-height:1.2;letter-spacing:var(--display-tracking,-.015em);color:var(--ink,#101828);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-vsl-spoiler-box) .vsb-row-text{margin:0;font-size:clamp(1rem,.95rem + .25vw,1.125rem);font-weight:500;line-height:1.5;color:var(--muted,#4a5565);text-wrap:pretty}
:where(.cf-vsl-spoiler-box) .vsb-time{display:inline-flex;align-items:center;gap:6px;margin-top:2px;padding:6px 12px;border-radius:var(--button-radius,var(--radius,999px));background:var(--button-2-bg,var(--card));border:1px solid oklch(from var(--ink,#101828) l c h / 0.18);font:700 14px/1.2 var(--font-body,inherit);font-variant-numeric:tabular-nums;color:var(--button-2-ink,var(--ink));white-space:nowrap;cursor:pointer;transition:background-color .15s,border-color .15s,transform .15s;border-color:var(--button-2-border,oklch(from var(--ink) l c h / 0.18));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,700);text-transform:var(--button-case,none);box-shadow:var(--button-shadow,0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24))}
:where(.cf-vsl-spoiler-box) .vsb-time svg{width:12px;height:12px;fill:currentColor}
:where(.cf-vsl-spoiler-box) .vsb-time:hover{border-color:var(--button-2-border,oklch(from var(--ink) l c h / 0.18));background:var(--button-2-bg,var(--card))}
:where(.cf-vsl-spoiler-box) .vsb-time:active{transform:translateY(1px)}
:where(.cf-vsl-spoiler-box) .vsb-time:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:2px}
:where(.cf-vsl-spoiler-box) .vsb-time--static{cursor:default}
:where(.cf-vsl-spoiler-box) .vsb-close{margin:28px 0 18px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.5rem,1.15rem + 1.4vw,2.25rem);line-height:1.1;letter-spacing:var(--display-tracking,-.025em);color:var(--ink,#101828);text-wrap:balance;text-transform:var(--display-case,none)}
:where(.cf-vsl-spoiler-box) .vsb-btn{position:relative;display:flex;width:100%;min-height:4.5rem;align-items:center;justify-content:center;gap:.7rem;margin-inline:auto;padding:.875rem 1.25rem;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);font-size:clamp(1.0625rem,.55rem + 2.4vw,1.75rem);line-height:1.1;letter-spacing:-.01em;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));background:linear-gradient(180deg,var(--button-bg,var(--cta)),var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h)));border:1px solid var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));box-shadow:var(--button-shadow,0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));cursor:pointer;transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;-webkit-tap-highlight-color:transparent;border-color:var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));text-transform:var(--button-case,none)}
:where(.cf-vsl-spoiler-box) .vsb-btn-label{min-width:0;text-align:center;text-wrap:balance}
:where(.cf-vsl-spoiler-box) .vsb-btn:not(:disabled):hover,:where(.cf-vsl-spoiler-box) .vsb-btn[data-force='hover']{transform:translateY(-2px);background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:var(--button-shadow,0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24))}
:where(.cf-vsl-spoiler-box) .vsb-btn:not(:disabled):active,:where(.cf-vsl-spoiler-box) .vsb-btn[data-force='active']{transform:translateY(4px);background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:var(--button-shadow,0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24))}
:where(.cf-vsl-spoiler-box) .vsb-btn:focus-visible{outline:3px solid var(--accent,#0f5fc2);outline-offset:4px}
:where(.cf-vsl-spoiler-box) .vsb-btn:disabled{cursor:not-allowed;color:var(--button-ink,var(--cta-ink));text-shadow:none;background:var(--button-bg,var(--cta));border-color:var(--button-bg-2,oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));box-shadow:var(--button-shadow,0 3px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.24));filter:none;transform:none}
:where(.cf-vsl-spoiler-box) .vsb-foot{display:flex;align-items:flex-start;justify-content:center;gap:8px;width:fit-content;max-width:100%;margin:16px auto 0;font-size:15px;font-weight:600;line-height:1.4;text-align:center;color:var(--muted,#4a5565)}
:where(.cf-vsl-spoiler-box) .vsb-foot span{text-wrap:pretty}
:where(.cf-vsl-spoiler-box) .vsb-foot svg{flex:none;width:18px;height:18px;margin-top:1px}
:where(.cf-vsl-spoiler-box) .vsb-foot[data-tone='error']{padding:10px 14px;border-radius:var(--card-radius,var(--radius,12px));text-align:left}
:where(.cf-vsl-spoiler-box) .vsb-foot[data-tone='error']{color:var(--danger);background:var(--danger-soft);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12))}
:where(.cf-vsl-spoiler-box) .vsb-brand{position:relative;z-index:2;margin:0;padding:24px 12px 18px;text-align:center;font-family:var(--font-display,inherit);font-weight:700;font-size:14px;line-height:1.2;letter-spacing:.16em;text-transform:uppercase;color:var(--band-ink,#ffffff)}
:where(.cf-vsl-spoiler-box) .vsb-board:not(:has(.vsb-brand)){padding-bottom:26px}
@media (max-width:560px){
.cf-vsl-spoiler-box{padding-top:18px}
:where(.cf-vsl-spoiler-box) .vsb-clip{width:156px}
:where(.cf-vsl-spoiler-box) .vsb-board{padding:32px 8px 0;border-radius:var(--card-radius,var(--radius,18px))}
:where(.cf-vsl-spoiler-box) .vsb-board:not(:has(.vsb-brand)){padding-bottom:18px}
:where(.cf-vsl-spoiler-box) .vsb-sheet-back{left:5px;right:5px;bottom:-7px}
:where(.cf-vsl-spoiler-box) .vsb-paper{padding:46px 18px 22px;box-shadow:var(--card-shadow,var(--shadow-md, 0 1px 2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.22), 0 4px 10px -2px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / 0.2)))}
:where(.cf-vsl-spoiler-box) .vsb-row{grid-template-columns:auto minmax(0,1fr);column-gap:12px;padding:14px 2px}
:where(.cf-vsl-spoiler-box) .vsb-time{grid-column:2;justify-self:start;margin-top:10px}
:where(.cf-vsl-spoiler-box) .vsb-box{width:30px;height:30px;border-radius:var(--card-radius,var(--radius,8px))}
:where(.cf-vsl-spoiler-box) .vsb-check{width:19px;height:19px}
:where(.cf-vsl-spoiler-box) .vsb-btn{gap:.5rem;padding:.875rem 1rem;min-height:4rem}
:where(.cf-vsl-spoiler-box) .vsb-brand{padding:20px 10px 14px;letter-spacing:.1em;color:var(--band-ink,#ffffff)}
}
@media (prefers-reduced-motion:reduce){
.cf-vsl-spoiler-box *,.cf-vsl-spoiler-box *::before,.cf-vsl-spoiler-box *::after{transition:none !important;animation:none !important}
}
`
pieces/hero/vsl-spoiler-box/specimen.tsx 33 lines
import * as React from 'react'
import { VslSpoilerBox } from '../vsl-spoiler-box'
import defaults from '../../studio-defaults.json'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
export default function VslSpoilerBoxSpecimen({ state = 'default' }: { state?: SpecimenState }) {
const sample = defaults.sample
const [plan, copy, launch] = sample.items
return (
<div>
<VslSpoilerBox
state={state}
title='Here’s what the'
highlight='presentation reveals'
subtitle='A clear plan for your first funnel.'
spoilers={[
{ title: 'Map your funnel', text: plan.detail },
{ title: 'Write your page copy', text: copy.detail },
{ title: 'Check before you launch', text: launch.detail },
]}
closing='See how it comes together.'
actionLabel='Back to the presentation'
note='Takes you straight back up to the video.'
brand={sample.name}
videoTarget='vsl'
onAction={() => true}
/>
</div>
)
}
| Name | Type | Details |
|---|---|---|
title OptionalVslSpoilerBox |
React.ReactNode |
Default 'Here’s what the'
|
highlight OptionalVslSpoilerBox |
React.ReactNode |
Default 'presentation reveals'
|
subtitle OptionalVslSpoilerBox |
React.ReactNode |
Default 'A clear plan for your first funnel.'
|
spoilers OptionalVslSpoilerBox |
Spoiler[] |
Default DEFAULT_SPOILERS
|
closing OptionalVslSpoilerBox |
React.ReactNode |
Default 'See how it comes together.'
|
actionLabel OptionalVslSpoilerBox |
string |
Default 'Back to the presentation'
|
note OptionalVslSpoilerBox |
React.ReactNode |
Default 'Takes you straight back up to the video.'
|
brand OptionalVslSpoilerBox |
React.ReactNode |
|
videoTarget OptionalVslSpoilerBox |
string |
Default 'vsl'
|
onAction OptionalVslSpoilerBox |
() => boolean | void |
Default onReturn
|
onReturn OptionalVslSpoilerBox |
() => boolean | void |
|
onSeek OptionalVslSpoilerBox |
(timestamp: string) => void |
|
seekLabel OptionalVslSpoilerBox |
string |
Default 'Watch this part at {timestamp}'
|
disabled OptionalVslSpoilerBox |
boolean |
Default false
|
disabledNote OptionalVslSpoilerBox |
React.ReactNode |
Default 'The presentation is still loading.'
|
loadingLabel OptionalVslSpoilerBox |
string |
|
successMessage OptionalVslSpoilerBox |
React.ReactNode |
|
errorMessage OptionalVslSpoilerBox |
React.ReactNode |
Default 'We couldn’t find the video on this page. Scroll up to watch it.'
|
state OptionalVslSpoilerBox |
VslSpoilerBoxState |
|
className OptionalVslSpoilerBox |
string |
|
style OptionalVslSpoilerBox |
React.CSSProperties |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-border--button-2-ink- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB