Waitlist Opt-in 4
Waitlist reveal hero: the product stands dimmed as a cut-out beside a speech card that makes one promise and takes one email.
Use it in a prompt
Use hero/waitlist-optin-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/hero/waitlist-optin-4.tsx. - Import it and pass your copy and images (Props tab):
import { WaitlistOptin4 } from "@/components/funneldna/hero/waitlist-optin-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/waitlist-optin-4/component.tsx 525 lines
// layout: presenter-cutout
// Waitlist reveal hero: the product stands dimmed as a cut-out beside a speech card that makes one promise and takes one email.
// After joining, the shot brightens a step and the visitor's real place in line rolls in, with perks and a link to move up the line.
import * as React from 'react'
import { CalendarDays, Check, CircleAlert, Copy, Loader2, LockKeyhole, ShieldCheck } from 'lucide-react'
export type WaitlistOptin4Result = {
position?: number | string // the visitor’s place in line from your waitlist API; never invented
referralUrl?: string // their personal share link; the “Move up the line” panel shows only with it
email?: string // the address that joined; defaults to the one typed
}
export type WaitlistOptin4State = 'default' | 'hover' | 'active' | 'disabled' | 'error' | 'success'
export type WaitlistOptin4Props = {
productName?: string // fills {product} in the lead and the image alt
headline?: string // the one promise
highlight?: string // phrase inside the headline that gets the marker stroke
lead?: React.ReactNode // a string may use {product}
aside?: React.ReactNode // italic aside in the founder’s voice, under the lead
launchDate?: string // shown only when supplied; never invented
launchLabel?: string // template with {date}
riskLine?: string // risk reversal that leads into the form
emailLabel?: string
emailPlaceholder?: string
label?: string // button label
price?: string // launch price on the button’s second line; hidden when empty
priceLine?: string // template with {price}
loadingLabel?: string // button label while onSubmit’s promise is pending
note?: string // one reassurance line under the button
invalidEmail?: string
submitError?: string // shown when onSubmit throws or its promise rejects
productImage?: string // slot product: cut-out product shot on a transparent background
productImageAlt?: string // a string may use {product}
joinedTitle?: string // heading after joining, template with {position}
positionPrefix?: string // put before a numeric position
joinedFallback?: string // heading when no position came back
joinedLead?: string // template with {email}
joinedLeadNoEmail?: string
perksTitle?: string
perks?: string[] // what waitlist members get; only what is true
referralTitle?: string
referralRule?: string // the supplied rule for moving up, e.g. places per friend
referralLabel?: string
referralPlaceholder?: string
copyLabel?: string
copiedLabel?: string
result?: WaitlistOptin4Result // controlled: pass the API response to show the joined view
defaultEmail?: string
// Return (or resolve with) the waitlist API response to show the joined view; return nothing to handle it yourself.
onSubmit?: (values: { email: string }) => void | WaitlistOptin4Result | Promise<void | WaitlistOptin4Result>
onCopyLink?: (url: string) => void
state?: WaitlistOptin4State
className?: string
}
export function WaitlistOptin4(props: WaitlistOptin4Props) {
const {
productName = 'the first release',
headline = 'Get it before anyone else.',
highlight = 'before anyone else',
lead = 'The first batch goes to the waitlist first. Add your email to hold your place in line and see the full reveal before launch day.',
aside,
launchDate,
launchLabel = 'Doors open {date}',
riskLine = 'Free to join. Leave the list anytime.',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
label = 'Save my place in line',
price,
priceLine = '{price} at launch',
loadingLabel = 'Saving your place…',
note = 'We respect your inbox. Unsubscribe anytime.',
invalidEmail = 'Enter a valid email, like you@example.com.',
submitError = 'We couldn’t save your place just now. Please try again.',
productImage,
productImageAlt = 'A first look at {product}',
joinedTitle = 'You’re {position} in line.',
positionPrefix = '#',
joinedFallback = 'You’re on the list.',
joinedLead = 'Watch {email} for your launch-day email.',
joinedLeadNoEmail = 'Watch your inbox for your launch-day email.',
perksTitle = 'Holding your place gets you:',
perks = [],
referralTitle = 'Move up the line',
referralRule,
referralLabel = 'Your share link',
referralPlaceholder = 'https://example.com/your-link',
copyLabel = 'Copy link',
copiedLabel = 'Copied',
result,
defaultEmail = '',
onSubmit,
onCopyLink,
state = 'default',
className,
} = props
const uid = React.useId()
const titleId = `${uid}-title`
const inputId = `${uid}-email`
const msgId = `${uid}-msg`
const noteId = `${uid}-note`
const linkId = `${uid}-link`
const inputRef = React.useRef<HTMLInputElement>(null)
const linkRef = React.useRef<HTMLInputElement>(null)
const headingRef = React.useRef<HTMLHeadingElement>(null)
const mounted = React.useRef(true)
const announce = React.useRef(false)
const copyTimer = React.useRef<number | undefined>(undefined)
const [email, setEmail] = React.useState(defaultEmail)
const [touched, setTouched] = React.useState(state === 'error')
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const [joined, setJoined] = React.useState<WaitlistOptin4Result | null>(null)
const [copied, setCopied] = React.useState(false)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
window.clearTimeout(copyTimer.current)
}
}, [])
React.useEffect(() => {
setEmail(defaultEmail)
setTouched(state === 'error')
setFailed(false)
setBusy(false)
setJoined(null)
setCopied(false)
}, [state, defaultEmail])
React.useEffect(() => {
if (joined && announce.current) {
announce.current = false
headingRef.current?.focus({ preventScroll: true })
}
}, [joined])
const disabled = state === 'disabled'
const value = email.trim()
const isValid = EMAIL_PATTERN.test(value)
const showError = touched && !isValid
const message = showError ? invalidEmail : failed ? submitError : ''
const view: WaitlistOptin4Result | null = result ? result : joined ? joined : state === 'success' ? {} : null
const viewEmail = (view?.email || value || '').trim()
const posText = view ? formatPosition(view.position, positionPrefix) : ''
const cleanPerks = perks.filter((perk) => perk && perk.trim())
const priceText = price ? fill(priceLine, { price }) : ''
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled || busy) return
setTouched(true)
setFailed(false)
if (!isValid) {
inputRef.current?.focus()
return
}
const typed = value
let out: ReturnType<NonNullable<WaitlistOptin4Props['onSubmit']>>
try {
out = onSubmit?.({ email: typed })
} catch {
setFailed(true)
return
}
if (out && typeof (out as Promise<unknown>).then === 'function') {
setBusy(true)
;(out as Promise<void | WaitlistOptin4Result>).then(
(response) => {
if (!mounted.current) return
setBusy(false)
const data = response && typeof response === 'object' ? response : {}
announce.current = true
setJoined({ ...data, email: data.email || typed })
},
() => {
if (!mounted.current) return
setBusy(false)
setFailed(true)
},
)
} else if (out && typeof out === 'object') {
const data = out as WaitlistOptin4Result
announce.current = true
setJoined({ ...data, email: data.email || typed })
}
}
function copyLink() {
const url = view?.referralUrl
if (!url) return
linkRef.current?.select()
onCopyLink?.(url)
const done = () => {
if (!mounted.current) return
setCopied(true)
window.clearTimeout(copyTimer.current)
copyTimer.current = window.setTimeout(() => {
if (mounted.current) setCopied(false)
}, 2000)
}
try {
const job = typeof navigator !== 'undefined' && navigator.clipboard ? navigator.clipboard.writeText(url) : null
if (job) job.then(done, () => undefined)
} catch {
// the link stays selected so it can be copied by hand
}
}
const rootClass = ['cf-waitlist-optin-4', productImage ? '' : 'is-noimage', view ? 'is-joined' : '', className].filter(Boolean).join(' ')
const buttonClass = ['wo-btn', state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : '', busy ? 'is-busy' : ''].filter(Boolean).join(' ')
const fieldClass = ['wo-field', showError ? 'is-error' : ''].filter(Boolean).join(' ')
const describedBy = [message ? msgId : '', note ? noteId : ''].filter(Boolean).join(' ') || undefined
const [before, after] = splitOnce(joinedTitle, '{position}')
return (
<section className={rootClass} data-state={state} aria-labelledby={titleId}>
<style>{CSS}</style>
<div className='wo-blocks' aria-hidden='true'>
<span className='wo-wedge' />
</div>
<div className='wo-inner'>
<div className='wo-card'>
{view ? (
<div className='wo-joined' aria-live='polite'>
<h1 ref={headingRef} tabIndex={-1} id={titleId} className='wo-title wo-joined-title'>
{posText ? (
<>
{before}
<span className='wo-pos'>
<span className='wo-sr'>{posText}</span>
<span className='wo-roll' aria-hidden='true'>
{Array.from(posText).map((ch, index) => (
<span key={index} className='wo-roll-ch'>
<span style={{ animationDelay: `${Math.min(0.12 + index * 0.06, 0.48)}s` }}>{ch}</span>
</span>
))}
</span>
</span>
{after}
</>
) : (
joinedFallback
)}
</h1>
<p className='wo-joined-lead'>
{viewEmail ? fillNode(joinedLead, { email: <strong className='wo-email'>{viewEmail}</strong> }) : joinedLeadNoEmail}
</p>
{cleanPerks.length > 0 && (
<div className='wo-perks'>
{perksTitle && <p className='wo-perks-title'>{perksTitle}</p>}
<ul className='wo-perk-list'>
{cleanPerks.map((perk, index) => (
<li key={`${perk}-${index}`}>
<span className='wo-badge' aria-hidden='true'>
<Check width={14} height={14} strokeWidth={3} />
</span>
<span>{perk}</span>
</li>
))}
</ul>
</div>
)}
{view.referralUrl && (
<div className='wo-ref'>
<h2 className='wo-ref-title'>{referralTitle}</h2>
{referralRule && <p className='wo-ref-rule'>{referralRule}</p>}
<label className='wo-label' htmlFor={linkId}>
{referralLabel}
</label>
<div className='wo-ref-row'>
<input
id={linkId}
ref={linkRef}
className='wo-input wo-link'
type='url'
readOnly
value={view.referralUrl}
placeholder={referralPlaceholder}
onFocus={(event) => event.currentTarget.select()}
/>
<button type='button' className='wo-btn2' onClick={copyLink}>
{copied ? <Check strokeWidth={2.5} aria-hidden='true' /> : <Copy strokeWidth={2.5} aria-hidden='true' />}
<span>{copied ? copiedLabel : copyLabel}</span>
</button>
</div>
<span className='wo-sr' aria-live='polite'>
{copied ? copiedLabel : ''}
</span>
</div>
)}
</div>
) : (
<>
<h1 id={titleId} className='wo-title'>
{markHeadline(headline, highlight)}
</h1>
{lead && <p className='wo-lead'>{typeof lead === 'string' ? fill(lead, { product: productName }) : lead}</p>}
{aside && <p className='wo-aside'>{aside}</p>}
{launchDate && (
<p className='wo-date'>
<CalendarDays className='wo-ico' strokeWidth={2.5} aria-hidden='true' />
{fill(launchLabel, { date: launchDate })}
</p>
)}
<form className='wo-form' noValidate onSubmit={handleSubmit} aria-labelledby={titleId} aria-busy={busy || undefined}>
{riskLine && (
<p className='wo-risk'>
<ShieldCheck className='wo-ico' strokeWidth={2.5} aria-hidden='true' />
{riskLine}
</p>
)}
<label className='wo-label' htmlFor={inputId}>
{emailLabel}
</label>
<div className={fieldClass}>
<input
ref={inputRef}
id={inputId}
className='wo-input'
type='email'
name='email'
inputMode='email'
autoComplete='email'
required
placeholder={emailPlaceholder}
value={email}
disabled={disabled}
aria-invalid={showError || undefined}
aria-describedby={describedBy}
onChange={(event) => {
setEmail(event.target.value)
if (failed) setFailed(false)
}}
onBlur={() => {
if (value) setTouched(true)
}}
/>
{isValid && !disabled && <Check className='wo-valid' strokeWidth={2.5} aria-hidden='true' />}
</div>
{message && (
<p className='wo-msg' id={msgId} role='alert'>
<CircleAlert className='wo-ico' strokeWidth={2.5} aria-hidden='true' />
{message}
</p>
)}
<button type='submit' className={buttonClass} disabled={disabled}>
<span className='wo-btn-main'>
{busy && <Loader2 className='wo-spin' strokeWidth={2.5} aria-hidden='true' />}
{busy ? loadingLabel : label}
</span>
{priceText && <span className='wo-btn-sub'>{priceText}</span>}
</button>
{note && (
<p className='wo-note' id={noteId}>
<LockKeyhole className='wo-ico' strokeWidth={2.5} aria-hidden='true' />
{note}
</p>
)}
</form>
</>
)}
</div>
{productImage && (
<figure className={view ? 'wo-shot is-joined' : 'wo-shot'}>
<span className='wo-frame'>
<img src={productImage} alt={fill(productImageAlt, { product: productName })} width={900} height={1000} decoding='async' />
</span>
</figure>
)}
</div>
</section>
)
}
export default WaitlistOptin4
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/
function fill(template: string, values: Record<string, string>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in values ? values[key] : match))
}
function fillNode(template: string, values: Record<string, React.ReactNode>): React.ReactNode {
return template.split(/(\{\w+\})/g).map((part, index) => {
const hit = /^\{(\w+)\}$/.exec(part)
if (hit && hit[1] in values) return <React.Fragment key={index}>{values[hit[1]]}</React.Fragment>
return part ? <React.Fragment key={index}>{part}</React.Fragment> : null
})
}
function splitOnce(text: string, key: string): [string, string] {
const at = text.indexOf(key)
if (at < 0) return [text, '']
return [text.slice(0, at), text.slice(at + key.length)]
}
function markHeadline(headline: string, highlight?: string): React.ReactNode {
if (!highlight) return headline
const at = headline.indexOf(highlight)
if (at < 0) return headline
return (
<>
{headline.slice(0, at)}
<span className='wo-mark'>{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
}
function formatPosition(position: number | string | undefined, prefix: string) {
if (position === undefined || position === null || position === '') return ''
if (typeof position === 'number') {
if (!Number.isFinite(position) || position <= 0) return ''
return prefix + Math.round(position).toLocaleString('en-US')
}
const text = String(position).trim()
if (!text) return ''
return /^\d[\d,.\s]*$/.test(text) ? prefix + text : text
}
const R = '.cf-waitlist-optin-4'
const CSS = `
${R}{--wo-foot:clamp(56px,6vw,88px);--wo-below:clamp(32px,4vw,56px);--wo-marker:color-mix(in oklch,var(--accent-fill,var(--accent,#2563eb)) 30%,var(--card,#ffffff));--wo-gutter:clamp(16px,5vw,48px);--wo-sh:var(--shadow,oklch(0.22 0.03 260));--wo-line:var(--card-border,oklch(from var(--ink,#101828) l c h / 0.12));position:relative;isolation:isolate;z-index:1;overflow-x:clip;background:var(--surface,#ffffff);color:var(--ink,#101828);font-family:var(--font-body,system-ui,sans-serif);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .wo-blocks{position:absolute;inset:0 0 var(--wo-foot) 0;z-index:-1;overflow:hidden;background:var(--band,#1b2a4a)}
${R} .wo-wedge{position:absolute;inset:0;background:var(--accent-fill,var(--accent,#2563eb));clip-path:polygon(61% 0,100% 0,100% 100%,47% 100%)}
${R} .wo-inner{position:relative;display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,0.88fr);gap:clamp(32px,5vw,72px);align-items:start;max-width:calc(1120px + 2 * var(--wo-gutter));margin-inline:auto;padding:clamp(56px,8vw,112px) var(--wo-gutter) calc(var(--wo-foot) + var(--wo-below))}
${R} .wo-card{position:relative;z-index:2;min-width:0;background:var(--card,#ffffff);color:var(--ink,#101828);border:1px solid var(--wo-line);border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--wo-sh) l c h / 0.22),0 12px 24px -8px oklch(from var(--wo-sh) l c h / 0.32)));padding:clamp(20px,3vw,40px)}
${R} .wo-card::after{content:'';position:absolute;top:clamp(96px,24%,180px);right:-13px;width:24px;height:24px;background:var(--card,#ffffff);border-top:1px solid var(--wo-line);border-right:1px solid var(--wo-line);border-radius:0 5px 0 0;transform:rotate(45deg)}
${R} .wo-title{margin:0 0 clamp(20px,2.2vw,32px);font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2.5rem,4.6vw,4.25rem);line-height:1.04;color:var(--ink,#101828);text-wrap:balance}
${R} .wo-title:focus{outline:none}
${R} .wo-mark{color:inherit;padding:0 0.08em;margin:0 -0.04em;background-image:linear-gradient(transparent 44%,var(--wo-marker) 44%,var(--wo-marker) 90%,transparent 90%);background-repeat:no-repeat;background-size:100% 100%;-webkit-box-decoration-break:clone;box-decoration-break:clone}
${R} .wo-lead{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
${R} .wo-aside{margin:12px 0 0;font-style:italic;color:var(--muted,#475467);text-wrap:pretty}
${R} .wo-date{margin:20px 0 0;font-size:0.9375rem;line-height:1.4;font-weight:700}
${R} .wo-ico{display:inline-block;width:1.15em;height:1.15em;vertical-align:-0.2em;margin-inline-end:0.45em}
${R} .wo-date .wo-ico{color:var(--accent,#2563eb)}
${R} .wo-form{margin-top:clamp(24px,2.6vw,32px)}
${R} .wo-risk{margin:0 0 16px;font-weight:800;line-height:1.35;text-wrap:pretty}
${R} .wo-risk .wo-ico{color:var(--success,#15803d)}
${R} .wo-label{display:block;margin:0 0 8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink,#101828))}
${R} .wo-field{position:relative}
${R} .wo-input{display:block;width:100%;height:56px;margin:0;padding:0 48px 0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#101828) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field,#ffffff);color:var(--field-ink,#101828);font:inherit;font-size:1.0625rem;font-weight:500;box-shadow:inset 0 1px 2px oklch(from var(--wo-sh) l c h / 0.08)}
${R} .wo-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#ffffff));opacity:1}
${R} .wo-input:focus{outline:none;border-color:var(--field-focus,var(--accent,#2563eb));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2563eb)) l c h / 0.35)}
${R} .wo-field.is-error .wo-input{border-color:var(--danger,#b91c1c)}
${R} .wo-field.is-error .wo-input:focus{box-shadow:0 0 0 3px oklch(from var(--danger,#b91c1c) l c h / 0.3)}
${R} .wo-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--field,#ffffff))}
${R} .wo-valid{position:absolute;top:50%;right:16px;width:20px;height:20px;margin-top:-10px;color:var(--success,#15803d);pointer-events:none}
${R} .wo-msg{margin:8px 0 0;color:var(--danger,#b91c1c);font-size:0.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${R} .wo-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-height:64px;margin:12px 0 0;padding:10px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink,#ffffff));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-align:center;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,#d92d20)) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--wo-sh) l c h / 0.3),0 8px 16px -6px oklch(from var(--wo-sh) l c h / 0.45))}
${R} .wo-btn:hover:not(:disabled),${R} .wo-btn.is-hover{background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - 0.01) c h),oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - 0.07) c h));transform:translateY(-1px);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l + 0.12) c h / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - 0.2) c h),0 1px 2px oklch(from var(--wo-sh) l c h / 0.34),0 10px 18px -6px oklch(from var(--wo-sh) l c h / 0.52))}
${R} .wo-btn:active:not(:disabled),${R} .wo-btn.is-active{transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--button-bg-2,var(--cta-2,#b42318)) calc(l - 0.12) c h / 0.6),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d92d20)) calc(l - 0.16) c h),0 1px 1px oklch(from var(--wo-sh) l c h / 0.25)}
${R} .wo-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px}
${R} .wo-btn:disabled{background:var(--button-2-bg,var(--secondary,#e9edf3));color:var(--button-2-ink,var(--secondary-ink,#101828));box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(from var(--wo-sh) l c h / 0.18)));text-shadow:none;cursor:not-allowed;transform:none}
${R} .wo-btn.is-busy{cursor:progress}
${R} .wo-btn-main{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-wrap:balance}
${R} .wo-btn-sub{font-family:var(--font-body,inherit);font-size:0.9375rem;font-weight:600;line-height:1.3;text-transform:none;text-wrap:pretty}
${R} .wo-spin{width:20px;height:20px;flex:none}
${R} .wo-note{margin:12px 0 0;text-align:center;color:var(--muted,#475467);font-size:0.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .wo-joined-title{font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.12}
${R} .wo-pos{display:inline-block;font-size:1.55em;line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--accent,#2563eb);white-space:nowrap}
${R} .wo-roll-ch{display:inline-block;clip-path:inset(-0.25em -0.1em -0.14em -0.1em)}
${R} .wo-roll-ch>span{display:inline-block}
${R} .wo-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
${R} .wo-joined-lead{margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
${R} .wo-email{font-weight:800;overflow-wrap:anywhere}
${R} .wo-perks{margin-top:24px}
${R} .wo-perks-title{margin:0 0 12px;font-weight:800;line-height:1.35}
${R} .wo-perk-list{display:grid;gap:12px;margin:0;padding:0;list-style:none}
${R} .wo-perk-list li{display:flex;align-items:flex-start;gap:12px;line-height:1.45;text-wrap:pretty}
${R} .wo-badge{display:inline-grid;place-items:center;flex:none;width:24px;height:24px;margin-top:1px;border-radius:999px;background:var(--success,#15803d);color:var(--wo-badge-ink,#ffffff)}
${R} .wo-ref{margin-top:24px;padding:clamp(16px,2vw,24px);border-radius:10px;background:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#ffffff))}
${R} .wo-ref-title{margin:0 0 8px;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);letter-spacing:-0.01em;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
${R} .wo-ref-rule{margin:0 0 16px;text-wrap:pretty}
${R} .wo-ref-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
${R} .wo-link{padding-right:16px;font-size:1rem;text-overflow:ellipsis}
${R} .wo-btn2{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:56px;padding:0 20px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary,#e9edf3));color:var(--button-2-ink,var(--secondary-ink,#101828));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);font-size:1.0625rem;line-height:1.15;white-space:nowrap;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 2px oklch(from var(--wo-sh) l c h / 0.18)))}
${R} .wo-btn2 svg{width:20px;height:20px;flex:none}
${R} .wo-btn2:hover{background:oklch(from var(--button-2-bg,var(--secondary,#e9edf3)) calc(l - 0.04) c h)}
${R} .wo-btn2:active{transform:translateY(1px)}
${R} .wo-btn2:focus-visible{outline:3px solid var(--field-focus,var(--accent,#2563eb));outline-offset:3px}
${R} .wo-shot{position:relative;z-index:1;align-self:stretch;min-height:440px;margin:0}
${R} .wo-frame{position:absolute;top:-6%;left:-8%;right:-18%;bottom:calc(-1 * (var(--wo-below) + var(--wo-foot) * 0.62));display:block}
${R} .wo-frame img{display:block;width:100%;height:100%;object-fit:contain;object-position:50% 100%;filter:brightness(0.58) saturate(0.8) contrast(1.05) drop-shadow(0 2px 3px oklch(from var(--wo-sh) l c h / 0.45)) drop-shadow(0 16px 18px oklch(from var(--wo-sh) l c h / 0.3))}
${R} .wo-shot.is-joined .wo-frame img{filter:brightness(1) saturate(1) contrast(1) drop-shadow(0 2px 3px oklch(from var(--wo-sh) l c h / 0.45)) drop-shadow(0 16px 18px oklch(from var(--wo-sh) l c h / 0.3))}
${R}.is-noimage .wo-inner{grid-template-columns:minmax(0,46rem);justify-content:center}
${R}.is-noimage .wo-card::after{display:none}
@media (prefers-reduced-motion:no-preference){
${R} .wo-btn,${R} .wo-btn2,${R} .wo-input{transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}
${R} .wo-frame img{transition:filter 1.2s cubic-bezier(.2,.7,.2,1)}
${R} .wo-spin{animation:wo-spin .8s linear infinite}
${R} .wo-roll-ch>span{animation:wo-roll .7s cubic-bezier(.2,.7,.2,1) both}
${R} .wo-joined>*{animation:wo-rise .45s cubic-bezier(.2,.7,.2,1) both}
${R} .wo-joined>*:nth-child(2){animation-delay:.07s}
${R} .wo-joined>*:nth-child(3){animation-delay:.14s}
${R} .wo-joined>*:nth-child(4){animation-delay:.21s}
}
@keyframes wo-roll{from{transform:translateY(105%)}to{transform:none}}
@keyframes wo-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes wo-spin{to{transform:rotate(360deg)}}
@media (max-width:860px){
${R}{--wo-foot:64px}
${R} .wo-wedge{clip-path:polygon(0 0,100% 0,100% 230px,0 320px)}
${R} .wo-inner{grid-template-columns:minmax(0,1fr);gap:0;padding:0 var(--wo-gutter) 24px}
${R} .wo-shot{order:-1;align-self:auto;height:clamp(260px,64vw,380px);min-height:0;margin:0 calc(-1 * var(--wo-gutter));overflow:hidden}
${R} .wo-frame{inset:16px 0 0 0}
${R} .wo-frame img{object-fit:cover;object-position:50% 12%}
${R} .wo-card{margin-top:-64px}
${R} .wo-card::after{top:-12px;right:auto;left:50%;border-right:0;border-left:1px solid var(--wo-line);border-radius:5px 0 0 0;transform:translateX(-50%) rotate(45deg)}
${R}.is-noimage .wo-inner{grid-template-columns:minmax(0,1fr);padding-top:clamp(40px,10vw,56px)}
${R}.is-noimage .wo-card{margin-top:0}
}
@media (max-width:520px){
${R} .wo-ref-row{grid-template-columns:minmax(0,1fr)}
}
`
pieces/hero/waitlist-optin-4/specimen.tsx 44 lines
import __studioImage7d700723 from "../assets/d4ad6afad01ed509.webp";
// Specimen: the fictional Northpaw GPS collar waitlist, before and after a visitor joins.
import * as React from 'react'
import { WaitlistOptin4, type WaitlistOptin4State } from '../waitlist-optin-4'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error', 'success']
export default function WaitlistOptin4Specimen({ state = 'default' }: { state?: WaitlistOptin4State }) {
const joined = state === 'success'
return (
<WaitlistOptin4
state={state}
productName='Northpaw'
headline='Never wonder where your dog went again.'
highlight='where your dog went'
lead='Northpaw is the GPS collar that buzzes your phone the second your dog slips the yard. The finished design stays under wraps until launch, and the waitlist sees it first.'
aside='(I built the first one after our beagle, Juno, found a gap in the fence. Twice.)'
launchDate='March 2027'
launchLabel='First collars ship {date}'
riskLine='Free to join. Leave the list anytime.'
emailLabel={defaults.sample.fields[1]?.label ?? 'Email address'}
label='Save my place in line'
price='$89'
priceLine='Founding price {price} at launch'
note={defaults.sample.registration.privacy}
productImageAlt='{product} collar on a beagle, kept in shadow until launch'
perksTitle='Holding your place gets you:'
perks={[
'First pick from the founding batch of collars',
'The $89 founding price, held for you at launch',
'The full reveal a week before everyone else',
]}
referralRule='Every friend who joins with your link moves you up 25 places.'
defaultEmail={state === 'error' ? 'dana@northpaw' : joined ? 'dana@example.com' : ''}
result={joined ? { position: 1284, referralUrl: 'https://northpaw.example/line?ref=dana-r' } : undefined}
productImage={slot(
'product',
__studioImage7d700723,
)}
/>
)
}
| Name | Type | Details |
|---|---|---|
productName OptionalWaitlistOptin4 |
string |
|
headline OptionalWaitlistOptin4 |
string |
|
highlight OptionalWaitlistOptin4 |
string |
|
lead OptionalWaitlistOptin4 |
React.ReactNode |
|
aside OptionalWaitlistOptin4 |
React.ReactNode |
|
launchDate OptionalWaitlistOptin4 |
string |
|
launchLabel OptionalWaitlistOptin4 |
string |
|
riskLine OptionalWaitlistOptin4 |
string |
|
emailLabel OptionalWaitlistOptin4 |
string |
|
emailPlaceholder OptionalWaitlistOptin4 |
string |
|
label OptionalWaitlistOptin4 |
string |
|
price OptionalWaitlistOptin4 |
string |
|
priceLine OptionalWaitlistOptin4 |
string |
|
loadingLabel OptionalWaitlistOptin4 |
string |
|
note OptionalWaitlistOptin4 |
string |
|
invalidEmail OptionalWaitlistOptin4 |
string |
|
submitError OptionalWaitlistOptin4 |
string |
|
productImage OptionalWaitlistOptin4 |
string |
|
productImageAlt OptionalWaitlistOptin4 |
string |
|
joinedTitle OptionalWaitlistOptin4 |
string |
|
positionPrefix OptionalWaitlistOptin4 |
string |
|
joinedFallback OptionalWaitlistOptin4 |
string |
|
joinedLead OptionalWaitlistOptin4 |
string |
|
joinedLeadNoEmail OptionalWaitlistOptin4 |
string |
|
perksTitle OptionalWaitlistOptin4 |
string |
|
perks OptionalWaitlistOptin4 |
string[] |
|
referralTitle OptionalWaitlistOptin4 |
string |
|
referralRule OptionalWaitlistOptin4 |
string |
|
referralLabel OptionalWaitlistOptin4 |
string |
|
referralPlaceholder OptionalWaitlistOptin4 |
string |
|
copyLabel OptionalWaitlistOptin4 |
string |
|
copiedLabel OptionalWaitlistOptin4 |
string |
|
result OptionalWaitlistOptin4 |
WaitlistOptin4Result |
|
defaultEmail OptionalWaitlistOptin4 |
string |
|
onSubmit OptionalWaitlistOptin4 |
(values: { email: string }) => void | WaitlistOptin4Result | Promise<void | WaitlistOptin4Result> |
|
onCopyLink OptionalWaitlistOptin4 |
(url: string) => void |
|
state OptionalWaitlistOptin4 |
WaitlistOptin4State |
|
className OptionalWaitlistOptin4 |
string |
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--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--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d4ad6afad01ed509.webp
image/webp · 86.2 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB