Results Gate 4
Two-step results gate on a dark stage. A short numbered path shows what the results reveal and leads down to one big button sitting straight on the band. One click lifts it into a card with the first-name and email fields, so the visitor makes a small commitment before the ask. No score is shown before submit.
Use it in a prompt
Use forms/results-gate-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/forms/results-gate-4.tsx. - Import it and pass your copy and images (Props tab):
import { ResultsGate4 } from "@/components/funneldna/forms/results-gate-4"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/results-gate-4/component.tsx 510 lines
// layout: path-to-action
// Two-step results gate on a dark stage. A short numbered path shows what the results reveal and leads down to one big button sitting straight on the band. One click lifts it into a card with the first-name and email fields, so the visitor makes a small commitment before the ask. No score is shown before submit.
import * as React from 'react'
import { AlertCircle, Loader2, Lock, Mail, User } from 'lucide-react'
import { FX_HOST, Glow, Spot } from '../fx/fx'
import chart from '../fx/spots/chart'
import checklist from '../fx/spots/checklist'
import rocket from '../fx/spots/rocket'
export type ResultsGate4Stop = {
/** What this part of the results tells the visitor. It is a benefit, not a result. */
title: string
detail?: string
/** Imported fx spot illustration, e.g. `import chart from '../fx/spots/chart'`. */
spot?: string
}
export type ResultsGate4Values = { firstName: string; email: string }
export type ResultsGate4State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ResultsGate4Props = {
/** Big promise at the top of the band. */
headline?: string
/** One continuous phrase inside the headline, set in the lit accent colour. */
highlight?: string
lead?: string
/** Results report or product art on a transparent background, shown above the headline (slot: product). */
reportImage?: string
/** Alt text for reportImage. Empty means decorative. */
reportImageAlt?: string
/** Heading over the numbered path, e.g. 'Three things your results tell you'. */
pathTitle?: string
/** One to four stops on the path that leads to the button. */
stops?: ResultsGate4Stop[]
/** Step one: the easy first click that opens the fields. */
openLabel?: string
/** One short line under the first button. */
reassurance?: string
/** Heading that appears with the fields after the first click. */
formTitle?: string
firstNameLabel?: string
firstNamePlaceholder?: string
emailLabel?: string
emailPlaceholder?: string
/** Step two: the submit button. It stays disabled until both fields are valid. */
submitLabel?: string
loadingLabel?: string
/** Privacy line under the submit button. */
privacy?: string
nameError?: string
emailError?: string
/** Shown when onSubmit rejects. */
error?: string
headingLevel?: 'h1' | 'h2'
state?: ResultsGate4State
/** Called when the first button opens the fields. */
onOpen?: () => void
/** Receives validated values. A returned promise shows the loader; a rejection shows the error alert. */
onSubmit?: (values: ResultsGate4Values) => void | Promise<void>
className?: string
style?: React.CSSProperties
}
const DEFAULT_STOPS: ResultsGate4Stop[] = [
{ title: 'Where you stand right now', detail: 'See what your answers add up to.', spot: chart },
{ title: 'What’s holding you back', detail: 'The one gap your answers point to.', spot: checklist },
{ title: 'Your next best move', detail: 'A clear first step, picked from your answers.', spot: rocket },
]
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]{2,}$/
export function ResultsGate4({
headline = 'Your results are ready',
highlight = 'are ready',
lead = 'Your answers are in. One click, two quick fields, and your personal results are yours.',
reportImage,
reportImageAlt = '',
pathTitle = 'Three things your results tell you',
stops = DEFAULT_STOPS,
openLabel = 'Show me my results',
reassurance = 'Free · Two quick fields · No card needed',
formTitle = 'Where should we send your results?',
firstNameLabel = 'First name',
firstNamePlaceholder = 'Jane',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
submitLabel = 'Send me my results',
loadingLabel = 'Opening your results…',
privacy = 'We respect your inbox. Unsubscribe anytime.',
nameError = 'Add your first name so we know who the results are for.',
emailError = 'Enter a valid email, like you@example.com.',
error = 'We couldn’t open your results just now. Please try again.',
headingLevel = 'h2',
state = 'default',
onOpen,
onSubmit,
className,
style,
}: ResultsGate4Props) {
const uid = React.useId().replace(/:/g, '')
const ids = {
title: `${uid}-t`,
path: `${uid}-p`,
form: `${uid}-f`,
name: `${uid}-n`,
email: `${uid}-e`,
nameErr: `${uid}-ne`,
emailErr: `${uid}-ee`,
note: `${uid}-x`,
}
const [open, setOpen] = React.useState(state === 'error')
const [values, setValues] = React.useState<ResultsGate4Values>({ firstName: '', email: '' })
const [touched, setTouched] = React.useState({ firstName: false, email: false })
const [dirty, setDirty] = React.useState(false)
const [status, setStatus] = React.useState<'idle' | 'loading' | 'failed'>('idle')
const nameRef = React.useRef<HTMLInputElement>(null)
const emailRef = React.useRef<HTMLInputElement>(null)
const wantFocus = React.useRef(false)
const alive = React.useRef(true)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
React.useEffect(() => {
setOpen(state === 'error')
setTouched({ firstName: false, email: false })
setDirty(false)
setStatus('idle')
}, [state])
React.useEffect(() => {
if (open && wantFocus.current) {
wantFocus.current = false
nameRef.current?.focus()
}
}, [open])
const disabled = state === 'disabled'
const loading = status === 'loading'
const forcedError = state === 'error' && !dirty
const nameOk = values.firstName.trim() !== ''
const emailOk = EMAIL.test(values.email.trim())
const ready = nameOk && emailOk
const nameErr = !nameOk && (touched.firstName || forcedError) ? nameError : undefined
const emailErr = !emailOk && (touched.email || forcedError) ? emailError : undefined
const force = !open && !disabled && (state === 'hover' || state === 'active') ? state : undefined
const H = headingLevel
const Sub = headingLevel === 'h1' ? 'h2' : 'h3'
const list = stops.slice(0, 4)
function handleOpen() {
if (disabled) return
wantFocus.current = true
setOpen(true)
onOpen?.()
}
const update = (key: keyof ResultsGate4Values) => (event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value
setDirty(true)
setValues((prev) => ({ ...prev, [key]: value }))
if (status === 'failed') setStatus('idle')
}
const blur = (key: keyof ResultsGate4Values) => () => {
setTouched((prev) => (prev[key] ? prev : { ...prev, [key]: true }))
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (!open || disabled || loading) return
if (!ready) {
setTouched({ firstName: true, email: true })
;(nameOk ? emailRef : nameRef).current?.focus()
return
}
try {
const result = onSubmit?.({ firstName: values.firstName.trim(), email: values.email.trim() })
if (result && typeof (result as PromiseLike<void>).then === 'function') {
setStatus('loading')
await result
if (alive.current) setStatus('idle')
}
} catch {
if (alive.current) setStatus('failed')
}
}
const rootClass = ['cf-results-gate-4', open ? 'is-open' : '', force ? `is-${force}` : '', className]
.filter(Boolean)
.join(' ')
return (
<section className={rootClass} style={{ ...FX_HOST, ...style }} aria-labelledby={ids.title}>
<style>{CSS}</style>
<Glow />
<div className='rg4-inner'>
<header className='rg4-head'>
{reportImage ? (
<img className='rg4-art' src={reportImage} alt={reportImageAlt} width={296} height={296} decoding='async' />
) : null}
<H id={ids.title} className='rg4-title'>
{emphasize(headline, highlight)}
</H>
{lead ? <p className='rg4-lead'>{lead}</p> : null}
</header>
{list.length ? (
<div className='rg4-trail'>
{pathTitle ? (
<Sub id={ids.path} className='rg4-path-title'>
{pathTitle}
</Sub>
) : null}
<ol
className='rg4-path'
aria-labelledby={pathTitle ? ids.path : undefined}
style={{ '--n': list.length } as React.CSSProperties}
>
{list.map((stop, i) => (
<li className='rg4-stop' key={`${i}-${stop.title}`} style={{ '--i': i } as React.CSSProperties}>
<span className='rg4-node' aria-hidden='true'>
{stop.spot ? <Spot src={stop.spot} size={72} shade='band' light='band-ink' /> : <span className='rg4-dot' />}
</span>
<div className='rg4-copy'>
<p className='rg4-stop-title'>
<span className='rg4-num'>{i + 1}.</span>
{stop.title}
</p>
{stop.detail ? <p className='rg4-stop-detail'>{stop.detail}</p> : null}
</div>
</li>
))}
</ol>
<span className='rg4-drop' aria-hidden='true' />
</div>
) : null}
<form
className='rg4-panel'
noValidate
onSubmit={handleSubmit}
aria-labelledby={open ? ids.form : ids.title}
aria-busy={loading || undefined}
>
{open ? (
<div className='rg4-expand'>
<div className='rg4-expand-in'>
<Sub id={ids.form} className='rg4-form-title'>
{formTitle}
</Sub>
<div className='rg4-fields'>
<Field
id={ids.name}
errorId={ids.nameErr}
name='firstName'
type='text'
autoComplete='given-name'
label={firstNameLabel}
placeholder={firstNamePlaceholder}
value={values.firstName}
error={nameErr}
disabled={disabled}
readOnly={loading}
icon={<User size={18} strokeWidth={2.5} />}
inputRef={nameRef}
onChange={update('firstName')}
onBlur={blur('firstName')}
/>
<Field
id={ids.email}
errorId={ids.emailErr}
name='email'
type='email'
inputMode='email'
autoComplete='email'
label={emailLabel}
placeholder={emailPlaceholder}
value={values.email}
error={emailErr}
disabled={disabled}
readOnly={loading}
icon={<Mail size={18} strokeWidth={2.5} />}
inputRef={emailRef}
onChange={update('email')}
onBlur={blur('email')}
/>
</div>
{status === 'failed' ? (
<p className='rg4-alert' role='alert'>
<AlertCircle className='rg4-inline' size={18} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
</div>
</div>
) : null}
{open ? (
<button
type='submit'
className='rg4-btn'
disabled={!ready || loading || disabled}
data-loading={loading || undefined}
aria-describedby={privacy ? ids.note : undefined}
>
{loading ? (
<>
<Loader2 className='rg4-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span className='rg4-btn-label'>{loadingLabel}</span>
</>
) : (
<span className='rg4-btn-label'>{submitLabel}</span>
)}
</button>
) : (
<button
type='button'
className='rg4-btn'
disabled={disabled}
onClick={handleOpen}
aria-describedby={reassurance ? ids.note : undefined}
>
<span className='rg4-btn-label'>{openLabel}</span>
</button>
)}
{open && privacy ? (
<p className='rg4-note' id={ids.note}>
<Lock className='rg4-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{privacy}
</p>
) : null}
{!open && reassurance ? (
<p className='rg4-note' id={ids.note}>
{reassurance}
</p>
) : null}
</form>
</div>
</section>
)
}
export default ResultsGate4
type FieldProps = {
id: string
errorId: string
name: string
type: 'text' | 'email'
inputMode?: 'text' | 'email'
autoComplete: string
label: string
placeholder: string
value: string
error?: string
disabled: boolean
readOnly: boolean
icon: React.ReactNode
inputRef: React.Ref<HTMLInputElement>
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void
onBlur: () => void
}
function Field(p: FieldProps) {
return (
<div className='rg4-field'>
<label className='rg4-label' htmlFor={p.id}>
{p.label}
</label>
<span className='rg4-control'>
<span className='rg4-ico' aria-hidden='true'>
{p.icon}
</span>
<input
ref={p.inputRef}
id={p.id}
name={p.name}
type={p.type}
inputMode={p.inputMode}
autoComplete={p.autoComplete}
placeholder={p.placeholder}
value={p.value}
disabled={p.disabled}
readOnly={p.readOnly}
required
className='rg4-input'
aria-invalid={p.error ? true : undefined}
aria-describedby={p.error ? p.errorId : undefined}
onChange={p.onChange}
onBlur={p.onBlur}
/>
</span>
{p.error ? (
<p className='rg4-err' id={p.errorId}>
<AlertCircle className='rg4-inline' size={16} strokeWidth={2.5} aria-hidden='true' />
{p.error}
</p>
) : null}
</div>
)
}
function emphasize(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='rg4-em'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
const BTN_SHADOW =
'inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--rg4-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--rg4-shadow) l c h / 0.42)'
const BTN_SHADOW_HOVER =
'inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--rg4-shadow) l c h / 0.34), 0 12px 20px -6px oklch(from var(--rg4-shadow) l c h / 0.5)'
const CSS = `
.cf-results-gate-4{--rg4-shadow:var(--shadow,oklch(0.22 0.03 260));--rg4-hi:color-mix(in oklab,var(--accent-fill,var(--accent)) 42%,var(--band-ink));--rg4-soft:color-mix(in oklab,var(--band-ink) 86%,var(--band));--rg4-rule:oklch(from var(--band-ink) l c h / 0.24);position:relative;isolation:isolate;overflow:hidden;overflow:clip;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-results-gate-4 *{box-sizing:border-box}
.cf-results-gate-4 .rg4-inner{position:relative;z-index:1;width:100%;max-width:56rem;margin:0 auto}
.cf-results-gate-4 .rg4-head{max-width:46rem;margin:0 auto;text-align:center}
.cf-results-gate-4 .rg4-art{display:block;width:clamp(104px,12vw,148px);height:auto;aspect-ratio:1;object-fit:contain;margin:0 auto 20px;filter:drop-shadow(0 2px 3px oklch(from var(--rg4-shadow) calc(l - 0.06) c h / 0.5)) drop-shadow(0 14px 16px oklch(from var(--rg4-shadow) calc(l - 0.06) c h / 0.42))}
.cf-results-gate-4 .rg4-title{margin:0;color:var(--band-ink);font-family:var(--font-display);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance}
.cf-results-gate-4 .rg4-em{color:var(--rg4-hi)}
.cf-results-gate-4 .rg4-lead{max-width:40rem;margin:20px auto 0;color:var(--rg4-soft);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-results-gate-4 .rg4-trail{margin-top:clamp(40px,6vw,64px)}
.cf-results-gate-4 .rg4-path-title{margin:0 0 24px;text-align:center;color:var(--band-ink);font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance}
.cf-results-gate-4 .rg4-path{list-style:none;margin:0 auto;padding:0;display:grid;gap:24px;max-width:34rem}
.cf-results-gate-4 .rg4-stop{position:relative;display:grid;grid-template-columns:80px minmax(0,1fr);column-gap:16px;align-items:start;text-align:left;animation:rg4-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-results-gate-4 .rg4-stop:not(:last-child)::after{content:'';position:absolute;left:39px;top:88px;bottom:-16px;width:2px;border-radius:2px;background:var(--rg4-rule)}
.cf-results-gate-4 .rg4-node{display:flex;align-items:center;justify-content:center;width:80px;height:80px}
.cf-results-gate-4 .rg4-dot{width:16px;height:16px;border-radius:999px;background:var(--accent-fill,var(--accent))}
.cf-results-gate-4 .rg4-copy{min-width:0;padding-top:14px}
.cf-results-gate-4 .rg4-stop-title{margin:0;color:var(--band-ink);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.3;font-weight:700;text-wrap:pretty}
.cf-results-gate-4 .rg4-num{margin-inline-end:.3em;color:var(--rg4-hi);font-family:var(--font-display);font-weight:800;font-variant-numeric:tabular-nums}
.cf-results-gate-4 .rg4-stop-detail{margin:6px 0 0;color:var(--rg4-soft);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty}
.cf-results-gate-4 .rg4-drop{display:none}
.cf-results-gate-4 .rg4-trail + .rg4-panel,.cf-results-gate-4 .rg4-head + .rg4-panel{margin-top:40px}
.cf-results-gate-4 .rg4-panel{position:relative;width:100%;max-width:32rem;margin-inline:auto;padding:0;color:var(--band-ink);text-align:center;animation:rg4-rise .45s cubic-bezier(.2,.7,.2,1) .21s both}
.cf-results-gate-4.is-open .rg4-panel{max-width:36rem;padding:clamp(20px,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(--rg4-shadow) l c h / 0.22),0 12px 24px -8px oklch(from var(--rg4-shadow) l c h / 0.32)));animation:rg4-card .45s cubic-bezier(.2,.7,.2,1) both}
.cf-results-gate-4 .rg4-expand{display:grid;grid-template-rows:1fr;animation:rg4-open .45s cubic-bezier(.2,.7,.2,1) both}
.cf-results-gate-4 .rg4-expand-in{min-height:0;overflow:hidden;margin:-4px;padding:4px}
.cf-results-gate-4 .rg4-form-title{margin:0;color:var(--ink);font-family:var(--font-display);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:var(--display-weight,800);letter-spacing:-0.01em;text-transform:var(--display-case,none);text-wrap:balance}
.cf-results-gate-4 .rg4-fields{display:grid;gap:16px;margin-top:20px;text-align:left}
.cf-results-gate-4 .rg4-field{min-width:0}
.cf-results-gate-4 .rg4-label{display:block;margin-bottom:8px;color:var(--label-ink,var(--ink));font-size:1rem;line-height:1.25;font-weight:700}
.cf-results-gate-4 .rg4-control{position:relative;display:block}
.cf-results-gate-4 .rg4-ico{position:absolute;left:16px;top:50%;display:flex;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink) 60%,var(--field));pointer-events:none}
.cf-results-gate-4 .rg4-input{display:block;width:100%;min-height:56px;margin:0;padding:0 16px 0 46px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field);color:var(--field-ink);font-family:var(--font-body);font-size:17px;line-height:1.3;font-weight:400;box-shadow:inset 0 1px 2px oklch(from var(--rg4-shadow) l c h / 0.08);outline:2px solid transparent;appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-results-gate-4 .rg4-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-results-gate-4 .rg4-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink) 40%,var(--field))}
.cf-results-gate-4 .rg4-input:focus{border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / 0.35)}
.cf-results-gate-4 .rg4-input[aria-invalid='true']{border-color:var(--danger)}
.cf-results-gate-4 .rg4-input[aria-invalid='true']:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.3)}
.cf-results-gate-4 .rg4-input:disabled{background:color-mix(in oklch,var(--ink) 4%,var(--field));cursor:not-allowed}
.cf-results-gate-4 .rg4-err{margin:8px 0 0;color:var(--danger);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-results-gate-4 .rg4-alert{margin:16px 0 0;padding:12px 16px;border-radius:10px;background:var(--danger-soft);color:var(--danger);text-align:left;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-results-gate-4 .rg4-inline{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-results-gate-4 .rg4-btn{display:flex;width:100%;min-height:72px;margin:0;padding:12px 28px;align-items:center;justify-content:center;gap:10px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,${BTN_SHADOW});cursor:pointer;-webkit-tap-highlight-color:transparent;transition:background .16s ease,box-shadow .16s ease,transform .16s ease}
.cf-results-gate-4 .rg4-expand + .rg4-btn{margin-top:24px}
.cf-results-gate-4.is-open .rg4-btn{min-height:64px}
.cf-results-gate-4 .rg4-btn-label{text-wrap:balance}
.cf-results-gate-4 .rg4-btn:not(:disabled):hover,.cf-results-gate-4.is-hover .rg4-btn:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.07) c h));box-shadow:var(--button-shadow,${BTN_SHADOW_HOVER})}
.cf-results-gate-4 .rg4-btn:not(:disabled):active,.cf-results-gate-4.is-active .rg4-btn:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.09) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - 0.22) c h / 0.45),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rg4-shadow) l c h / 0.3)}
.cf-results-gate-4 .rg4-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-results-gate-4:not(.is-open) .rg4-btn:focus-visible{outline-color:var(--band-ink)}
.cf-results-gate-4 .rg4-btn:disabled:not([data-loading]){background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm));cursor:not-allowed}
.cf-results-gate-4 .rg4-btn[data-loading]{cursor:progress}
.cf-results-gate-4 .rg4-spin{flex:0 0 auto;animation:rg4-spin .8s linear infinite}
.cf-results-gate-4 .rg4-note{margin:16px 0 0;color:var(--rg4-soft);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-results-gate-4.is-open .rg4-note{margin-top:12px;color:var(--muted)}
@media (max-width:479px){
.cf-results-gate-4 .rg4-btn{padding:12px 20px}
}
@media (min-width:640px){
.cf-results-gate-4 .rg4-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:768px){
.cf-results-gate-4 .rg4-path{max-width:none;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:0}
.cf-results-gate-4 .rg4-stop{display:block;padding:0 16px;text-align:center}
.cf-results-gate-4 .rg4-stop:not(:last-child)::after{left:calc(50% + 48px);right:calc(-50% + 48px);top:39px;bottom:auto;width:auto;height:2px}
.cf-results-gate-4 .rg4-node{margin:0 auto 16px}
.cf-results-gate-4 .rg4-copy{padding-top:0}
.cf-results-gate-4 .rg4-drop{display:block;width:2px;height:48px;margin:32px auto 0;border-radius:2px;background:var(--rg4-rule);transition:background-color .45s ease}
.cf-results-gate-4.is-open .rg4-drop{background:var(--accent-fill,var(--accent))}
.cf-results-gate-4 .rg4-trail + .rg4-panel{margin-top:0}
}
@keyframes rg4-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes rg4-card{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes rg4-open{from{grid-template-rows:0fr;opacity:.82}to{grid-template-rows:1fr;opacity:1}}
@keyframes rg4-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
.cf-results-gate-4 .rg4-stop,.cf-results-gate-4 .rg4-panel,.cf-results-gate-4.is-open .rg4-panel,.cf-results-gate-4 .rg4-expand,.cf-results-gate-4 .rg4-spin{animation:none}
.cf-results-gate-4 .rg4-btn,.cf-results-gate-4 .rg4-input,.cf-results-gate-4 .rg4-drop{transition:none}
.cf-results-gate-4 .rg4-btn:not(:disabled):active,.cf-results-gate-4.is-active .rg4-btn:not(:disabled){transform:none}
}
`
pieces/forms/results-gate-4/specimen.tsx 63 lines
import __studioImagef87d89fb from "../assets/5a068f0f35a000f1.webp";
// Specimen: Tidepool Analytics' Marketing Stack Score gate for ecommerce store owners (fictional).
import * as React from 'react'
import { ResultsGate4, type ResultsGate4State } from '../results-gate-4'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import chart from '../../fx/spots/chart'
import checklist from '../../fx/spots/checklist'
import rocket from '../../fx/spots/rocket'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ResultsGate4Specimen({ state = 'default' }: { state?: ResultsGate4State }) {
const handleSubmit = React.useCallback(() => new Promise<void>((resolve) => setTimeout(resolve, 1400)), [])
return (
<ResultsGate4
state={state}
headingLevel='h1'
reportImage={slot(
'product',
__studioImagef87d89fb
)}
reportImageAlt=''
headline='Your results are ready'
highlight='are ready'
lead='Tidepool Analytics has scored the marketing stack behind your store. One click, two quick fields, and your Marketing Stack Score is yours.'
pathTitle='Three things your Stack Score tells you'
stops={[
{
title: 'Where your stack stands today',
detail: 'How your email, ads and analytics tools score as one system.',
spot: chart,
},
{
title: 'Which tools overlap or leak sales',
detail: 'The apps doing the same job twice, or dropping orders between them.',
spot: checklist,
},
{
title: 'The first fix to make this week',
detail: 'One change to start with, picked from your own answers.',
spot: rocket,
},
]}
openLabel='Show me my Stack Score'
reassurance='Free for store owners · Two quick fields · No card'
formTitle='Where should we send your Stack Score?'
firstNameLabel='First name'
firstNamePlaceholder='Jane'
emailLabel='Work email'
emailPlaceholder='jane@yourstore.com'
submitLabel='Send me my Stack Score'
loadingLabel='Opening your Stack Score…'
privacy={`We’ll email your Stack Score. ${defaults.sample.registration.privacy}`}
nameError='Add your first name so we know who the score is for.'
emailError='Enter a valid email, like jane@yourstore.com.'
error='We couldn’t open your Stack Score just now. Please try again.'
onSubmit={handleSubmit}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalResultsGate4 |
string |
Default 'Your results are ready'
|
highlight OptionalResultsGate4 |
string |
Default 'are ready'
|
lead OptionalResultsGate4 |
string |
Default 'Your answers are in. One click, two quick fields, and your personal results are yours.'
|
reportImage OptionalResultsGate4 |
string |
|
reportImageAlt OptionalResultsGate4 |
string |
Default ''
|
pathTitle OptionalResultsGate4 |
string |
Default 'Three things your results tell you'
|
stops OptionalResultsGate4 |
ResultsGate4Stop[] |
Default DEFAULT_STOPS
|
openLabel OptionalResultsGate4 |
string |
Default 'Show me my results'
|
reassurance OptionalResultsGate4 |
string |
Default 'Free · Two quick fields · No card needed'
|
formTitle OptionalResultsGate4 |
string |
Default 'Where should we send your results?'
|
firstNameLabel OptionalResultsGate4 |
string |
Default 'First name'
|
firstNamePlaceholder OptionalResultsGate4 |
string |
Default 'Jane'
|
emailLabel OptionalResultsGate4 |
string |
Default 'Email address'
|
emailPlaceholder OptionalResultsGate4 |
string |
Default 'you@example.com'
|
submitLabel OptionalResultsGate4 |
string |
Default 'Send me my results'
|
loadingLabel OptionalResultsGate4 |
string |
Default 'Opening your results…'
|
privacy OptionalResultsGate4 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
nameError OptionalResultsGate4 |
string |
Default 'Add your first name so we know who the results are for.'
|
emailError OptionalResultsGate4 |
string |
Default 'Enter a valid email, like you@example.com.'
|
error OptionalResultsGate4 |
string |
Default 'We couldn’t open your results just now. Please try again.'
|
headingLevel OptionalResultsGate4 |
'h1' | 'h2' |
Default 'h2'
|
state OptionalResultsGate4 |
ResultsGate4State |
Default 'default'
|
onOpen OptionalResultsGate4 |
() => void |
|
onSubmit OptionalResultsGate4 |
(values: ResultsGate4Values) => void | Promise<void> |
|
className OptionalResultsGate4 |
string |
|
style OptionalResultsGate4 |
React.CSSProperties |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--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).
-
369bb6f216bb84ab.webp
image/webp · 22.6 KB
-
5a068f0f35a000f1.webp
image/webp · 43.2 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
d7814fce240ddf0e.webp
image/webp · 17.6 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB