Closing Opt-in 6
Closing opt-in block: a scoreboard of the free guide's own numbers on the dark band makes the freebie feel substantial. The final tile takes the email, an optional SMS consent that reveals the mobile field under its legal line, and the two-line button. The builder wires onSubmit.
Use it in a prompt
Use forms/closing-optin-6 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/closing-optin-6.tsx. - Import it and pass your copy and images (Props tab):
import { ClosingOptin6 } from "@/components/funneldna/forms/closing-optin-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/closing-optin-6/component.tsx 527 lines
// layout: fact-scoreboard
// Closing opt-in block: a scoreboard of the free guide's own numbers on the dark band makes the freebie feel substantial. The final tile takes the email, an optional SMS consent that reveals the mobile field under its legal line, and the two-line button. The builder wires onSubmit.
import React from 'react'
import { AlertCircle, BadgePercent, Check, Loader2, Lock } from 'lucide-react'
import { FX_HOST, Texture } from '../fx/fx'
import linen from '../fx/textures/linen'
export type ClosingOptin6Fact = {
// the big number, shown exactly as supplied (never a count-up)
value: string
// short unit under the number, e.g. 'Pages'
unit?: string
// one short line that makes the number concrete
label?: React.ReactNode
// optional lucide icon for the tile's disc
icon?: React.ReactNode
}
export type ClosingOptin6Values = {
email: string
smsConsent: boolean
// present only when smsConsent is true
phone?: string
}
export type ClosingOptin6State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ClosingOptin6Copy = {
emailRequired?: string
emailInvalid?: string
phoneRequired?: string
phoneInvalid?: string
// button label while onSubmit's promise is pending
pending?: string
}
export type ClosingOptin6Props = {
// the page promise restated in one line
headline?: React.ReactNode
lead?: React.ReactNode
// supplied facts about the freebie (two to four read best); nothing shows when empty
facts?: ClosingOptin6Fact[]
// slot: scene. A photo of the finished result; the tile is left out when empty
sceneImage?: string
sceneAlt?: string
formHeading?: React.ReactNode
emailLabel?: string
emailPlaceholder?: string
// the SMS option renders only when its legal line is supplied
smsLabel?: React.ReactNode
smsLegal?: React.ReactNode
phoneLabel?: string
phonePlaceholder?: string
// one-line first-order discount; rendered only when supplied
discount?: React.ReactNode
// button action line
label?: React.ReactNode
// button benefit line, inside the button
sublabel?: React.ReactNode
// P.S. line under the button; rendered only when supplied
ps?: React.ReactNode
psLead?: string
privacy?: React.ReactNode
copy?: ClosingOptin6Copy
// start with the SMS option ticked (and the mobile field open)
defaultSmsChecked?: boolean
// receives validated, trimmed values; return a promise to show the busy state until it settles
onSubmit?: (values: ClosingOptin6Values) => void | Promise<unknown>
disabled?: boolean
state?: ClosingOptin6State
id?: string
className?: string
}
const DEFAULT_COPY: Required<ClosingOptin6Copy> = {
emailRequired: 'Please enter your email address.',
emailInvalid: 'That email looks incomplete. Try something like you@example.com.',
phoneRequired: 'Enter your mobile number, or untick the text option.',
phoneInvalid: 'That number looks too short. Include your area code.',
pending: 'Sending your guide…',
}
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]+$/
type Errors = { email?: string; phone?: string }
export function ClosingOptin6(props: ClosingOptin6Props) {
const {
headline = 'Everything inside your free guide',
lead = 'Enter your email and we’ll send the guide straight to your inbox.',
facts = [],
sceneImage,
sceneAlt = '',
formHeading = 'Send me the free guide',
emailLabel = 'Email address',
emailPlaceholder = 'you@example.com',
smsLabel = 'Text me reminders and tips',
smsLegal,
phoneLabel = 'Mobile number',
phonePlaceholder = '(555) 123-4567',
discount,
label = 'Send Me The Free Guide',
sublabel = 'Free PDF · Sent by email',
ps,
psLead = 'P.S.',
privacy = 'We respect your inbox. Unsubscribe anytime.',
copy,
defaultSmsChecked = false,
onSubmit,
disabled = false,
state = 'default',
id,
className,
} = props
const c: Required<ClosingOptin6Copy> = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const ids = {
head: uid + '-head',
form: uid + '-form',
email: uid + '-email',
emailErr: uid + '-email-err',
sms: uid + '-sms',
legal: uid + '-legal',
mob: uid + '-mob',
phone: uid + '-phone',
phoneErr: uid + '-phone-err',
}
const hasSms = Boolean(smsLegal)
const isDisabled = disabled || state === 'disabled'
const forceError = state === 'error'
const [email, setEmail] = React.useState('')
const [phone, setPhone] = React.useState('')
const [smsOn, setSmsOn] = React.useState(() => hasSms && (defaultSmsChecked || forceError))
const [errors, setErrors] = React.useState<Errors>(() => (forceError ? check('', '', hasSms, c) : {}))
const [pending, setPending] = React.useState(false)
const [reveal, setReveal] = React.useState<'idle' | 'armed' | 'seen'>('idle')
const rootRef = React.useRef<HTMLElement | null>(null)
const emailRef = React.useRef<HTMLInputElement | null>(null)
const phoneRef = React.useRef<HTMLInputElement | null>(null)
const mounted = React.useRef(true)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
React.useEffect(() => {
if (forceError) {
if (hasSms) setSmsOn(true)
setErrors(check('', '', hasSms, c))
} else {
setSmsOn(hasSms && defaultSmsChecked)
setErrors({})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
// the board renders finished first; only when motion is allowed is it armed and played once in view
React.useEffect(() => {
const el = rootRef.current
if (!el || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
setReveal('armed')
const io = new IntersectionObserver(
(entries) => {
if (entries.some((entry) => entry.isIntersecting)) {
setReveal('seen')
io.disconnect()
}
},
{ threshold: 0.15 },
)
io.observe(el)
return () => io.disconnect()
}, [])
const changeEmail = (value: string) => {
setEmail(value)
if (errors.email && !emailError(value, c)) setErrors((e) => ({ ...e, email: undefined }))
}
const changePhone = (value: string) => {
setPhone(value)
if (errors.phone && !phoneError(value, c)) setErrors((e) => ({ ...e, phone: undefined }))
}
const toggleSms = (on: boolean) => {
setSmsOn(on)
if (!on) setErrors((e) => ({ ...e, phone: undefined }))
}
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled || pending) return
const found = check(email, phone, smsOn, c)
setErrors(found)
if (found.email) {
emailRef.current?.focus()
return
}
if (found.phone) {
phoneRef.current?.focus()
return
}
const values: ClosingOptin6Values = { email: email.trim(), smsConsent: smsOn }
if (smsOn) values.phone = phone.trim()
const result: unknown = onSubmit?.(values)
if (isThenable(result)) {
setPending(true)
const done = () => {
if (mounted.current) setPending(false)
}
result.then(done, done)
}
}
const hasPhoto = Boolean(sceneImage)
const cells = facts.length + (hasPhoto ? 1 : 0)
const rows = Math.max(1, Math.ceil(cells / 2))
const oddLg = cells % 2 === 1
const oddSm = facts.length % 2 === 1
return (
<section
ref={rootRef}
id={id}
className={cx('cf-closing-optin-6', className)}
style={FX_HOST}
aria-labelledby={ids.head}
data-reveal={reveal}
>
<style>{CSS}</style>
<Texture src={linen} tone='band-ink' />
<div className='co6-wrap'>
<header className='co6-head'>
<h2 id={ids.head} className='co6-h2'>{headline}</h2>
{lead ? <p className='co6-lead'>{lead}</p> : null}
</header>
<div className='co6-board'>
{facts.map((fact, i) => {
const last = i === facts.length - 1
return (
<div
key={i}
className={cx('co6-tile co6-fact', oddSm && last && 'co6-wide-sm', oddLg && !hasPhoto && last && 'co6-wide-lg')}
style={vars({ '--i': i })}
>
{fact.icon ? <span className='co6-icon' aria-hidden='true'>{fact.icon}</span> : null}
<div className='co6-fact-body'>
<p className='co6-num'>
{fact.value}
{fact.unit ? <span className='co6-unit'>{fact.unit}</span> : null}
</p>
{fact.label ? <p className='co6-label'>{fact.label}</p> : null}
</div>
</div>
)
})}
{hasPhoto ? (
<figure className={cx('co6-tile co6-photo', oddLg && 'co6-wide-lg')} style={vars({ '--i': facts.length })}>
<img src={sceneImage} alt={sceneAlt} width={960} height={720} loading='lazy' decoding='async' />
</figure>
) : null}
<form
className={cx('co6-tile co6-form', cells === 0 && 'is-solo')}
style={vars({ '--co6-rows': rows, '--i': cells })}
noValidate
onSubmit={handleSubmit}
aria-labelledby={ids.form}
aria-busy={pending || undefined}
>
<h3 id={ids.form} className='co6-h3'>{formHeading}</h3>
<fieldset className='co6-fs' disabled={isDisabled}>
<div className='co6-field'>
<label htmlFor={ids.email}>{emailLabel}</label>
<input
ref={emailRef}
id={ids.email}
name='email'
type='email'
inputMode='email'
autoComplete='email'
placeholder={emailPlaceholder}
className='co6-input'
value={email}
onChange={(e) => changeEmail(e.target.value)}
onBlur={() => {
if (email.trim()) setErrors((e) => ({ ...e, email: emailError(email, c) }))
}}
aria-invalid={errors.email ? true : undefined}
aria-describedby={errors.email ? ids.emailErr : undefined}
required
/>
{errors.email ? (
<p id={ids.emailErr} className='co6-err' role='alert'>
<AlertCircle aria-hidden='true' />
{errors.email}
</p>
) : null}
</div>
{hasSms ? (
<div className={cx('co6-consent', smsOn && 'is-on')}>
<label className='co6-check' htmlFor={ids.sms}>
<input
id={ids.sms}
type='checkbox'
name='smsConsent'
checked={smsOn}
onChange={(e) => toggleSms(e.target.checked)}
aria-describedby={ids.legal}
aria-controls={ids.mob}
/>
<span className='co6-box' aria-hidden='true'>
<Check strokeWidth={3} />
</span>
<span className='co6-check-text'>{smsLabel}</span>
</label>
<p id={ids.legal} className='co6-legal'>{smsLegal}</p>
<div id={ids.mob} className='co6-mob' aria-hidden={!smsOn}>
<div className='co6-mob-inner'>
<div className='co6-mob-pad co6-field'>
<label htmlFor={ids.phone}>{phoneLabel}</label>
<input
ref={phoneRef}
id={ids.phone}
name='phone'
type='tel'
inputMode='tel'
autoComplete='tel'
placeholder={phonePlaceholder}
className='co6-input'
value={phone}
onChange={(e) => changePhone(e.target.value)}
onBlur={() => {
if (phone.trim()) setErrors((e) => ({ ...e, phone: phoneError(phone, c) }))
}}
disabled={!smsOn}
required={smsOn}
aria-invalid={smsOn && errors.phone ? true : undefined}
aria-describedby={smsOn && errors.phone ? ids.phoneErr : undefined}
/>
{smsOn && errors.phone ? (
<p id={ids.phoneErr} className='co6-err' role='alert'>
<AlertCircle aria-hidden='true' />
{errors.phone}
</p>
) : null}
</div>
</div>
</div>
</div>
) : null}
{discount ? (
<p className='co6-deal'>
<BadgePercent aria-hidden='true' />
{discount}
</p>
) : null}
<div className='co6-action'>
<button
type='submit'
className={cx('co6-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active', pending && 'is-busy')}
disabled={isDisabled || pending}
>
<span className='co6-btn-main'>
{pending ? (
<>
<Loader2 className='co6-spin' aria-hidden='true' />
{c.pending}
</>
) : (
label
)}
</span>
{sublabel ? <span className='co6-btn-sub'>{sublabel}</span> : null}
</button>
{ps ? (
<p className='co6-ps'>
<strong>{psLead}</strong> {ps}
</p>
) : null}
{privacy ? (
<p className='co6-privacy'>
<Lock aria-hidden='true' />
{privacy}
</p>
) : null}
</div>
</fieldset>
</form>
</div>
</div>
</section>
)
}
export default ClosingOptin6
function emailError(value: string, c: Required<ClosingOptin6Copy>): string | undefined {
const v = value.trim()
if (!v) return c.emailRequired
return EMAIL.test(v) ? undefined : c.emailInvalid
}
function phoneError(value: string, c: Required<ClosingOptin6Copy>): string | undefined {
const digits = value.replace(/[^0-9]/g, '')
if (!digits) return c.phoneRequired
return digits.length < 10 ? c.phoneInvalid : undefined
}
function check(email: string, phone: string, sms: boolean, c: Required<ClosingOptin6Copy>): Errors {
return { email: emailError(email, c), phone: sms ? phoneError(phone, c) : undefined }
}
function isThenable(value: unknown): value is PromiseLike<unknown> {
return typeof value === 'object' && value !== null && typeof (value as { then?: unknown }).then === 'function'
}
function cx(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ')
}
function vars(values: Record<string, string | number>): React.CSSProperties {
return values as React.CSSProperties
}
const CSS = `
.cf-closing-optin-6{--co6-bg:var(--button-bg,var(--cta,oklch(0.58 0.21 29)));--co6-bg2:var(--button-bg-2,var(--cta-2,oklch(0.51 0.21 29)));--co6-sh:var(--shadow,oklch(0.22 0.03 256));--co6-band:var(--band,oklch(0.27 0.067 256));--co6-bink:var(--band-ink,#fff);position:relative;overflow:hidden;background:var(--co6-band);color:var(--co6-bink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
.cf-closing-optin-6 *,.cf-closing-optin-6 *::before,.cf-closing-optin-6 *::after{box-sizing:border-box}
.cf-closing-optin-6 .co6-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-closing-optin-6 .co6-head{max-width:46rem}
.cf-closing-optin-6 .co6-h2{margin:0;color:var(--co6-bink);font-family:var(--font-display);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}
.cf-closing-optin-6 .co6-lead{margin:16px 0 0;max-width:60ch;color:var(--co6-bink);font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-closing-optin-6 .co6-board{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr);gap:16px;margin-top:clamp(32px,4vw,48px);align-items:stretch}
.cf-closing-optin-6 .co6-tile{border-radius:var(--card-radius,var(--radius,14px))}
.cf-closing-optin-6 .co6-fact{display:flex;flex-direction:column;gap:24px;min-width:0;min-height:200px;padding:clamp(20px,3vw,32px);color:var(--co6-bink);background:color-mix(in oklch,var(--co6-bink) 7%,var(--co6-band));border:1px solid oklch(from var(--co6-bink) l c h / 0.14);box-shadow:inset 0 1px 0 oklch(from var(--co6-bink) l c h / 0.1),0 1px 2px oklch(from var(--co6-sh) calc(l - 0.08) c h / 0.45),0 10px 20px -10px oklch(from var(--co6-sh) calc(l - 0.08) c h / 0.6)}
.cf-closing-optin-6 .co6-icon{display:grid;place-items:center;flex:0 0 auto;width:40px;height:40px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
.cf-closing-optin-6 .co6-icon svg{width:20px;height:20px;stroke-width:2.5}
.cf-closing-optin-6 .co6-fact-body{margin-top:auto}
.cf-closing-optin-6 .co6-num{margin:0;color:var(--co6-bink);font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2.75rem,5.4vw,4.75rem);line-height:0.95;letter-spacing:-0.03em;font-variant-numeric:tabular-nums}
.cf-closing-optin-6 .co6-unit{display:block;margin-top:10px;font-family:var(--font-body);font-size:14px;line-height:1.2;font-weight:800;letter-spacing:0.08em;text-transform:uppercase}
.cf-closing-optin-6 .co6-label{margin:24px 0 0;padding-top:16px;border-top:1px solid oklch(from var(--co6-bink) l c h / 0.16);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.45;font-weight:500;text-wrap:pretty}
.cf-closing-optin-6 .co6-photo{position:relative;margin:0;min-width:0;min-height:220px;overflow:hidden;background:color-mix(in oklch,var(--co6-bink) 7%,var(--co6-band))}
.cf-closing-optin-6 .co6-photo img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center 45%}
.cf-closing-optin-6 .co6-wide-lg{grid-column:span 2}
.cf-closing-optin-6 .co6-form{grid-column:3;grid-row:1 / span var(--co6-rows,2);display:flex;flex-direction:column;min-width:0;margin:0;padding:clamp(20px,3vw,32px);background:var(--card,#fff);color:var(--ink,#101828);border:1px solid color-mix(in oklch,var(--accent,#2563eb) 30%,var(--card,#fff));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 256 / 0.22),0 12px 24px -8px oklch(0.22 0.03 256 / 0.32)))}
.cf-closing-optin-6 .co6-form.is-solo{grid-column:1 / -1;grid-row:auto;width:100%;max-width:34rem}
.cf-closing-optin-6 .co6-h3{margin:0 0 20px;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-closing-optin-6 .co6-fs{display:flex;flex-direction:column;flex:1;margin:0;padding:0;border:0;min-width:0;min-inline-size:0}
.cf-closing-optin-6 .co6-field label{display:block;margin-bottom:8px;color:var(--label-ink,var(--ink));font-size:16px;line-height:1.3;font-weight:700}
.cf-closing-optin-6 .co6-input{display:block;width:100%;height:56px;margin:0;padding:0 16px;font:inherit;font-family:var(--font-body);font-size:17px;color:var(--field-ink,#101828);background:var(--field,#fff);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--co6-sh) l c h / 0.08);outline:2px solid transparent;transition:border-color .16s ease,box-shadow .16s ease}
.cf-closing-optin-6 .co6-input::placeholder{color:color-mix(in oklch,var(--field-ink,#101828) 65%,var(--field,#fff));opacity:1}
.cf-closing-optin-6 .co6-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink,#101828) 40%,var(--field,#fff))}
.cf-closing-optin-6 .co6-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-closing-optin-6 .co6-input[aria-invalid='true']{border-color:var(--danger)}
.cf-closing-optin-6 .co6-input[aria-invalid='true']:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.3)}
.cf-closing-optin-6 .co6-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink,#101828) 5%,var(--field,#fff))}
.cf-closing-optin-6 .co6-err{margin:8px 0 0;color:var(--danger);font-size:15px;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-closing-optin-6 .co6-err svg,.cf-closing-optin-6 .co6-deal svg,.cf-closing-optin-6 .co6-privacy svg{display:inline-block;width:16px;height:16px;vertical-align:-0.15em;margin-inline-end:.4em;stroke-width:2.5}
.cf-closing-optin-6 .co6-consent{margin-top:16px;padding:16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card,#fff));transition:background .2s ease}
.cf-closing-optin-6 .co6-consent.is-on{background:color-mix(in oklch,var(--accent) 8%,var(--card,#fff))}
.cf-closing-optin-6 .co6-check{position:relative;display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;cursor:pointer}
.cf-closing-optin-6 .co6-check input{position:absolute;left:0;top:0;width:24px;height:24px;margin:0;opacity:0;cursor:pointer}
.cf-closing-optin-6 .co6-box{display:grid;place-items:center;width:24px;height:24px;border-radius:6px;border:2px solid color-mix(in oklch,var(--ink) 45%,var(--card,#fff));background:var(--field,#fff);color:var(--card,#fff);transition:background .16s ease,border-color .16s ease}
.cf-closing-optin-6 .co6-box svg{width:16px;height:16px;opacity:0;transform:scale(.6);transition:opacity .16s ease,transform .16s ease}
.cf-closing-optin-6 .co6-check:hover .co6-box{border-color:var(--accent)}
.cf-closing-optin-6 .co6-check input:checked + .co6-box{background:var(--accent);border-color:var(--accent)}
.cf-closing-optin-6 .co6-check input:checked + .co6-box svg{opacity:1;transform:none}
.cf-closing-optin-6 .co6-check input:focus-visible + .co6-box{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
.cf-closing-optin-6 .co6-check-text{padding-top:1px;color:var(--ink);font-size:16px;line-height:1.35;font-weight:700;text-wrap:pretty}
.cf-closing-optin-6 .co6-fs:disabled .co6-check,.cf-closing-optin-6 .co6-fs:disabled .co6-check input{cursor:not-allowed}
.cf-closing-optin-6 .co6-fs:disabled .co6-box{opacity:.6}
.cf-closing-optin-6 .co6-legal{margin:8px 0 0 36px;color:var(--ink);font-size:14px;line-height:1.45;font-weight:500;text-wrap:pretty}
.cf-closing-optin-6 .co6-mob{display:grid;grid-template-rows:0fr;visibility:hidden;transition:grid-template-rows .3s cubic-bezier(.2,.7,.2,1),visibility 0s linear .3s}
.cf-closing-optin-6 .co6-consent.is-on .co6-mob{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows .3s cubic-bezier(.2,.7,.2,1),visibility 0s}
.cf-closing-optin-6 .co6-mob-inner{min-height:0;overflow:hidden;margin:0 -4px}
.cf-closing-optin-6 .co6-mob-pad{padding:16px 4px 4px}
.cf-closing-optin-6 .co6-deal{margin:16px 0 0;padding:10px 14px;border-radius:10px;background:var(--success-soft);color:var(--success);font-size:15px;line-height:1.4;font-weight:700;text-wrap:pretty}
.cf-closing-optin-6 .co6-action{margin-top:auto;padding-top:24px}
.cf-closing-optin-6 .co6-btn{appearance:none;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:72px;margin:0;padding:12px 24px;border:0;border-radius:var(--button-radius,var(--radius,12px));color:var(--button-ink,var(--cta-ink,#fff));font-family:var(--button-font,var(--font-display));text-align:center;text-transform:var(--button-case,none);text-shadow:var(--button-text-shadow,none);cursor:pointer;background:linear-gradient(oklch(from var(--co6-bg) calc(l + 0.04) c h),oklch(from var(--co6-bg2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--co6-bg) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--co6-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--co6-sh) l c h / 0.35),0 8px 16px -6px oklch(from var(--co6-sh) l c h / 0.45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-closing-optin-6 .co6-btn:hover:not(:disabled),.cf-closing-optin-6 .co6-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--co6-bg) calc(l - 0.01) c h),oklch(from var(--co6-bg2) calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--co6-bg) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--co6-bg) calc(l - 0.2) c h),0 1px 2px oklch(from var(--co6-sh) l c h / 0.4),0 10px 18px -6px oklch(from var(--co6-sh) l c h / 0.55))}
.cf-closing-optin-6 .co6-btn:active:not(:disabled),.cf-closing-optin-6 .co6-btn.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--co6-bg) calc(l - 0.05) c h),oklch(from var(--co6-bg2) calc(l - 0.09) c h));box-shadow:inset 0 2px 4px oklch(from var(--co6-bg) calc(l - 0.22) c h / 0.45),inset 0 -2px 0 oklch(from var(--co6-bg) calc(l - 0.16) c h),0 1px 1px oklch(from var(--co6-sh) l c h / 0.3)}
.cf-closing-optin-6 .co6-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-closing-optin-6 .co6-btn:disabled:not(.is-busy){cursor:not-allowed;background:var(--secondary,oklch(0.93 0.015 263));color:var(--secondary-ink,var(--ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none}
.cf-closing-optin-6 .co6-btn.is-busy{cursor:progress}
.cf-closing-optin-6 .co6-btn-main{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;font-weight:var(--button-weight,800);text-wrap:balance}
.cf-closing-optin-6 .co6-btn-sub{font-family:var(--font-body);font-size:15px;line-height:1.3;font-weight:600;letter-spacing:0;text-transform:none;text-wrap:pretty}
.cf-closing-optin-6 .co6-spin{width:20px;height:20px;stroke-width:2.5;animation:co6-spin .8s linear infinite}
.cf-closing-optin-6 .co6-ps{margin:16px 0 0;color:var(--ink);font-size:15px;line-height:1.45;font-weight:500;text-wrap:pretty}
.cf-closing-optin-6 .co6-ps strong{font-weight:800}
.cf-closing-optin-6 .co6-privacy{margin:8px 0 0;color:var(--muted);font-size:15px;line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-closing-optin-6[data-reveal='armed'] .co6-tile{opacity:.82;transform:translateY(8px)}
.cf-closing-optin-6[data-reveal='seen'] .co6-tile{animation:co6-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:min(calc(var(--i,0) * 0.07s),0.28s)}
@keyframes co6-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes co6-spin{to{transform:rotate(360deg)}}
@media (max-width:960px){
.cf-closing-optin-6 .co6-board{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.cf-closing-optin-6 .co6-wide-lg{grid-column:auto}
.cf-closing-optin-6 .co6-wide-sm,.cf-closing-optin-6 .co6-photo,.cf-closing-optin-6 .co6-form{grid-column:1 / -1}
.cf-closing-optin-6 .co6-form{grid-row:auto}
.cf-closing-optin-6 .co6-form.is-solo{max-width:none}
.cf-closing-optin-6 .co6-fact{min-height:0}
.cf-closing-optin-6 .co6-photo{min-height:0;aspect-ratio:16 / 10}
}
@media (max-width:560px){
.cf-closing-optin-6 .co6-fact{gap:20px;padding:20px}
.cf-closing-optin-6 .co6-label{font-size:16px;margin-top:24px;padding-top:12px}
.cf-closing-optin-6 .co6-photo{aspect-ratio:4 / 3}
.cf-closing-optin-6 .co6-form{padding:20px}
.cf-closing-optin-6 .co6-btn{padding:12px 14px}
}
@media (prefers-reduced-motion: reduce){
.cf-closing-optin-6[data-reveal] .co6-tile{animation:none;opacity:1;transform:none}
.cf-closing-optin-6 .co6-mob,.cf-closing-optin-6 .co6-consent.is-on .co6-mob,.cf-closing-optin-6 .co6-box,.cf-closing-optin-6 .co6-box svg,.cf-closing-optin-6 .co6-btn,.cf-closing-optin-6 .co6-input,.cf-closing-optin-6 .co6-consent{transition:none}
.cf-closing-optin-6 .co6-spin{animation:none}
}
`
pieces/forms/closing-optin-6/specimen.tsx 34 lines
import __studioImagef6086ff9 from "../assets/a0586c66907e2c7d.webp";
// Specimen: Wildrise Bakehouse’s free Sourdough Starter Guide as a closing scoreboard opt-in.
import React from 'react'
import { BookOpen, Timer, Wheat } from 'lucide-react'
import { ClosingOptin6, type ClosingOptin6State } from '../closing-optin-6'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ClosingOptin6Specimen({ state = 'default' }: { state?: ClosingOptin6State }) {
return (
<ClosingOptin6
state={state}
headline='Bake your first real loaf in 72 hours'
lead='Get Wildrise Bakehouse’s free Sourdough Starter Guide. Wake up your starter, shape your dough and pull a crackling loaf from your own oven.'
facts={[
{ value: '64', unit: 'Pages', label: 'Clear photo steps from jar to sliced loaf.', icon: <BookOpen size={20} strokeWidth={2.5} /> },
{ value: '12', unit: 'Recipes', label: 'Country loaf, focaccia, bagels and crackers.', icon: <Wheat size={20} strokeWidth={2.5} /> },
{ value: '72', unit: 'Hours', label: 'From reviving your starter to your first slice.', icon: <Timer size={20} strokeWidth={2.5} /> },
]}
sceneImage={slot('scene', __studioImagef6086ff9)}
sceneAlt='A freshly baked sourdough loaf with a blistered golden crust cooling on a wire rack'
formHeading='Get the free Sourdough Starter Guide'
smsLabel='Text me feeding reminders for my starter'
smsLegal='By ticking this box you agree to receive recurring marketing texts from Wildrise Bakehouse at this number. Consent is not a condition of purchase. Msg & data rates may apply. Reply STOP to opt out.'
discount='Plus 10% off your first order of flour, bannetons and tools.'
label='Send Me The Free Guide'
sublabel='Free PDF · Instant download'
ps='Your starter loves a schedule, so the sooner you start feeding it, the sooner you slice.'
privacy={defaults.sample.registration.privacy}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalClosingOptin6 |
React.ReactNode |
|
lead OptionalClosingOptin6 |
React.ReactNode |
|
facts OptionalClosingOptin6 |
ClosingOptin6Fact[] |
|
sceneImage OptionalClosingOptin6 |
string |
|
sceneAlt OptionalClosingOptin6 |
string |
|
formHeading OptionalClosingOptin6 |
React.ReactNode |
|
emailLabel OptionalClosingOptin6 |
string |
|
emailPlaceholder OptionalClosingOptin6 |
string |
|
smsLabel OptionalClosingOptin6 |
React.ReactNode |
|
smsLegal OptionalClosingOptin6 |
React.ReactNode |
|
phoneLabel OptionalClosingOptin6 |
string |
|
phonePlaceholder OptionalClosingOptin6 |
string |
|
discount OptionalClosingOptin6 |
React.ReactNode |
|
label OptionalClosingOptin6 |
React.ReactNode |
|
sublabel OptionalClosingOptin6 |
React.ReactNode |
|
ps OptionalClosingOptin6 |
React.ReactNode |
|
psLead OptionalClosingOptin6 |
string |
|
privacy OptionalClosingOptin6 |
React.ReactNode |
|
copy OptionalClosingOptin6 |
ClosingOptin6Copy |
|
defaultSmsChecked OptionalClosingOptin6 |
boolean |
|
onSubmit OptionalClosingOptin6 |
(values: ClosingOptin6Values) => void | Promise<unknown> |
|
disabled OptionalClosingOptin6 |
boolean |
|
state OptionalClosingOptin6 |
ClosingOptin6State |
|
id OptionalClosingOptin6 |
string |
|
className OptionalClosingOptin6 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-shadow- Secondary button.
--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.
scene- A wide atmosphere photo behind or beside the copy.
-
2c539f422023a290.webp
image/webp · 115 KB
-
a0586c66907e2c7d.webp
image/webp · 248 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB