Results Gate 2
Results gate that echoes the visitor’s own quiz answers back in big ticked numerals, each one editable, before it asks for the email.
Use it in a prompt
Use forms/results-gate-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/forms/results-gate-2.tsx. - Import it and pass your copy and images (Props tab):
import { ResultsGate2 } from "@/components/funneldna/forms/results-gate-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/results-gate-2/component.tsx 492 lines
// layout: clipboard-checklist
// Results gate that echoes the visitor’s own quiz answers back in big ticked numerals, each one editable, before it asks for the email.
// Seeing their own words, and a report cover that takes their name as they type it, turns a finished quiz into a consistent yes.
import * as React from 'react'
import { AlertCircle, Check, Loader2, Mail, PencilLine, ShieldCheck, User } from 'lucide-react'
import { FX_HOST, Pattern, Spot } from '../fx/fx'
import book from '../fx/spots/book'
export type ResultsGate2Answer = {
/** The quiz question, in a few words. */
question: string
/** The visitor’s answer, echoed back in their own words. */
answer: string
}
export type ResultsGate2Values = { firstName: string; email: string }
export type ResultsGate2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ResultsGate2Props = {
headline?: string
/** One continuous phrase inside the headline, set in the accent colour. */
highlight?: string
lead?: string
/** Line above the echoed answers. */
echoTitle?: string
/** The visitor’s key answers (1 to 4), passed in from the quiz. No score or result is shown before submit. */
answers?: ResultsGate2Answer[]
/** Visible label on each edit link. */
editLabel?: string
/** Accessible label for each edit link. Placeholders: {number}, {answer}. */
editAria?: string
/** Called with the answer’s index when the visitor wants to change it. Edit links show only when this is set. */
onEdit?: (index: number) => void
/** Generated cover of the printed report on a transparent background (slot: product). */
coverImage?: string
coverImageAlt?: string
/** Report title once a first name is typed. Placeholder: {name}. */
reportTitle?: string
/** Report title before a first name is typed. */
reportTitleFallback?: string
/** Small line under the report title. Placeholder: {count} (number of answers). */
coverNote?: string
firstNameLabel?: string
firstNamePlaceholder?: string
emailLabel?: string
emailPlaceholder?: string
/** Risk reversal that leads into the button. */
riskLine?: string
/** Button label, one line. */
label?: string
loadingLabel?: string
/** Screen-reader note on the button while it is disabled. */
invalidHint?: string
psLabel?: string
/** P.S. line under the action. */
ps?: string
nameError?: string
emailError?: string
/** Shown when onSubmit rejects. */
error?: string
/** Starting field values. */
defaultValues?: Partial<ResultsGate2Values>
/** Show the loader (previews); a submit shows it on its own. */
loading?: boolean
headingLevel?: 'h2' | 'h3'
state?: ResultsGate2State
/** Receives validated values. The button shows the loader until a returned promise settles; a rejection shows the error alert. */
onSubmit?: (values: ResultsGate2Values) => void | Promise<void>
className?: string
style?: React.CSSProperties
}
type Touched = Partial<Record<keyof ResultsGate2Values, boolean>>
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]{2,}$/
const DEFAULT_ANSWERS: ResultsGate2Answer[] = [
{ question: 'Time you give the business each week', answer: 'Under 10 hours a week' },
{ question: 'Where the work gets stuck', answer: 'Every decision waits on me' },
{ question: 'What you want back first', answer: 'My evenings' },
]
export function ResultsGate2({
headline = 'Your report starts with what you told us',
highlight = 'what you told us',
lead = 'Check your answers. If they’re right, tell us where to send your report.',
echoTitle = 'You told us:',
answers = DEFAULT_ANSWERS,
editLabel = 'Change',
editAria = 'Change answer {number}: {answer}',
onEdit,
coverImage,
coverImageAlt = '',
reportTitle = '{name}’s Results Report',
reportTitleFallback = 'Your Results Report',
coverNote = 'Built from your {count} answers',
firstNameLabel = 'First name',
firstNamePlaceholder = 'Jane',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
riskLine = 'Free, no card needed. Unsubscribe anytime.',
label = 'Send me my free report',
loadingLabel = 'Building your report…',
invalidHint = 'Add your first name and a valid email to send your report.',
psLabel = 'P.S.',
ps = 'Spot an answer that isn’t quite right? Change it first. Your report follows your words.',
nameError = 'Add your first name so we know who the report is for.',
emailError = 'Enter a valid email, like you@example.com.',
error = 'We couldn’t send your report just now. Please try again.',
defaultValues,
loading: loadingProp = false,
headingLevel = 'h2',
state = 'default',
onSubmit,
className,
style,
}: ResultsGate2Props) {
const uid = React.useId().replace(/:/g, '')
const ids = {
title: `${uid}-t`,
echo: `${uid}-x`,
report: `${uid}-r`,
name: `${uid}-n`,
email: `${uid}-e`,
nameErr: `${uid}-ne`,
emailErr: `${uid}-ee`,
hint: `${uid}-h`,
}
const [values, setValues] = React.useState<ResultsGate2Values>({
firstName: defaultValues?.firstName ?? '',
email: defaultValues?.email ?? '',
})
const [touched, setTouched] = React.useState<Touched>({})
const [dirty, setDirty] = React.useState(false)
const [busy, setBusy] = React.useState(false)
const [failed, setFailed] = React.useState(false)
const pending = React.useRef(false)
const alive = React.useRef(true)
const nameRef = React.useRef<HTMLInputElement>(null)
const emailRef = React.useRef<HTMLInputElement>(null)
React.useEffect(() => {
alive.current = true
return () => {
alive.current = false
}
}, [])
const disabled = state === 'disabled'
const loading = busy || loadingProp
const nameOk = values.firstName.trim() !== ''
const emailOk = EMAIL.test(values.email.trim())
const valid = nameOk && emailOk
const forced = state === 'error' && !dirty
const nameErr = !nameOk && (touched.firstName || forced) ? nameError : undefined
const emailErr = !emailOk && (touched.email || forced) ? emailError : undefined
const off = disabled || loading
const force = !off && (state === 'hover' || state === 'active') ? state : undefined
const H = headingLevel
const Sub = headingLevel === 'h2' ? 'h3' : 'h4'
const list = answers.slice(0, 4)
const first = firstWord(values.firstName)
const titleParts = first ? reportTitle.split('{name}') : null
const update = (key: keyof ResultsGate2Values) => (event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value
setDirty(true)
setFailed(false)
setValues((prev) => ({ ...prev, [key]: value }))
}
const blur = (key: keyof ResultsGate2Values) => () => {
setTouched((prev) => (prev[key] ? prev : { ...prev, [key]: true }))
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled || pending.current) return
setDirty(true)
if (!valid) {
setTouched({ firstName: true, email: true })
if (!nameOk) nameRef.current?.focus()
else emailRef.current?.focus()
return
}
pending.current = true
setFailed(false)
setBusy(true)
try {
await onSubmit?.({ firstName: values.firstName.trim(), email: values.email.trim() })
} catch {
if (alive.current) setFailed(true)
} finally {
pending.current = false
if (alive.current) setBusy(false)
}
}
return (
<section
className={['cf-results-gate-2', force ? `is-${force}` : '', className].filter(Boolean).join(' ')}
style={{ ...FX_HOST, ...style }}
aria-labelledby={ids.title}
>
<style>{CSS}</style>
<span className='rg2-bg' aria-hidden='true'>
<Pattern name='grid' fade='corner' />
</span>
<div className='rg2-wrap'>
<div className='rg2-echo'>
<H id={ids.title} className='rg2-title'>
{emphasize(headline, highlight)}
</H>
{lead ? <p className='rg2-lead'>{lead}</p> : null}
<Sub id={ids.echo} className='rg2-echo-title'>
{echoTitle}
</Sub>
<ol className='rg2-list' aria-labelledby={ids.echo}>
{list.map((item, i) => (
<li key={i} className='rg2-row' style={{ '--i': i } as React.CSSProperties}>
<span className='rg2-num' aria-hidden='true'>
{i + 1}
</span>
<div className='rg2-body'>
<p className='rg2-q'>
<span className='rg2-tick' aria-hidden='true'>
<Check size={12} strokeWidth={3} />
</span>
{item.question}
</p>
<p className='rg2-a'>“{item.answer}”</p>
</div>
{onEdit ? (
<button
type='button'
className='rg2-edit'
onClick={() => onEdit(i)}
disabled={disabled}
aria-label={fill(editAria, { number: String(i + 1), answer: item.answer })}
>
<PencilLine size={16} strokeWidth={2.5} aria-hidden='true' />
{editLabel}
</button>
) : null}
</li>
))}
</ol>
</div>
<form className='rg2-card' noValidate onSubmit={handleSubmit} aria-labelledby={ids.report} aria-busy={loading || undefined}>
<div className='rg2-cover'>
{coverImage ? (
<img className='rg2-cover-art' src={coverImage} alt={coverImageAlt} width={400} height={400} loading='lazy' decoding='async' />
) : (
<span className='rg2-spot'>
<Spot src={book} size={88} />
</span>
)}
<div className='rg2-cover-text'>
<Sub id={ids.report} className='rg2-report'>
{titleParts
? titleParts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 ? (
<span key={first} className='rg2-name'>
{first}
</span>
) : null}
{part}
</React.Fragment>
))
: reportTitleFallback}
</Sub>
{coverNote ? <p className='rg2-note'>{fill(coverNote, { count: String(list.length) })}</p> : null}
</div>
</div>
<div className='rg2-form'>
<fieldset className='rg2-fields' disabled={disabled}>
<div>
<label className='rg2-label' htmlFor={ids.name}>
{firstNameLabel}
</label>
<div className='rg2-control'>
<User className='rg2-icon' size={20} strokeWidth={2.5} aria-hidden='true' />
<input
ref={nameRef}
id={ids.name}
className='rg2-input'
type='text'
name='firstName'
autoComplete='given-name'
placeholder={firstNamePlaceholder}
value={values.firstName}
onChange={update('firstName')}
onBlur={blur('firstName')}
required
aria-invalid={nameErr ? true : undefined}
aria-describedby={nameErr ? ids.nameErr : undefined}
/>
</div>
{nameErr ? (
<p id={ids.nameErr} className='rg2-err'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{nameErr}
</p>
) : null}
</div>
<div>
<label className='rg2-label' htmlFor={ids.email}>
{emailLabel}
</label>
<div className='rg2-control'>
<Mail className='rg2-icon' size={20} strokeWidth={2.5} aria-hidden='true' />
<input
ref={emailRef}
id={ids.email}
className='rg2-input'
type='email'
name='email'
inputMode='email'
autoComplete='email'
placeholder={emailPlaceholder}
value={values.email}
onChange={update('email')}
onBlur={blur('email')}
required
aria-invalid={emailErr ? true : undefined}
aria-describedby={emailErr ? ids.emailErr : undefined}
/>
</div>
{emailErr ? (
<p id={ids.emailErr} className='rg2-err'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{emailErr}
</p>
) : null}
</div>
</fieldset>
{riskLine ? (
<p className='rg2-risk'>
<ShieldCheck size={18} strokeWidth={2.5} aria-hidden='true' />
{riskLine}
</p>
) : null}
<button
type='submit'
className={['rg2-btn', loading ? 'is-loading' : ''].filter(Boolean).join(' ')}
disabled={off}
aria-describedby={!valid && !disabled ? ids.hint : undefined}
>
{loading ? (
<>
<Loader2 className='rg2-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{loadingLabel}</span>
</>
) : (
<span>{label}</span>
)}
</button>
<span id={ids.hint} className='rg2-sr'>
{invalidHint}
</span>
{failed ? (
<p className='rg2-alert' role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
{ps ? (
<p className='rg2-ps'>
<strong>{psLabel}</strong>
{ps}
</p>
) : null}
</div>
</form>
</div>
</section>
)
}
export default ResultsGate2
function emphasize(text: string, phrase?: string) {
if (!phrase) return text
const at = text.indexOf(phrase)
if (at < 0) return text
return (
<>
{text.slice(0, at)}
<span className='rg2-hl'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
)
}
function fill(template: string, vars: Record<string, string>) {
return Object.keys(vars).reduce((out, key) => out.split('{' + key + '}').join(vars[key]), template)
}
function firstWord(value: string) {
const word = value.trim().split(' ').filter(Boolean)[0] ?? ''
return word.length > 24 ? word.slice(0, 24) : word
}
const CSS = `
.cf-results-gate-2{position:relative;box-sizing:border-box;background:var(--surface,#fff);color:var(--ink,#141b2d);font-family:var(--font-body,system-ui,sans-serif);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow:hidden}
.cf-results-gate-2 *,.cf-results-gate-2 *::before,.cf-results-gate-2 *::after{box-sizing:border-box}
.cf-results-gate-2 .rg2-bg{position:absolute;inset:0;z-index:0;opacity:.6;pointer-events:none}
.cf-results-gate-2 .rg2-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-results-gate-2 .rg2-title{margin:0 0 16px;font-family:var(--font-display,inherit);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);text-wrap:balance;color:var(--ink,#141b2d)}
.cf-results-gate-2 .rg2-hl{color:var(--accent,#2457c5)}
.cf-results-gate-2 .rg2-lead{margin:0 0 32px;max-width:52ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-results-gate-2 .rg2-echo-title{margin:0 0 12px;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;letter-spacing:-0.01em;color:var(--ink,#141b2d)}
.cf-results-gate-2 .rg2-list{list-style:none;margin:0;padding:0;border-bottom:1px solid oklch(from var(--ink,#141b2d) l c h / .14)}
.cf-results-gate-2 .rg2-row{display:grid;grid-template-columns:3.5rem minmax(0,1fr) auto;column-gap:20px;align-items:start;padding:24px 0;border-top:1px solid oklch(from var(--ink,#141b2d) l c h / .14);animation:rg2-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * .07s),.28s)}
.cf-results-gate-2 .rg2-num{font-family:var(--font-display,inherit);font-size:clamp(2.5rem,4.2vw,3.75rem);line-height:1;font-weight:800;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--accent,#2457c5)}
.cf-results-gate-2 .rg2-body{min-width:0}
.cf-results-gate-2 .rg2-q{margin:4px 0 8px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-results-gate-2 .rg2-tick{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:999px;background:var(--success,#1f7a3d);color:var(--success-ink,#fff);vertical-align:-0.3em;margin-inline-end:.5em}
.cf-results-gate-2 .rg2-a{margin:0;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;letter-spacing:-0.01em;color:var(--ink,#141b2d);text-wrap:balance;overflow-wrap:anywhere}
.cf-results-gate-2 .rg2-edit{appearance:none;background:none;border:0;margin:0;padding:0 4px;min-height:44px;display:inline-flex;align-items:center;gap:6px;font:inherit;font-size:.9375rem;font-weight:700;line-height:1.2;color:var(--link,var(--accent,#2457c5));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent,#2457c5)) l c h / .45);text-underline-offset:.18em;border-radius:8px;cursor:pointer;white-space:nowrap;transition:color .16s ease}
.cf-results-gate-2 .rg2-edit:hover{color:oklch(from var(--link,var(--accent,#2457c5)) calc(l - .08) c h);text-decoration-color:currentColor}
.cf-results-gate-2 .rg2-edit:focus-visible{outline:3px solid oklch(from var(--link,var(--accent,#2457c5)) l c h / .45);outline-offset:2px}
.cf-results-gate-2 .rg2-edit:disabled{color:var(--muted,#4a5568);text-decoration-color:currentColor;cursor:not-allowed}
.cf-results-gate-2 .rg2-card{position:sticky;top:24px;margin:0;background:var(--card,#fff);color:var(--ink,#141b2d);border:1px solid var(--card-border,oklch(from var(--ink,#141b2d) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)));padding:clamp(20px,3vw,32px)}
.cf-results-gate-2 .rg2-cover{display:flex;flex-direction:column;align-items:center;text-align:center;gap:16px}
.cf-results-gate-2 .rg2-cover-art{display:block;width:clamp(150px,15vw,200px);height:auto;aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 2px 3px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)) drop-shadow(0 12px 14px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22))}
.cf-results-gate-2 .rg2-spot{display:grid;place-items:center}
.cf-results-gate-2 .rg2-cover-text{min-width:0}
.cf-results-gate-2 .rg2-report{margin:0 0 8px;font-family:var(--font-display,inherit);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-weight:800;letter-spacing:-0.01em;text-wrap:balance;overflow-wrap:anywhere;color:var(--ink,#141b2d)}
.cf-results-gate-2 .rg2-name{color:var(--accent,#2457c5);animation:rg2-name .3s cubic-bezier(.2,.7,.2,1)}
.cf-results-gate-2 .rg2-note{margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--muted,#4a5568)}
.cf-results-gate-2 .rg2-form{margin-top:24px;padding-top:24px;border-top:1px solid oklch(from var(--ink,#141b2d) l c h / .12);display:grid;gap:16px}
.cf-results-gate-2 .rg2-fields{border:0;margin:0;padding:0;min-width:0;display:grid;gap:16px}
.cf-results-gate-2 .rg2-label{display:block;margin:0 0 8px;font-size:1rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink,#141b2d))}
.cf-results-gate-2 .rg2-control{position:relative}
.cf-results-gate-2 .rg2-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink,#141b2d) 60%,var(--field,#fff));pointer-events:none}
.cf-results-gate-2 .rg2-input{display:block;width:100%;height:56px;margin:0;padding:0 16px 0 48px;font:inherit;font-size:1.0625rem;color:var(--field-ink,#141b2d);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink,#141b2d) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));transition:border-color .16s ease,box-shadow .16s ease}
.cf-results-gate-2 .rg2-input::placeholder{color:color-mix(in oklch,var(--field-ink,#141b2d) 65%,var(--field,#fff));opacity:1}
.cf-results-gate-2 .rg2-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink,#141b2d) 40%,transparent)}
.cf-results-gate-2 .rg2-input:focus-visible{outline:none;border-color:var(--field-focus,var(--accent,#2457c5));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent,#2457c5)) l c h / .35)}
.cf-results-gate-2 .rg2-input[aria-invalid='true']{border-color:var(--danger,#b42318)}
.cf-results-gate-2 .rg2-input[aria-invalid='true']:focus-visible{box-shadow:0 0 0 3px oklch(from var(--danger,#b42318) l c h / .3)}
.cf-results-gate-2 .rg2-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#141b2d) 5%,var(--field,#fff))}
.cf-results-gate-2 .rg2-err{margin:8px 0 0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger,#b42318);text-wrap:pretty}
.cf-results-gate-2 .rg2-err svg,.cf-results-gate-2 .rg2-alert svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-results-gate-2 .rg2-risk{margin:8px 0 0;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--ink,#141b2d);text-wrap:pretty}
.cf-results-gate-2 .rg2-risk svg{display:inline-block;vertical-align:-0.22em;margin-inline-end:.4em;color:var(--success,#1f7a3d)}
.cf-results-gate-2 .rg2-btn{appearance:none;position:relative;width:100%;min-height:56px;margin:0;padding:0 28px;display:inline-flex;align-items:center;justify-content:center;gap:10px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display,inherit));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;color:var(--button-ink,var(--cta-ink,#fff));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta,#d0342c))) calc(l - .02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-results-gate-2 .rg2-btn:hover:not(:disabled),.cf-results-gate-2.is-hover .rg2-btn:not(:disabled){background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta,#d0342c))) calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .34),0 10px 18px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .55)}
.cf-results-gate-2 .rg2-btn:active:not(:disabled),.cf-results-gate-2.is-active .rg2-btn:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .05) c h),oklch(from var(--button-bg-2,var(--cta-2,var(--cta,#d0342c))) calc(l - .09) c h));box-shadow:inset 0 2px 3px oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .24) c h / .5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta,#d0342c)) calc(l - .18) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)}
.cf-results-gate-2 .rg2-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent,#2457c5)) l c h / .6);outline-offset:3px}
.cf-results-gate-2 .rg2-btn:disabled:not(.is-loading){background:color-mix(in oklch,var(--ink,#141b2d) 8%,var(--card,#fff));color:color-mix(in oklch,var(--ink,#141b2d) 64%,var(--card,#fff));text-shadow:none;box-shadow:inset 0 0 0 1px oklch(from var(--ink,#141b2d) l c h / .14);cursor:not-allowed}
.cf-results-gate-2 .rg2-btn.is-loading{cursor:progress}
.cf-results-gate-2 .rg2-spin{flex:0 0 auto;animation:rg2-spin .8s linear infinite}
.cf-results-gate-2 .rg2-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cf-results-gate-2 .rg2-alert{margin:0;padding:12px 16px;border-radius:10px;background:var(--danger-soft,#fbe9e7);color:var(--danger,#b42318);font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-results-gate-2 .rg2-ps{margin:4px 0 0;font-size:1rem;line-height:1.5;color:var(--muted,#4a5568);text-wrap:pretty}
.cf-results-gate-2 .rg2-ps strong{margin-inline-end:.35em;font-weight:800;color:var(--ink,#141b2d)}
@keyframes rg2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes rg2-name{from{opacity:.4}to{opacity:1}}
@keyframes rg2-spin{to{transform:rotate(360deg)}}
@media (max-width:860px){
.cf-results-gate-2 .rg2-wrap{grid-template-columns:minmax(0,1fr)}
.cf-results-gate-2 .rg2-card{position:relative;top:auto}
.cf-results-gate-2 .rg2-lead{margin-bottom:28px}
.cf-results-gate-2 .rg2-row{grid-template-columns:2.25rem minmax(0,1fr);column-gap:14px;padding:16px 0}
.cf-results-gate-2 .rg2-num{font-size:2.25rem}
.cf-results-gate-2 .rg2-a{font-size:1.1875rem}
.cf-results-gate-2 .rg2-edit{grid-column:2;justify-self:start;padding-left:0}
.cf-results-gate-2 .rg2-cover{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;text-align:left;gap:16px}
.cf-results-gate-2 .rg2-cover-art{width:88px}
.cf-results-gate-2 .rg2-bg{display:none}
.cf-results-gate-2 .rg2-btn{padding:10px 16px}
}
@media (prefers-reduced-motion:reduce){
.cf-results-gate-2 .rg2-row,.cf-results-gate-2 .rg2-name,.cf-results-gate-2 .rg2-spin{animation:none}
.cf-results-gate-2 .rg2-btn,.cf-results-gate-2 .rg2-input,.cf-results-gate-2 .rg2-edit{transition:none}
.cf-results-gate-2 .rg2-btn:active:not(:disabled),.cf-results-gate-2.is-active .rg2-btn:not(:disabled){transform:none}
}
`
pieces/forms/results-gate-2/specimen.tsx 44 lines
import __studioImagefe88a519 from "../assets/b813059b10051eeb.webp";
import * as React from 'react'
import { ResultsGate2, type ResultsGate2State } from '../results-gate-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
const ANSWERS = [
{ question: 'Hours you spend on the business, not in it', answer: 'Under 10 hours a week' },
{ question: 'Where work waits the longest', answer: 'Every decision comes back to me' },
{ question: 'What you want back first', answer: 'My Friday afternoons' },
]
export default function ResultsGate2Specimen({ state = 'default' }: { state?: ResultsGate2State }) {
const filled = state === 'hover' || state === 'active' || state === 'disabled'
const start = filled ? { firstName: 'Dana', email: 'dana@example.com' } : state === 'error' ? undefined : { firstName: 'Dana' }
return (
<ResultsGate2
key={state}
state={state}
headline='Your Bottleneck Report starts with your own words'
highlight='your own words'
lead='Keel Advisory builds every page around the three answers below. Check them, then tell us where to send your report.'
echoTitle='You told us:'
answers={ANSWERS}
onEdit={() => {}}
coverImage={slot('product', __studioImagefe88a519)}
coverImageAlt='The printed Founder Bottleneck Report from Keel Advisory'
reportTitle='{name}’s Bottleneck Report'
reportTitleFallback='Your Founder Bottleneck Report'
coverNote='Built from your {count} answers · Free PDF'
firstNamePlaceholder='Dana'
emailPlaceholder='dana@example.com'
riskLine={`Free, no card needed. ${defaults.sample.registration.privacy}`}
label='Send me my free report'
loadingLabel='Building your report…'
ps='Your report is written around the three answers above. If one is off, change it now, before Keel builds your plan.'
defaultValues={start}
onSubmit={async () => {}}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalResultsGate2 |
string |
Default 'Your report starts with what you told us'
|
highlight OptionalResultsGate2 |
string |
Default 'what you told us'
|
lead OptionalResultsGate2 |
string |
Default 'Check your answers. If they’re right, tell us where to send your report.'
|
echoTitle OptionalResultsGate2 |
string |
Default 'You told us:'
|
answers OptionalResultsGate2 |
ResultsGate2Answer[] |
Default DEFAULT_ANSWERS
|
editLabel OptionalResultsGate2 |
string |
Default 'Change'
|
editAria OptionalResultsGate2 |
string |
Default 'Change answer {number}: {answer}'
|
onEdit OptionalResultsGate2 |
(index: number) => void |
|
coverImage OptionalResultsGate2 |
string |
|
coverImageAlt OptionalResultsGate2 |
string |
Default ''
|
reportTitle OptionalResultsGate2 |
string |
Default '{name}’s Results Report'
|
reportTitleFallback OptionalResultsGate2 |
string |
Default 'Your Results Report'
|
coverNote OptionalResultsGate2 |
string |
Default 'Built from your {count} answers'
|
firstNameLabel OptionalResultsGate2 |
string |
Default 'First name'
|
firstNamePlaceholder OptionalResultsGate2 |
string |
Default 'Jane'
|
emailLabel OptionalResultsGate2 |
string |
Default 'Email address'
|
emailPlaceholder OptionalResultsGate2 |
string |
Default 'you@example.com'
|
riskLine OptionalResultsGate2 |
string |
Default 'Free, no card needed. Unsubscribe anytime.'
|
label OptionalResultsGate2 |
string |
Default 'Send me my free report'
|
loadingLabel OptionalResultsGate2 |
string |
Default 'Building your report…'
|
invalidHint OptionalResultsGate2 |
string |
Default 'Add your first name and a valid email to send your report.'
|
psLabel OptionalResultsGate2 |
string |
Default 'P.S.'
|
ps OptionalResultsGate2 |
string |
Default 'Spot an answer that isn’t quite right? Change it first. Your report follows your words.'
|
nameError OptionalResultsGate2 |
string |
Default 'Add your first name so we know who the report is for.'
|
emailError OptionalResultsGate2 |
string |
Default 'Enter a valid email, like you@example.com.'
|
error OptionalResultsGate2 |
string |
Default 'We couldn’t send your report just now. Please try again.'
|
defaultValues OptionalResultsGate2 |
Partial<ResultsGate2Values> |
|
loading OptionalResultsGate2 |
boolean |
Default false
|
headingLevel OptionalResultsGate2 |
'h2' | 'h3' |
Default 'h2'
|
state OptionalResultsGate2 |
ResultsGate2State |
Default 'default'
|
onSubmit OptionalResultsGate2 |
(values: ResultsGate2Values) => void | Promise<void> |
|
className OptionalResultsGate2 |
string |
|
style OptionalResultsGate2 |
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.
--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
-
b813059b10051eeb.webp
image/webp · 19.5 KB
-
bc3d360c88eeac0e.webp
image/webp · 23.9 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB