Closing Opt-in 2
Closing opt-in block: the host restates the promise from a speech bubble that greets the visitor by name as they type. It recaps three numbered reasons and holds the inline form; the builder wires onSubmit.
Use it in a prompt
Use forms/closing-optin-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/closing-optin-2.tsx. - Import it and pass your copy and images (Props tab):
import { ClosingOptin2 } from "@/components/funneldna/forms/closing-optin-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/closing-optin-2/component.tsx 745 lines
// layout: presenter-cutout
// Closing opt-in block: the host restates the promise from a speech bubble that greets the visitor by name as they type. It recaps three numbered reasons and holds the inline form; the builder wires onSubmit.
import React from 'react'
import { AlertCircle, BadgeCheck, Check, Loader2, Lock } from 'lucide-react'
export type ClosingOptin2Field = {
name: string
label: string
type?: 'email' | 'text' | 'tel'
autoComplete?: string
// a realistic example answer; a sensible default is used per type
placeholder?: string
// fields are required unless set to false
required?: boolean
}
export type ClosingOptin2State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ClosingOptin2Props = {
// the page promise restated in one line
headline?: React.ReactNode
// phrase inside a string headline that gets the marker stroke
highlight?: string
// lead-in before the numbered reasons
reasonsIntro?: React.ReactNode
// the tiny recap of what they get, numbered inline (three reads best)
reasons?: React.ReactNode[]
// 1 to 3 fields; an optional first name and the email by default
fields?: ClosingOptin2Field[]
// the field whose first word personalises the greeting
greetingField?: string
// use the same CTA wording as the rest of the page
label?: string
// short facts shown in the bubble footer
sublabel?: React.ReactNode
// the one quiet line under the button
secondaryLabel?: React.ReactNode
secondaryHref?: string
privacy?: React.ReactNode
// slot: presenter-cutout, transparent background
presenterImage?: string
presenterAlt?: string
presenterName?: React.ReactNode
presenterRole?: React.ReactNode
// optional small lead-magnet visual (slot: product), transparent background
productImage?: string
productAlt?: string
copy?: {
// '{name}' is replaced with the visitor's first name
greeting?: string
greetingNoName?: string
// '{label}' is replaced with the field label
required?: string
invalidEmail?: string
optional?: string
// '{email}' is replaced with the typed email
preview?: string
pending?: string
}
// receives validated, trimmed values; return a promise to show the busy state until it settles
onSubmit?: (values: Record<string, string>) => void | Promise<unknown>
disabled?: boolean
state?: ClosingOptin2State
id?: string
className?: string
}
const DEFAULT_FIELDS: ClosingOptin2Field[] = [
{ name: 'firstName', label: 'First name', type: 'text', autoComplete: 'given-name', placeholder: 'Dana', required: false },
{ name: 'email', label: 'Email address', type: 'email', autoComplete: 'email', placeholder: 'you@example.com' },
]
const DEFAULT_REASONS: React.ReactNode[] = [
'You walk through your offer, one step at a time.',
'You shape your page copy while you watch.',
'You leave with your next steps clear.',
]
const DEFAULT_COPY = {
greeting: 'Ready when you are, {name}.',
greetingNoName: 'Ready when you are.',
required: 'Please enter your {label}.',
invalidEmail: 'That email looks incomplete. Try something like you@example.com.',
optional: '(optional)',
preview: 'Your watch link goes to {email}',
pending: 'Saving your seat…',
}
type Copy = typeof DEFAULT_COPY
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]+$/
const PLACEHOLDERS: Record<string, string> = { email: 'you@example.com', tel: '(555) 123-4567', text: 'Dana' }
export function ClosingOptin2(props: ClosingOptin2Props) {
const {
headline = 'Save your seat and map out your first funnel',
highlight = 'your first funnel',
reasonsIntro = 'Three reasons to save your seat:',
reasons = DEFAULT_REASONS,
fields = DEFAULT_FIELDS,
greetingField = 'firstName',
label = 'Yes! Save My Seat',
sublabel = 'Free workshop · Watch online',
secondaryLabel = 'or take another look at what you will map',
secondaryHref,
privacy = 'We respect your inbox. Unsubscribe anytime.',
presenterImage,
presenterAlt = '',
presenterName,
presenterRole,
productImage,
productAlt = '',
copy,
onSubmit,
disabled = false,
state = 'default',
id,
className,
} = props
const list = (fields.length ? fields : DEFAULT_FIELDS).slice(0, 3)
const c: Copy = { ...DEFAULT_COPY, ...copy }
const uid = React.useId()
const isDisabled = disabled || state === 'disabled'
const [values, setValues] = React.useState<Record<string, string>>({})
const [errors, setErrors] = React.useState<Record<string, string>>(() => (state === 'error' ? validate(list, {}, c) : {}))
const [pending, setPending] = React.useState(false)
const mounted = React.useRef(true)
const inputs = React.useRef<Record<string, HTMLInputElement | null>>({})
const rootRef = React.useRef<HTMLElement | null>(null)
const [inView, setInView] = React.useState(false)
// play the reveal once, when the block scrolls into view (it usually sits low on the page)
React.useEffect(() => {
const el = rootRef.current
if (!el || typeof IntersectionObserver === 'undefined') return
const io = new IntersectionObserver((entries) => {
if (entries.some((e) => e.isIntersecting)) {
setInView(true)
io.disconnect()
}
})
io.observe(el)
return () => io.disconnect()
}, [])
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
React.useEffect(() => {
setErrors(state === 'error' ? validate(list, {}, c) : {})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
const update = (name: string, value: string) => {
setValues((v) => ({ ...v, [name]: value }))
if (!errors[name]) return
const field = list.find((f) => f.name === name)
if (field && !fieldError(field, value, c)) {
setErrors((e) => {
const next = { ...e }
delete next[name]
return next
})
}
}
const blur = (field: ClosingOptin2Field) => {
const value = (values[field.name] ?? '').trim()
if (field.type === 'email' && value && !EMAIL.test(value)) {
setErrors((e) => ({ ...e, [field.name]: c.invalidEmail }))
}
}
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled || pending) return
const found = validate(list, values, c)
setErrors(found)
const firstInvalid = list.find((f) => found[f.name])
if (firstInvalid) {
inputs.current[firstInvalid.name]?.focus()
return
}
const clean: Record<string, string> = {}
for (const f of list) clean[f.name] = (values[f.name] ?? '').trim()
const result = onSubmit?.(clean)
if (isThenable(result)) {
setPending(true)
const done = () => {
if (mounted.current) setPending(false)
}
result.then(done, done)
}
}
const firstName = ((values[greetingField] ?? '').trim().split(' ')[0] ?? '').slice(0, 24)
const greeting = firstName
? fill(c.greeting, '{name}', <span key="name" className="co2-greet-name">{firstName}</span>)
: c.greetingNoName
const emailField = list.find((f) => f.type === 'email')
const emailValue = emailField ? (values[emailField.name] ?? '').trim() : ''
const showPreview = !!emailField && EMAIL.test(emailValue) && !errors[emailField.name]
const hasPresenter = !!presenterImage
const fieldCols = list.length === 2 ? ' is-pair' : list.length === 3 ? ' is-trio' : ''
const btnState = state === 'hover' ? ' is-hover' : state === 'active' ? ' is-active' : ''
return (
<section
ref={rootRef}
id={id}
className={'cf-closing-optin-2' + (inView ? ' is-in' : '') + (className ? ' ' + className : '')}
aria-labelledby={uid + '-title'}
>
<style>{CSS}</style>
<div className={'co2-wrap' + (hasPresenter ? '' : ' is-solo')}>
{hasPresenter ? (
<figure className="co2-figure">
<div className="co2-stage">
<img className="co2-presenter" src={presenterImage} alt={presenterAlt} loading="lazy" decoding="async" />
</div>
{presenterName || presenterRole ? (
<figcaption className="co2-caption">
{presenterName ? <span className="co2-name">{presenterName}</span> : null}
{presenterRole ? <span className="co2-role">{presenterRole}</span> : null}
</figcaption>
) : null}
</figure>
) : null}
<div className={'co2-bubble' + (hasPresenter ? ' has-tail' : '')}>
{hasPresenter ? <span className="co2-tail" aria-hidden="true" /> : null}
<div className={'co2-head' + (productImage ? ' has-product' : '')}>
<h2 id={uid + '-title'} className="co2-title">
{renderHeadline(headline, highlight)}
</h2>
{productImage ? (
<img className="co2-product" src={productImage} alt={productAlt} loading="lazy" decoding="async" />
) : null}
</div>
<p className="co2-greet">{greeting}</p>
{reasons.length ? (
<div className="co2-reasons">
{reasonsIntro ? <span className="co2-reasons-intro">{reasonsIntro} </span> : null}
<ol role="list">
{reasons.map((reason, i) => (
<li key={i}>
<span className="co2-num" aria-hidden="true">
{i + 1}
</span>
{reason}
{i < reasons.length - 1 ? ' ' : ''}
</li>
))}
</ol>
</div>
) : null}
<form className="co2-form" noValidate onSubmit={handleSubmit} aria-busy={pending || undefined}>
<div className={'co2-fields' + fieldCols}>
{list.map((f) => {
const fid = uid + '-' + f.name
const err = errors[f.name]
const required = f.required !== false
const preview = showPreview && emailField === f
return (
<div className="co2-field" key={f.name}>
<label className="co2-label" htmlFor={fid}>
{f.label}
{!required ? <span className="co2-opt"> {c.optional}</span> : null}
</label>
<input
ref={(el) => {
inputs.current[f.name] = el
}}
id={fid}
className={'co2-input' + (err ? ' is-invalid' : '')}
name={f.name}
type={f.type ?? 'text'}
autoComplete={f.autoComplete}
inputMode={f.type === 'email' ? 'email' : f.type === 'tel' ? 'tel' : undefined}
placeholder={f.placeholder ?? PLACEHOLDERS[f.type ?? 'text']}
value={values[f.name] ?? ''}
onChange={(e) => update(f.name, e.target.value)}
onBlur={() => blur(f)}
required={required}
aria-required={required}
aria-invalid={err ? true : undefined}
aria-describedby={err ? fid + '-err' : preview ? fid + '-ok' : undefined}
disabled={isDisabled}
/>
{err ? (
<p className="co2-err" id={fid + '-err'}>
<AlertCircle className="co2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{err}
</p>
) : null}
{preview ? (
<p className="co2-preview" id={fid + '-ok'}>
<span className="co2-badge" aria-hidden="true">
<Check size={12} strokeWidth={3} />
</span>
{fill(c.preview, '{email}', <strong key="email">{emailValue}</strong>)}
</p>
) : null}
</div>
)
})}
</div>
<button
type="submit"
className={'co2-btn' + btnState + (pending ? ' is-busy' : '')}
disabled={isDisabled}
aria-disabled={pending || undefined}
>
<span className="co2-btn-inner">
{pending ? <Loader2 className="co2-spin" size={20} strokeWidth={2.5} aria-hidden="true" /> : null}
<span>{pending ? c.pending : label}</span>
</span>
</button>
{secondaryLabel ? (
<p className="co2-after">
{secondaryHref ? (
<a className="co2-link" href={secondaryHref}>
{secondaryLabel}
</a>
) : (
secondaryLabel
)}
</p>
) : null}
</form>
{sublabel || privacy ? (
<div className="co2-foot">
{sublabel ? (
<p>
<BadgeCheck className="co2-ico co2-ico-ok" size={16} strokeWidth={2.5} aria-hidden="true" />
{sublabel}
</p>
) : null}
{privacy ? (
<p>
<Lock className="co2-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{privacy}
</p>
) : null}
</div>
) : null}
</div>
</div>
</section>
)
}
export default ClosingOptin2
function renderHeadline(headline: React.ReactNode, highlight?: string): React.ReactNode {
if (typeof headline !== 'string' || !highlight) return headline
const at = headline.indexOf(highlight)
if (at < 0) return headline
return (
<>
{headline.slice(0, at)}
<span className="co2-mark">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
}
function fill(template: string, token: string, node: React.ReactNode): React.ReactNode {
const parts = template.split(token)
if (parts.length === 1) return template
return parts.map((part, i) => (
<React.Fragment key={i}>
{i > 0 ? node : null}
{part}
</React.Fragment>
))
}
function fieldError(field: ClosingOptin2Field, value: string, c: Copy): string {
const v = value.trim()
if (!v) return field.required === false ? '' : c.required.replace('{label}', field.label.toLowerCase())
if (field.type === 'email' && !EMAIL.test(v)) return c.invalidEmail
return ''
}
function validate(list: ClosingOptin2Field[], values: Record<string, string>, c: Copy): Record<string, string> {
const out: Record<string, string> = {}
for (const f of list) {
const e = fieldError(f, values[f.name] ?? '', c)
if (e) out[f.name] = e
}
return out
}
function isThenable(value: unknown): value is PromiseLike<unknown> {
return typeof value === 'object' && value !== null && typeof (value as { then?: unknown }).then === 'function'
}
// Colour exceptions (theme-contract §3): the marker keeps its yellow default as the var() fallback;
// the solid success badge keeps its white glyph (owner 2026-11-19, status icon badges) through the
// component-scoped --co2-badge-ink variable, whose last fallback is white.
const CSS = `
.cf-closing-optin-2 {
--co2-pad-t: clamp(56px, 8vw, 112px);
--co2-pad-b: clamp(64px, 8.5vw, 120px);
--co2-ease: cubic-bezier(.2, .7, .2, 1);
--co2-shadow: var(--shadow, oklch(0.22 0.03 260));
--co2-border: var(--card-border, oklch(from var(--ink) l c h / .12));
--co2-btn: var(--button-bg, var(--cta));
--co2-btn-2: var(--button-bg-2, var(--cta-2));
position: relative;
isolation: isolate;
overflow: hidden;
background: var(--band);
color: var(--band-ink);
font-family: var(--font-body);
padding: var(--co2-pad-t) clamp(16px, 5vw, 48px) var(--co2-pad-b);
}
.cf-closing-optin-2 *, .cf-closing-optin-2 *::before, .cf-closing-optin-2 *::after { box-sizing: border-box; }
.cf-closing-optin-2 :where(h2, p, ol, figure) { margin: 0; }
.cf-closing-optin-2 img { max-width: 100%; }
.cf-closing-optin-2 .co2-wrap {
max-width: 1120px;
margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
gap: clamp(32px, 5vw, 72px);
align-items: stretch;
}
.cf-closing-optin-2 .co2-wrap.is-solo { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
.cf-closing-optin-2 .co2-figure {
display: flex;
flex-direction: column;
justify-content: flex-end;
min-width: 0;
margin-bottom: calc(var(--co2-pad-b) * -1);
}
.cf-closing-optin-2 .co2-caption { order: -1; padding: 0 0 16px; text-align: center; }
.cf-closing-optin-2 .co2-name {
display: block;
font-family: var(--font-display);
font-weight: 800;
font-size: 1.0625rem;
line-height: 1.2;
color: var(--band-ink);
}
.cf-closing-optin-2 .co2-role {
display: block;
margin-top: 4px;
font-size: .9375rem;
font-weight: 500;
line-height: 1.4;
color: color-mix(in oklch, var(--band-ink) 84%, var(--band));
}
.cf-closing-optin-2 .co2-stage { position: relative; flex: none; width: 100%; aspect-ratio: 1 / 1; }
.cf-closing-optin-2 .co2-stage::before {
content: '';
position: absolute;
left: 50%;
bottom: 4%;
width: min(92%, 440px);
aspect-ratio: 1;
transform: translateX(-50%);
border-radius: 50%;
background: oklch(from var(--band-ink) l c h / .08);
}
.cf-closing-optin-2 .co2-presenter {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: contain;
object-position: 50% 100%;
filter: drop-shadow(0 2px 3px oklch(from var(--co2-shadow) l c h / .35)) drop-shadow(0 12px 16px oklch(from var(--co2-shadow) l c h / .28));
}
.cf-closing-optin-2 .co2-bubble {
position: relative;
z-index: 1;
align-self: start;
min-width: 0;
container-type: inline-size;
background: var(--card);
color: var(--ink);
border: 1px solid var(--co2-border);
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--co2-shadow) l c h / .22), 0 12px 24px -8px oklch(from var(--co2-shadow) l c h / .32)));
padding: clamp(22px, 3.4vw, 40px);
}
/* the speech tail rises with the presenter: measured from the bubble's foot so it points at the host's face */
.cf-closing-optin-2 .co2-tail {
position: absolute;
left: -12px;
bottom: 30%;
bottom: clamp(48px, calc(50cqw - var(--co2-pad-b)), calc(100% - 72px));
width: 24px;
height: 24px;
background: var(--card);
border-left: 1px solid var(--co2-border);
border-bottom: 1px solid var(--co2-border);
border-bottom-left-radius: 5px;
transform: rotate(45deg);
}
.cf-closing-optin-2 .co2-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.cf-closing-optin-2 .co2-head.has-product { grid-template-columns: minmax(0, 1fr) auto; }
.cf-closing-optin-2 .co2-product {
width: clamp(84px, 11vw, 124px);
height: auto;
object-fit: contain;
filter: drop-shadow(0 2px 3px oklch(from var(--co2-shadow) l c h / .3)) drop-shadow(0 10px 14px oklch(from var(--co2-shadow) l c h / .22));
}
.cf-closing-optin-2 .co2-title {
font-family: var(--font-display);
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(--ink);
}
.cf-closing-optin-2 .co2-mark {
background: linear-gradient(180deg, transparent 56%, oklch(from var(--marker, #fae37c) l c h / .9) 56%, oklch(from var(--marker, #fae37c) l c h / .9) 92%, transparent 92%);
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
padding: 0 .1em;
margin: 0 -.04em;
border-radius: .12em .3em .18em .26em;
}
.cf-closing-optin-2 .co2-greet {
margin-top: 16px;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
font-weight: 600;
line-height: 1.4;
color: var(--ink);
text-wrap: pretty;
}
.cf-closing-optin-2 .co2-greet-name { display: inline-block; font-weight: 800; color: var(--accent); }
.cf-closing-optin-2 .co2-reasons {
margin-top: 12px;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1.6;
color: var(--ink);
text-wrap: pretty;
}
.cf-closing-optin-2 .co2-reasons-intro { font-weight: 700; }
.cf-closing-optin-2 .co2-reasons ol { display: inline; padding: 0; list-style: none; }
.cf-closing-optin-2 .co2-reasons li { display: inline; }
.cf-closing-optin-2 .co2-num {
margin-inline-end: .28em;
font-family: var(--font-display);
font-weight: 800;
font-size: 1.2em;
line-height: 1;
font-variant-numeric: tabular-nums;
color: var(--accent);
}
.cf-closing-optin-2 .co2-form { margin-top: 28px; display: grid; gap: 16px; }
.cf-closing-optin-2 .co2-fields { display: grid; gap: 12px 16px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 500px) {
.cf-closing-optin-2 .co2-fields.is-pair { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.cf-closing-optin-2 .co2-fields.is-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-closing-optin-2 .co2-fields.is-trio .co2-field:last-child { grid-column: 1 / -1; }
}
.cf-closing-optin-2 .co2-field { display: grid; gap: 8px; align-content: start; min-width: 0; }
.cf-closing-optin-2 .co2-label { font-size: 1rem; font-weight: 700; line-height: 1.2; color: var(--label-ink, var(--ink)); }
.cf-closing-optin-2 .co2-opt { font-weight: 500; color: var(--muted); }
.cf-closing-optin-2 .co2-input {
width: 100%;
min-width: 0;
height: 56px;
padding: 0 16px;
margin: 0;
font: inherit;
font-size: 1.0625rem;
color: var(--field-ink);
background: var(--field);
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(--co2-shadow) l c h / .08);
appearance: none;
}
.cf-closing-optin-2 .co2-input::placeholder { color: color-mix(in oklch, var(--field-ink) 65%, var(--field)); opacity: 1; }
.cf-closing-optin-2 .co2-input:hover:not(:disabled) { border-color: color-mix(in oklch, var(--ink) 38%, transparent); }
.cf-closing-optin-2 .co2-input:focus { outline: none; border-color: var(--field-focus, var(--accent)); box-shadow: 0 0 0 3px oklch(from var(--field-focus, var(--accent)) l c h / .35); }
.cf-closing-optin-2 .co2-input.is-invalid { border-color: var(--danger); }
.cf-closing-optin-2 .co2-input.is-invalid:focus { box-shadow: 0 0 0 3px oklch(from var(--danger) l c h / .3); }
.cf-closing-optin-2 .co2-input:disabled {
cursor: not-allowed;
background: color-mix(in oklch, var(--ink) 5%, var(--field));
color: color-mix(in oklch, var(--field-ink) 72%, var(--field));
}
.cf-closing-optin-2 .co2-err { font-size: .9375rem; font-weight: 600; line-height: 1.4; color: var(--danger); text-wrap: pretty; }
.cf-closing-optin-2 .co2-preview { font-size: .9375rem; font-weight: 500; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.cf-closing-optin-2 .co2-preview strong { font-weight: 700; }
.cf-closing-optin-2 .co2-badge {
display: inline-grid;
place-items: center;
width: 18px;
height: 18px;
margin-inline-end: .45em;
vertical-align: -.22em;
border-radius: 50%;
background: var(--success);
color: var(--co2-badge-ink, #fff);
}
.cf-closing-optin-2 .co2-ico { display: inline-block; vertical-align: -.18em; margin-inline-end: .4em; flex: none; }
.cf-closing-optin-2 .co2-ico-ok { color: var(--success); }
.cf-closing-optin-2 .co2-btn {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 72px;
margin: 8px 0 0;
padding: 0 28px;
border: 0;
cursor: pointer;
border-radius: var(--button-radius, var(--radius, 12px));
font-family: var(--button-font, var(--font-display));
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;
color: var(--button-ink, var(--cta-ink));
text-shadow: var(--button-text-shadow, none);
background: linear-gradient(oklch(from var(--co2-btn) calc(l + .04) c h), oklch(from var(--co2-btn-2) calc(l - .02) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--co2-btn) calc(l + .14) c h / .7), inset 0 -3px 0 oklch(from var(--co2-btn) calc(l - .16) c h), 0 1px 2px oklch(from var(--co2-shadow) l c h / .32), 0 8px 16px -6px oklch(from var(--co2-shadow) l c h / .42));
}
.cf-closing-optin-2 .co2-btn-inner { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.cf-closing-optin-2 .co2-btn:hover:not(:disabled), .cf-closing-optin-2 .co2-btn.is-hover {
background: linear-gradient(oklch(from var(--co2-btn) calc(l - .01) c h), oklch(from var(--co2-btn-2) calc(l - .07) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--co2-btn) calc(l + .1) c h / .7), inset 0 -3px 0 oklch(from var(--co2-btn) calc(l - .2) c h), 0 1px 2px oklch(from var(--co2-shadow) l c h / .36), 0 10px 20px -6px oklch(from var(--co2-shadow) l c h / .5));
}
.cf-closing-optin-2 .co2-btn:active:not(:disabled), .cf-closing-optin-2 .co2-btn.is-active {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--co2-btn) calc(l - .06) c h), oklch(from var(--co2-btn-2) calc(l - .1) c h));
box-shadow: inset 0 2px 3px oklch(from var(--co2-btn) calc(l - .24) c h / .5), inset 0 -2px 0 oklch(from var(--co2-btn) calc(l - .18) c h), 0 1px 1px oklch(from var(--co2-shadow) l c h / .3);
}
.cf-closing-optin-2 .co2-btn:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / .55); outline-offset: 3px; }
.cf-closing-optin-2 .co2-btn.is-busy { cursor: progress; }
.cf-closing-optin-2 .co2-btn:disabled {
cursor: not-allowed;
transform: none;
background: var(--button-2-bg, var(--secondary));
color: var(--button-2-ink, var(--secondary-ink));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
}
.cf-closing-optin-2 .co2-after {
text-align: center;
font-size: .9375rem;
font-weight: 500;
line-height: 1.4;
color: var(--muted);
text-wrap: pretty;
}
.cf-closing-optin-2 .co2-link {
font-weight: 600;
color: var(--link, var(--accent));
text-decoration: underline;
text-decoration-thickness: 1px;
text-decoration-color: oklch(from var(--link, var(--accent)) l c h / .45);
text-underline-offset: .18em;
}
.cf-closing-optin-2 .co2-link:hover { color: oklch(from var(--link, var(--accent)) calc(l - .08) c h); text-decoration-color: currentColor; }
.cf-closing-optin-2 .co2-link:focus-visible { outline: 3px solid oklch(from var(--field-focus, var(--accent)) l c h / .5); outline-offset: 2px; border-radius: 4px; }
.cf-closing-optin-2 .co2-foot {
margin-top: 24px;
padding-top: 16px;
border-top: 1px solid oklch(from var(--ink) l c h / .1);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 8px 24px;
font-size: .9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--muted);
}
.cf-closing-optin-2 .co2-foot p { text-wrap: pretty; }
@media (max-width: 859px) {
.cf-closing-optin-2 .co2-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
.cf-closing-optin-2 .co2-wrap.is-solo { gap: 0; }
.cf-closing-optin-2 .co2-figure {
display: grid;
grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
align-items: end;
column-gap: 12px;
margin-bottom: 0;
}
.cf-closing-optin-2 .co2-stage { grid-column: 1; grid-row: 1; aspect-ratio: auto; min-height: 0; height: 232px; }
.cf-closing-optin-2 .co2-stage::before { width: 100%; bottom: -12%; }
.cf-closing-optin-2 .co2-caption { order: 0; grid-column: 2; grid-row: 1; padding: 0 0 28px; text-align: left; }
.cf-closing-optin-2 .co2-tail {
left: 88px;
top: -12px;
bottom: auto;
border-bottom: 0;
border-top: 1px solid var(--co2-border);
border-bottom-left-radius: 0;
border-top-left-radius: 5px;
}
}
@media (prefers-reduced-motion: no-preference) {
.cf-closing-optin-2.is-in .co2-bubble { animation: co2-rise .45s var(--co2-ease) both; }
.cf-closing-optin-2.is-in .co2-stage { animation: co2-rise .45s var(--co2-ease) .07s both; }
.cf-closing-optin-2 .co2-greet-name { animation: co2-pop .3s var(--co2-ease) both; }
.cf-closing-optin-2 .co2-preview { animation: co2-rise .3s var(--co2-ease) both; }
.cf-closing-optin-2 .co2-spin { animation: co2-spin .8s linear infinite; }
.cf-closing-optin-2 .co2-btn { transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.cf-closing-optin-2 .co2-input { transition: border-color .16s ease, box-shadow .16s ease; }
.cf-closing-optin-2 .co2-link { transition: color .16s ease, text-decoration-color .16s ease; }
}
@keyframes co2-rise { from { opacity: .82; transform: translateY(8px); } }
@keyframes co2-pop { from { opacity: .6; transform: scale(.9); } }
@keyframes co2-spin { to { transform: rotate(360deg); } }
`
pieces/forms/closing-optin-2/specimen.tsx 33 lines
import __studioImage591f5f49 from "../assets/85739974cb0e5370.webp";
import React from 'react'
import { ClosingOptin2, type ClosingOptin2State } from '../closing-optin-2'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ClosingOptin2Specimen({ state }: { state?: ClosingOptin2State }) {
const reg = defaults.sample.registration
return (
<ClosingOptin2
state={state}
headline="Save your seat and map out your first funnel"
highlight="your first funnel"
reasonsIntro="Three reasons to save your seat:"
reasons={[
'You walk through your offer, one step at a time.',
'You shape your page copy while you watch.',
'You leave with your next steps clear.',
]}
label={reg.label}
sublabel={reg.sublabel}
privacy={reg.privacy}
secondaryLabel="or take another look at what you'll map"
secondaryHref="#workshop"
presenterImage={slot('presenter-cutout', __studioImage591f5f49)}
presenterAlt="Workshop host smiling and gesturing toward the sign-up form"
presenterName="Maya Brooks"
presenterRole="Your host, Funnel Starter Workshop"
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalClosingOptin2 |
React.ReactNode |
|
highlight OptionalClosingOptin2 |
string |
|
reasonsIntro OptionalClosingOptin2 |
React.ReactNode |
|
reasons OptionalClosingOptin2 |
React.ReactNode[] |
|
fields OptionalClosingOptin2 |
ClosingOptin2Field[] |
|
greetingField OptionalClosingOptin2 |
string |
|
label OptionalClosingOptin2 |
string |
|
sublabel OptionalClosingOptin2 |
React.ReactNode |
|
secondaryLabel OptionalClosingOptin2 |
React.ReactNode |
|
secondaryHref OptionalClosingOptin2 |
string |
|
privacy OptionalClosingOptin2 |
React.ReactNode |
|
presenterImage OptionalClosingOptin2 |
string |
|
presenterAlt OptionalClosingOptin2 |
string |
|
presenterName OptionalClosingOptin2 |
React.ReactNode |
|
presenterRole OptionalClosingOptin2 |
React.ReactNode |
|
productImage OptionalClosingOptin2 |
string |
|
productAlt OptionalClosingOptin2 |
string |
|
copy OptionalClosingOptin2 |
{
// '{name}' is replaced with the visitor's first name
greeting?: string
greetingNoName?: string
// '{label}' is replaced with the field label
required?: string
invalidEmail?: string
optional?: string
// '{email}' is replaced with the typed email
preview?: string
pending?: string
} |
|
onSubmit OptionalClosingOptin2 |
(values: Record<string, string>) => void | Promise<unknown> |
|
disabled OptionalClosingOptin2 |
boolean |
|
state OptionalClosingOptin2 |
ClosingOptin2State |
|
id OptionalClosingOptin2 |
string |
|
className OptionalClosingOptin2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
presenter-cutout- The presenter on a transparent background.
-
85739974cb0e5370.webp
image/webp · 108 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB