Results Gate 5
Results gate with a delivery choice. An angled photo field sells the finished report and why it arrives by email; the form lets the visitor add text delivery with consent and a privacy promise, so more finished quizzes become reachable leads.
Use it in a prompt
Use forms/results-gate-5 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-5.tsx. - Import it and pass your copy and images (Props tab):
import { ResultsGate5 } from "@/components/funneldna/forms/results-gate-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/results-gate-5/component.tsx 726 lines
// layout: diagonal-split
// Results gate with a delivery choice. An angled photo field sells the finished report and why it arrives by email; the form lets the visitor add text delivery with consent and a privacy promise, so more finished quizzes become reachable leads.
import * as React from 'react'
import { AlertCircle, Loader2, Mail, MessageSquareText, ShieldCheck, Smartphone, User } from 'lucide-react'
import type { LucideIcon } from 'lucide-react'
import { Backdrop, FX_HOST } from '../fx/fx'
import home from '../fx/backdrops/home'
export type ResultsGate5Delivery = 'email' | 'sms'
export type ResultsGate5Values = {
firstName: string
email: string
delivery: ResultsGate5Delivery
/** Present only when the visitor chose email + text. */
phone?: string
/** True only when text delivery was chosen and the consent box was ticked. */
smsConsent: boolean
}
export type ResultsGate5Point = { title: string; body: string }
export type ResultsGate5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ResultsGate5Props = {
headline?: string
/** One continuous phrase inside the headline, set in the warm action tint. */
highlight?: string
lead?: string
/** Up to two selling subheads with one short line each (hidden on phones). */
points?: ResultsGate5Point[]
/** The reason-why for email delivery. Its subhead always shows; its line is hidden on phones. */
reason?: ResultsGate5Point
/** Photo behind the angled field (an fx backdrop asset). A page scene image replaces it. */
backdropImage?: string
/** Report or product cut-out on a transparent background, shown beside the form title. */
reportImage?: string
reportImageAlt?: string
/** Question over the delivery toggle; it also names the form. */
formTitle?: string
emailOption?: string
smsOption?: string
/** Line under the toggle for email delivery. */
emailHint?: string
/** Line under the toggle once text delivery is chosen. */
smsHint?: string
firstNameLabel?: string
firstNamePlaceholder?: string
emailLabel?: string
emailPlaceholder?: string
phoneLabel?: string
phonePlaceholder?: string
/** Supplied SMS consent wording, shown beside the required checkbox. */
consentText?: React.ReactNode
label?: string
/** Button second line for email delivery. */
sublabel?: string
/** Button second line once text delivery is chosen. */
smsSublabel?: string
loadingLabel?: string
privacyTitle?: string
privacy?: string
nameError?: string
emailError?: string
phoneError?: string
consentError?: string
/** Shown when onSubmit rejects. */
error?: string
defaultDelivery?: ResultsGate5Delivery
headingLevel?: 'h2' | 'h3'
state?: ResultsGate5State
/** Receives validated values. A returned promise shows the loader; a rejection shows the error alert. */
onSubmit?: (values: ResultsGate5Values) => void | Promise<void>
className?: string
style?: React.CSSProperties
}
type Field = 'firstName' | 'email' | 'phone' | 'consent'
type TextField = 'firstName' | 'email' | 'phone'
type FormValues = { firstName: string; email: string; phone: string; consent: boolean }
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]+$/
const ORDER: Field[] = ['firstName', 'email', 'phone', 'consent']
export function ResultsGate5({
headline = 'Your results are ready to send',
highlight = 'ready to send',
lead = 'Your report is built from the answers you just gave.',
points = [],
reason = { title: 'We email it so your household can read it too', body: 'Forward it, read it together and decide on your own time.' },
backdropImage = home,
reportImage,
reportImageAlt = '',
formTitle = 'How should we send your report?',
emailOption = 'Email me',
smsOption = 'Email + text me',
emailHint = 'We’ll email your report so you can forward it.',
smsHint = 'We’ll email your report and text you a link to it.',
firstNameLabel = 'First name',
firstNamePlaceholder = 'Jane',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
phoneLabel = 'Mobile number',
phonePlaceholder = '(555) 123-4567',
consentText = 'Yes, text me my report link and follow-up messages at this number. Message and data rates may apply. Reply STOP to opt out.',
label = 'Send My Report',
sublabel = 'Straight to your inbox',
smsSublabel = 'To your inbox and your phone',
loadingLabel = 'Sending your report…',
privacyTitle = 'Your details stay private.',
privacy = 'We use them only to send your report and follow up about it. We never sell them.',
nameError = 'Add your first name so we know who the report is for.',
emailError = 'Enter a valid email so we can send your report.',
phoneError = 'Enter a mobile number with area code, or switch to email only.',
consentError = 'Tick the box so we’re allowed to text you, or switch to email only.',
error = 'We couldn’t send your report just now. Please try again.',
defaultDelivery,
headingLevel = 'h2',
state = 'default',
onSubmit,
className,
style,
}: ResultsGate5Props) {
const uid = React.useId().replace(/:/g, '')
const id = (s: string) => uid + '-' + s
const [delivery, setDelivery] = React.useState<ResultsGate5Delivery>(defaultDelivery ?? (state === 'error' ? 'sms' : 'email'))
const [values, setValues] = React.useState<FormValues>({ firstName: '', email: '', phone: '', consent: false })
const [touched, setTouched] = React.useState<Partial<Record<Field, boolean>>>({})
const [showAll, setShowAll] = React.useState(false)
const [dirty, setDirty] = React.useState(false)
const [status, setStatus] = React.useState<'idle' | 'loading' | 'failed'>('idle')
const busy = React.useRef(false)
const nameRef = React.useRef<HTMLInputElement>(null)
const emailRef = React.useRef<HTMLInputElement>(null)
const phoneRef = React.useRef<HTMLInputElement>(null)
const consentRef = React.useRef<HTMLInputElement>(null)
const sms = delivery === 'sms'
const disabled = state === 'disabled'
const loading = status === 'loading'
const forcedError = state === 'error' && !dirty
const force = !loading && (state === 'hover' || state === 'active') ? state : undefined
const errs: Partial<Record<Field, string>> = {}
if (!values.firstName.trim()) errs.firstName = nameError
if (!EMAIL.test(values.email.trim())) errs.email = emailError
if (sms) {
const digits = values.phone.replace(/[^0-9]/g, '').length
if (digits < 10 || digits > 15) errs.phone = phoneError
if (!values.consent) errs.consent = consentError
}
const valid = ORDER.every((f) => !errs[f])
const shown = (f: Field) => (forcedError || showAll || touched[f] ? errs[f] : undefined)
const H = headingLevel
const Sub = headingLevel === 'h3' ? 'h4' : 'h3'
const extra = points.slice(0, 2)
const change = (f: TextField) => (event: React.ChangeEvent<HTMLInputElement>) => {
const v = event.target.value
setDirty(true)
setStatus((s) => (s === 'failed' ? 'idle' : s))
setValues((p) => ({ ...p, [f]: v }))
}
const blur = (f: Field) => () => setTouched((t) => (t[f] ? t : { ...t, [f]: true }))
function choose(next: ResultsGate5Delivery) {
setDirty(true)
setStatus((s) => (s === 'failed' ? 'idle' : s))
setDelivery(next)
}
function focusField(f: Field) {
const map = { firstName: nameRef, email: emailRef, phone: phoneRef, consent: consentRef }
map[f].current?.focus()
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault()
if (disabled || busy.current) return
setDirty(true)
if (!valid) {
setShowAll(true)
const first = ORDER.find((f) => errs[f])
if (first) focusField(first)
return
}
busy.current = true
setStatus('idle')
try {
const result: unknown = onSubmit?.({
firstName: values.firstName.trim(),
email: values.email.trim(),
delivery,
phone: sms ? values.phone.trim() : undefined,
smsConsent: sms && values.consent,
})
if (result && typeof (result as PromiseLike<void>).then === 'function') {
setStatus('loading')
await result
}
setStatus('idle')
} catch {
setStatus('failed')
} finally {
busy.current = false
}
}
function renderInput(
f: TextField,
cfg: { label: string; placeholder: string; type: string; autoComplete: string; inputMode?: 'tel' | 'email' | 'text'; Icon: LucideIcon; ref: React.RefObject<HTMLInputElement | null> },
) {
const err = shown(f)
const { Icon } = cfg
return (
<div className={'rg5-f' + (err ? ' is-bad' : '')}>
<label htmlFor={id(f)} className='rg5-label'>{cfg.label}</label>
<div className='rg5-ctl'>
<Icon className='rg5-ico' aria-hidden='true' size={18} strokeWidth={2.5} />
<input
id={id(f)}
ref={cfg.ref as React.RefObject<HTMLInputElement>}
className='rg5-input'
type={cfg.type}
name={f}
inputMode={cfg.inputMode}
autoComplete={cfg.autoComplete}
placeholder={cfg.placeholder}
value={values[f]}
onChange={change(f)}
onBlur={blur(f)}
required
aria-invalid={err ? true : undefined}
aria-describedby={err ? id(f + '-e') : undefined}
/>
</div>
{err ? (
<p id={id(f + '-e')} className='rg5-err'>
<AlertCircle aria-hidden='true' size={16} strokeWidth={2.5} />
{err}
</p>
) : null}
</div>
)
}
const options: { value: ResultsGate5Delivery; label: string; Icon: LucideIcon }[] = [
{ value: 'email', label: emailOption, Icon: Mail },
{ value: 'sms', label: smsOption, Icon: MessageSquareText },
]
const consentErr = shown('consent')
return (
<section
className={['cf-results-gate-5', force ? 'is-' + force : '', className].filter(Boolean).join(' ')}
style={style}
aria-labelledby={id('t')}
>
<style>{CSS}</style>
<div className='rg5-field' style={{ ...FX_HOST, position: 'absolute' }} aria-hidden='true'>
<Backdrop src={backdropImage} treatment='scrim-dark' side='left' position='center' />
</div>
<div className='rg5-wrap'>
<div className='rg5-copy'>
<div className='rg5-copy-in'>
<H id={id('t')} className='rg5-title'>{emphasize(headline, highlight)}</H>
{lead ? <p className='rg5-lead'>{lead}</p> : null}
{extra.length || reason ? (
<div className='rg5-points'>
{extra.map((p) => (
<div className='rg5-point is-extra' key={p.title}>
<Sub className='rg5-sub'>{p.title}</Sub>
{p.body ? <p className='rg5-body'>{p.body}</p> : null}
</div>
))}
{reason ? (
<div className='rg5-point is-reason'>
<Sub className='rg5-sub'>{reason.title}</Sub>
{reason.body ? <p className='rg5-body'>{reason.body}</p> : null}
</div>
) : null}
</div>
) : null}
</div>
</div>
<div className='rg5-side'>
<span className='rg5-light' aria-hidden='true' />
<form className='rg5-card' noValidate onSubmit={handleSubmit} aria-labelledby={id('f')} aria-busy={loading || undefined}>
<fieldset className='rg5-fs' disabled={disabled}>
<div className='rg5-head'>
{reportImage ? <img className='rg5-img' src={reportImage} alt={reportImageAlt} width={176} height={176} /> : null}
<Sub id={id('f')} className='rg5-ftitle'>{formTitle}</Sub>
</div>
<div className='rg5-seg' role='radiogroup' aria-labelledby={id('f')} data-choice={delivery}>
<span className='rg5-thumb' aria-hidden='true' />
{options.map(({ value, label: optLabel, Icon }) => (
<label key={value} className={'rg5-opt' + (delivery === value ? ' is-on' : '')}>
<input type='radio' name={id('d')} value={value} checked={delivery === value} onChange={() => choose(value)} />
<Icon aria-hidden='true' size={18} strokeWidth={2.5} />
<span>{optLabel}</span>
</label>
))}
</div>
<p className='rg5-hint' aria-live='polite'>{sms ? smsHint : emailHint}</p>
<div className='rg5-fields'>
{renderInput('firstName', { label: firstNameLabel, placeholder: firstNamePlaceholder, type: 'text', autoComplete: 'given-name', Icon: User, ref: nameRef })}
{renderInput('email', { label: emailLabel, placeholder: emailPlaceholder, type: 'email', autoComplete: 'email', inputMode: 'email', Icon: Mail, ref: emailRef })}
{sms ? (
<div className='rg5-sms'>
{renderInput('phone', { label: phoneLabel, placeholder: phonePlaceholder, type: 'tel', autoComplete: 'tel', inputMode: 'tel', Icon: Smartphone, ref: phoneRef })}
<div>
<div className={'rg5-consent' + (consentErr ? ' is-bad' : '')}>
<input
id={id('c')}
ref={consentRef}
type='checkbox'
name='smsConsent'
checked={values.consent}
onChange={(event) => {
const v = event.target.checked
setDirty(true)
setValues((p) => ({ ...p, consent: v }))
setTouched((t) => ({ ...t, consent: true }))
}}
onBlur={blur('consent')}
required
aria-invalid={consentErr ? true : undefined}
aria-describedby={consentErr ? id('c-e') : undefined}
/>
<label htmlFor={id('c')}>{consentText}</label>
</div>
{consentErr ? (
<p id={id('c-e')} className='rg5-err'>
<AlertCircle aria-hidden='true' size={16} strokeWidth={2.5} />
{consentErr}
</p>
) : null}
</div>
</div>
) : null}
</div>
{status === 'failed' ? (
<p className='rg5-alert' role='alert'>
<AlertCircle aria-hidden='true' size={16} strokeWidth={2.5} />
{error}
</p>
) : null}
<button
type='submit'
className='rg5-btn'
aria-disabled={!disabled && loading ? true : undefined}
aria-describedby={id('pv')}
>
{loading ? (
<span className='rg5-btn-main rg5-btn-load'>
<Loader2 className='rg5-spin' aria-hidden='true' size={20} strokeWidth={2.5} />
{loadingLabel}
</span>
) : (
<>
<span className='rg5-btn-main'>{label}</span>
<span className='rg5-btn-sub'>{sms ? smsSublabel : sublabel}</span>
</>
)}
</button>
<p id={id('pv')} className='rg5-privacy'>
<ShieldCheck aria-hidden='true' size={18} strokeWidth={2.5} />
<strong>{privacyTitle}</strong> {privacy}
</p>
</fieldset>
</form>
</div>
</div>
</section>
)
}
export default ResultsGate5
function emphasize(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text
const i = text.indexOf(phrase)
if (i < 0) return text
return (
<>
{text.slice(0, i)}
<span className='rg5-hl'>{phrase}</span>
{text.slice(i + phrase.length)}
</>
)
}
const CSS = `
.cf-results-gate-5{
--rg5-pt:clamp(56px,8vw,112px);
--rg5-pb:clamp(64px,8.5vw,120px);
--rg5-gut:clamp(16px,5vw,48px);
--rg5-max:1120px;
--rg5-gap:clamp(48px,7vw,96px);
--rg5-hot:color-mix(in oklab,var(--cta,oklch(0.58 0.21 29)) 52%,var(--band-ink,#ffffff));
--rg5-shadow:var(--shadow,oklch(0.22 0.03 260));
--rg5-focus:var(--field-focus,var(--accent,oklch(0.5 0.17 257)));
--rg5-well:color-mix(in oklch,var(--ink,#101828) 4%,var(--card,#ffffff));
--rg5-btn:var(--button-bg,var(--cta,oklch(0.58 0.21 29)));
--rg5-btn-2:var(--button-bg-2,var(--cta-2,oklch(0.51 0.2 29)));
position:relative;
overflow:clip;
background:var(--band,oklch(0.27 0.07 256));
color:var(--band-ink,#ffffff);
font-family:var(--font-body,inherit);
padding:var(--rg5-pt) var(--rg5-gut) var(--rg5-pb);
}
.cf-results-gate-5 *,.cf-results-gate-5 *::before,.cf-results-gate-5 *::after{box-sizing:border-box}
.cf-results-gate-5 :where(h2,h3,h4,p){margin:0}
.rg5-wrap{
position:relative;
z-index:1;
max-width:var(--rg5-max);
margin:0 auto;
display:grid;
grid-template-columns:minmax(0,1fr) clamp(400px,40vw,480px);
column-gap:var(--rg5-gap);
align-items:stretch;
}
.rg5-copy{position:relative;min-width:0;color:var(--band-ink,#ffffff)}
.rg5-field{
inset:0;
z-index:0;
overflow:hidden;
pointer-events:none;
}
.rg5-side{position:relative;min-width:0;display:flex;flex-direction:column}
.rg5-light{
position:absolute;
z-index:0;
top:calc(-1 * var(--rg5-pt));
bottom:calc(-1 * var(--rg5-pb));
left:-72px;
right:-100vw;
background:var(--surface,#ffffff);
clip-path:polygon(300px 0,100% 0,100% 100%,0 100%);
pointer-events:none;
}
.rg5-copy-in{position:relative;z-index:1;padding-top:4px;animation:rg5-in .45s cubic-bezier(.2,.7,.2,1) both}
.rg5-title{
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(2rem,3.6vw,3.25rem);
line-height:1.06;
text-wrap:balance;
color:var(--band-ink,#ffffff);
}
.rg5-hl{color:var(--rg5-hot)}
.rg5-lead{
margin-top:16px;
font-size:clamp(1.125rem,1.5vw,1.375rem);
line-height:1.4;
font-weight:500;
max-width:64ch;
text-wrap:pretty;
}
.rg5-points{margin-top:32px;display:grid;gap:24px}
.rg5-sub{
font-family:var(--font-display,inherit);
font-weight:var(--display-weight,800);
text-transform:var(--display-case,none);
font-size:clamp(1.3125rem,1.8vw,1.625rem);
line-height:1.15;
letter-spacing:-0.01em;
color:var(--rg5-hot);
text-wrap:balance;
}
.rg5-body{
margin-top:8px;
font-size:clamp(1.0625rem,1.25vw,1.125rem);
line-height:1.5;
max-width:52ch;
text-wrap:pretty;
}
.rg5-card{
position:relative;
z-index:1;
align-self:stretch;
min-width:0;
background:var(--card,#ffffff);
color:var(--ink,#101828);
border:1px solid var(--card-border,oklch(from var(--ink,#101828) 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(0.22 0.03 260 / 0.22),0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));
padding:clamp(20px,3vw,32px);
animation:rg5-in .45s cubic-bezier(.2,.7,.2,1) .07s both;
}
.rg5-fs{border:0;margin:0;padding:0;min-width:0}
.rg5-head{display:flex;align-items:center;gap:16px;margin-bottom:20px}
.rg5-img{
flex:0 0 auto;
width:88px;
height:88px;
object-fit:contain;
border-radius:0;
filter:drop-shadow(0 2px 3px oklch(from var(--rg5-shadow) l c h / 0.3)) drop-shadow(0 10px 12px oklch(from var(--rg5-shadow) l c h / 0.2));
}
.rg5-ftitle{
font-family:var(--font-display,inherit);
font-weight:var(--display-weight,800);
text-transform:var(--display-case,none);
font-size:clamp(1.3125rem,1.8vw,1.625rem);
line-height:1.15;
letter-spacing:-0.01em;
color:var(--ink,#101828);
text-wrap:balance;
}
.rg5-seg{
position:relative;
display:grid;
grid-template-columns:1fr 1fr;
padding:4px;
border-radius:calc(var(--radius,12px) + 4px);
background:color-mix(in oklch,var(--ink,#101828) 6%,var(--card,#ffffff));
}
.rg5-thumb{
position:absolute;
top:4px;
bottom:4px;
left:4px;
width:calc(50% - 4px);
border-radius:var(--radius,12px);
background:color-mix(in oklch,var(--accent,oklch(0.5 0.17 257)) 10%,var(--card,#ffffff));
border:1px solid oklch(from var(--accent,oklch(0.5 0.17 257)) l c h / 0.45);
box-shadow:var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / 0.18),0 1px 3px oklch(0.22 0.03 260 / 0.14));
transition:transform .3s cubic-bezier(.2,.7,.2,1);
}
.rg5-seg[data-choice='sms'] .rg5-thumb{transform:translateX(100%)}
.rg5-opt{
position:relative;
z-index:1;
min-height:52px;
display:flex;
align-items:center;
justify-content:center;
gap:8px;
padding:6px 12px;
border-radius:var(--radius,12px);
font-size:1rem;
font-weight:700;
line-height:1.2;
text-align:center;
color:var(--muted,#475467);
cursor:pointer;
transition:color .16s ease,background .16s ease;
}
.rg5-opt svg{flex:0 0 auto}
.rg5-opt input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.rg5-opt:hover:not(.is-on){color:var(--ink,#101828);background:color-mix(in oklch,var(--ink,#101828) 5%,transparent)}
.rg5-opt.is-on{color:var(--ink,#101828)}
.rg5-opt.is-on svg{color:var(--accent,oklch(0.5 0.17 257))}
.rg5-opt:has(input:focus-visible){outline:3px solid oklch(from var(--rg5-focus) l c h / 0.6);outline-offset:2px}
.rg5-fs:disabled .rg5-opt,.rg5-fs:disabled .rg5-opt input{cursor:not-allowed}
.rg5-hint{
margin-top:12px;
font-size:.9375rem;
line-height:1.4;
font-weight:500;
color:var(--muted,#475467);
text-wrap:pretty;
}
.rg5-fields{display:grid;gap:16px;margin-top:20px}
.rg5-sms{display:grid;gap:16px;animation:rg5-in .45s cubic-bezier(.2,.7,.2,1) both}
.rg5-label{display:block;margin-bottom:8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink,#101828))}
.rg5-ctl{position:relative}
.rg5-ico{
position:absolute;
left:16px;
top:50%;
transform:translateY(-50%);
pointer-events:none;
color:color-mix(in oklch,var(--field-ink,#101828) 60%,var(--field,#ffffff));
}
.rg5-input{
width:100%;
height:56px;
padding:0 16px 0 46px;
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;
outline:none;
box-shadow:inset 0 1px 2px oklch(from var(--rg5-shadow) l c h / 0.08);
transition:border-color .16s ease,box-shadow .16s ease;
}
.rg5-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#ffffff));opacity:1}
.rg5-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink,#101828) 40%,transparent)}
.rg5-input:focus{border-color:var(--rg5-focus);box-shadow:0 0 0 3px oklch(from var(--rg5-focus) l c h / 0.35)}
.rg5-f.is-bad .rg5-input{border-color:var(--danger,oklch(0.5 0.17 27))}
.rg5-f.is-bad .rg5-input:focus{box-shadow:0 0 0 3px oklch(from var(--danger,oklch(0.5 0.17 27)) l c h / 0.3)}
.rg5-input:disabled{background:color-mix(in oklch,var(--ink,#101828) 4%,var(--field,#ffffff));cursor:not-allowed}
.rg5-err{
margin-top:8px;
font-size:.9375rem;
line-height:1.4;
font-weight:600;
color:var(--danger,oklch(0.5 0.17 27));
text-wrap:pretty;
}
.rg5-err svg,.rg5-alert svg,.rg5-privacy svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.rg5-consent{
display:grid;
grid-template-columns:22px minmax(0,1fr);
gap:12px;
align-items:start;
padding:14px 16px;
border-radius:10px;
background:var(--rg5-well);
border:1px solid transparent;
}
.rg5-consent.is-bad{border-color:oklch(from var(--danger,oklch(0.5 0.17 27)) l c h / 0.6)}
.rg5-consent input{width:22px;height:22px;margin:1px 0 0;accent-color:var(--accent,oklch(0.5 0.17 257));cursor:pointer}
.rg5-consent input:focus-visible{outline:3px solid oklch(from var(--rg5-focus) l c h / 0.6);outline-offset:2px}
.rg5-consent label{font-size:.9375rem;line-height:1.45;color:var(--ink,#101828);cursor:pointer;text-wrap:pretty}
.rg5-alert{
margin-top:16px;
padding:12px 14px;
border-radius:10px;
background:var(--danger-soft,oklch(0.93 0.024 27));
color:var(--danger,oklch(0.5 0.17 27));
font-size:.9375rem;
font-weight:600;
line-height:1.4;
}
.rg5-btn{
width:100%;
min-height:72px;
margin-top:24px;
padding:10px 28px;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
gap:3px;
border:0;
border-radius:var(--button-radius,var(--radius,12px));
background:linear-gradient(oklch(from var(--rg5-btn) calc(l + 0.04) c h),oklch(from var(--rg5-btn-2) 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(--rg5-btn) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--rg5-btn) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rg5-shadow) l c h / 0.3),0 8px 16px -6px oklch(from var(--rg5-shadow) l c h / 0.45));
transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
}
.rg5-btn-main{font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15}
.rg5-btn-sub{font-family:var(--font-body,inherit);font-size:.9375rem;font-weight:600;line-height:1.3;text-transform:none;text-wrap:pretty}
.rg5-btn-load{display:inline-flex;align-items:center;justify-content:center;gap:10px}
.rg5-btn:not(:disabled):hover,.is-hover .rg5-btn{
background:linear-gradient(oklch(from var(--rg5-btn) calc(l - 0.01) c h),oklch(from var(--rg5-btn-2) calc(l - 0.07) c h));
box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--rg5-btn) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--rg5-btn) calc(l - 0.2) c h),0 1px 2px oklch(from var(--rg5-shadow) l c h / 0.34),0 10px 18px -6px oklch(from var(--rg5-shadow) l c h / 0.55));
}
.rg5-btn:not(:disabled):active,.is-active .rg5-btn{
transform:translateY(1px);
background:linear-gradient(oklch(from var(--rg5-btn) calc(l - 0.05) c h),oklch(from var(--rg5-btn-2) calc(l - 0.08) c h));
box-shadow:inset 0 2px 4px oklch(from var(--rg5-btn) calc(l - 0.24) c h / 0.55),inset 0 -2px 0 oklch(from var(--rg5-btn) calc(l - 0.16) c h),0 1px 2px oklch(from var(--rg5-shadow) l c h / 0.3);
}
.rg5-btn:disabled{
background:color-mix(in oklab,var(--rg5-btn) 26%,var(--secondary,oklch(0.93 0.015 263)));
color:var(--secondary-ink,var(--ink,#101828));
text-shadow:none;
box-shadow:var(--button-2-shadow,var(--shadow-sm,0 1px 1px oklch(0.22 0.03 260 / 0.18),0 1px 3px oklch(0.22 0.03 260 / 0.14)));
}
.rg5-btn:disabled{cursor:not-allowed}
.rg5-btn:focus-visible{outline:3px solid oklch(from var(--rg5-focus) l c h / 0.7);outline-offset:3px}
.rg5-privacy{
margin-top:16px;
padding:14px 16px;
border-radius:10px;
background:var(--rg5-well);
font-size:.9375rem;
line-height:1.45;
color:var(--ink,#101828);
text-wrap:pretty;
}
.rg5-privacy svg{color:var(--success,oklch(0.5 0.14 150));vertical-align:-0.2em}
.rg5-privacy strong{font-weight:800}
.rg5-spin{animation:rg5-spin .8s linear infinite}
@keyframes rg5-spin{to{transform:rotate(360deg)}}
@keyframes rg5-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (max-width:900px){
.cf-results-gate-5{--rg5-max:560px}
.rg5-wrap{grid-template-columns:minmax(0,1fr);row-gap:28px}
.rg5-light{
top:32px;
left:-50vw;
right:-50vw;
clip-path:polygon(0 128px,100% 0,100% 100%,0 100%);
}
.rg5-copy-in{padding-top:0;padding-bottom:8px}
.rg5-points{margin-top:20px}
.rg5-point.is-extra,.rg5-point.is-reason .rg5-body{display:none}
}
@media (max-width:520px){
.rg5-opt{flex-direction:column;gap:4px;min-height:64px;padding:8px;font-size:.9375rem}
.rg5-opt span{text-wrap:balance}
.rg5-img{width:72px;height:72px}
.rg5-head{gap:12px}
}
@media (prefers-reduced-motion:reduce){
.rg5-copy-in,.rg5-card,.rg5-sms,.rg5-spin{animation:none}
.rg5-thumb,.rg5-opt,.rg5-input,.rg5-btn{transition:none}
.rg5-btn:not(:disabled):active,.is-active .rg5-btn{transform:none}
}
`
pieces/forms/results-gate-5/specimen.tsx 48 lines
import __studioImage80ee35be from "../assets/e66199ac0da8a496.webp";
import * as React from 'react'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
import { ResultsGate5, type ResultsGate5State } from '../results-gate-5'
const REPORT = __studioImage80ee35be
const emailField = defaults.sample.fields.find((field) => field.name === 'email')
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ResultsGate5Specimen({ state = 'default' }: { state?: ResultsGate5State }) {
return (
<ResultsGate5
key={state}
state={state}
headline='Your Home Solar Fit Check is ready'
highlight='is ready'
lead='Brightbarn Solar built it from the answers you just gave about your roof, your home and the power you use.'
points={[
{
title: 'Know if your roof is a fit before anyone visits',
body: 'Your report walks through roof fit, sun exposure and the questions worth asking any installer.',
},
]}
reason={{
title: 'We email it so your whole household can read it',
body: 'Solar is a family decision. Forward the report, read it together tonight and decide on your own time.',
}}
reportImage={slot('product', REPORT)}
reportImageAlt='Brightbarn Solar Home Solar Fit Check report beside a phone'
formTitle='Where should we send your Fit Check?'
emailHint='We’ll email your report so you can forward it to your household.'
smsHint='We’ll email your report and text you a link to open it anywhere.'
emailLabel={emailField?.label ?? 'Email address'}
consentText='Yes, Brightbarn Solar may text me my Fit Check link and follow-up about my home at this number. Msg & data rates may apply. Reply STOP to opt out, HELP for help. Consent is not a condition of purchase.'
label='Send My Fit Check'
sublabel='Free report · straight to your inbox'
smsSublabel='Free report · to your inbox and phone'
loadingLabel='Sending your Fit Check…'
privacyTitle='Your details stay with Brightbarn.'
privacy='We never sell or share your email or number. One click or one text reply stops everything.'
onSubmit={() => new Promise<void>((resolve) => setTimeout(resolve, 1200))}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalResultsGate5 |
string |
Default 'Your results are ready to send'
|
highlight OptionalResultsGate5 |
string |
Default 'ready to send'
|
lead OptionalResultsGate5 |
string |
Default 'Your report is built from the answers you just gave.'
|
points OptionalResultsGate5 |
ResultsGate5Point[] |
Default []
|
reason OptionalResultsGate5 |
ResultsGate5Point |
Default { title: 'We email it so your household can read it too', body: 'Forward it, read it together and decide on your own time.' }
|
backdropImage OptionalResultsGate5 |
string |
Default home
|
reportImage OptionalResultsGate5 |
string |
|
reportImageAlt OptionalResultsGate5 |
string |
Default ''
|
formTitle OptionalResultsGate5 |
string |
Default 'How should we send your report?'
|
emailOption OptionalResultsGate5 |
string |
Default 'Email me'
|
smsOption OptionalResultsGate5 |
string |
Default 'Email + text me'
|
emailHint OptionalResultsGate5 |
string |
Default 'We’ll email your report so you can forward it.'
|
smsHint OptionalResultsGate5 |
string |
Default 'We’ll email your report and text you a link to it.'
|
firstNameLabel OptionalResultsGate5 |
string |
Default 'First name'
|
firstNamePlaceholder OptionalResultsGate5 |
string |
Default 'Jane'
|
emailLabel OptionalResultsGate5 |
string |
Default 'Email address'
|
emailPlaceholder OptionalResultsGate5 |
string |
Default 'you@example.com'
|
phoneLabel OptionalResultsGate5 |
string |
Default 'Mobile number'
|
phonePlaceholder OptionalResultsGate5 |
string |
Default '(555) 123-4567'
|
consentText OptionalResultsGate5 |
React.ReactNode |
Default 'Yes, text me my report link and follow-up messages at this number. Message and data rates may apply. Reply STOP to opt out.'
|
label OptionalResultsGate5 |
string |
Default 'Send My Report'
|
sublabel OptionalResultsGate5 |
string |
Default 'Straight to your inbox'
|
smsSublabel OptionalResultsGate5 |
string |
Default 'To your inbox and your phone'
|
loadingLabel OptionalResultsGate5 |
string |
Default 'Sending your report…'
|
privacyTitle OptionalResultsGate5 |
string |
Default 'Your details stay private.'
|
privacy OptionalResultsGate5 |
string |
Default 'We use them only to send your report and follow up about it. We never sell them.'
|
nameError OptionalResultsGate5 |
string |
Default 'Add your first name so we know who the report is for.'
|
emailError OptionalResultsGate5 |
string |
Default 'Enter a valid email so we can send your report.'
|
phoneError OptionalResultsGate5 |
string |
Default 'Enter a mobile number with area code, or switch to email only.'
|
consentError OptionalResultsGate5 |
string |
Default 'Tick the box so we’re allowed to text you, or switch to email only.'
|
error OptionalResultsGate5 |
string |
Default 'We couldn’t send your report just now. Please try again.'
|
defaultDelivery OptionalResultsGate5 |
ResultsGate5Delivery |
|
headingLevel OptionalResultsGate5 |
'h2' | 'h3' |
Default 'h2'
|
state OptionalResultsGate5 |
ResultsGate5State |
Default 'default'
|
onSubmit OptionalResultsGate5 |
(values: ResultsGate5Values) => void | Promise<void> |
|
className OptionalResultsGate5 |
string |
|
style OptionalResultsGate5 |
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-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).
-
4b82104bfd627615.webp
image/webp · 44.9 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
e66199ac0da8a496.webp
image/webp · 43.3 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB