Closing Opt-in 5
Closing opt-in block: a clipboard sits beside a promise sheet listing what the subscriber gets and what they never get, so giving an email costs nothing. The email field checks itself on blur and offers a one-tap fix for mistyped domains; the builder wires onSubmit.
Use it in a prompt
Use forms/closing-optin-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/closing-optin-5.tsx. - Import it and pass your copy and images (Props tab):
import { ClosingOptin5 } from "@/components/funneldna/forms/closing-optin-5"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/closing-optin-5/component.tsx 565 lines
// layout: clipboard-checklist
// Closing opt-in block: a clipboard sits beside a promise sheet listing what the subscriber gets and what they never get, so giving an email costs nothing. The email field checks itself on blur and offers a one-tap fix for mistyped domains; the builder wires onSubmit.
import React from 'react'
import { AlertCircle, CalendarClock, Check, Loader2, Sparkles } from 'lucide-react'
import { FX_HOST, Pattern } from '../fx/fx'
export type ClosingOptin5State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ClosingOptin5Props = {
// the promise restated in one line
headline?: React.ReactNode
// phrase inside a string headline that gets the marker stroke
highlight?: string
// one or two short sentences under the headline
lead?: React.ReactNode
// italic aside in the author’s voice, set right after the lead
aside?: React.ReactNode
// heading over what arrives; sell the benefit, never a label
getsTitle?: React.ReactNode
// when and how often it arrives
cadence?: React.ReactNode
// what each email covers
topics?: React.ReactNode[]
// heading over the promises
promisesTitle?: React.ReactNode
// only promises the sender really keeps (no spam, one-click unsubscribe, never sold…)
promises?: React.ReactNode[]
// small-caps label that opens the investment line
investmentLabel?: React.ReactNode
investment?: React.ReactNode
emailLabel?: string
placeholder?: string
// button label; use the same CTA wording as the rest of the page
label?: string
// the one quiet line under the button
secondaryLabel?: React.ReactNode
secondaryHref?: string
// slot: product, the clipboard or printed sheet graphic on a transparent background
productImage?: string
productAlt?: string
// extra mail domains to check typos against, added to the common providers
domains?: string[]
copy?: {
required?: string
invalid?: string
// '{email}' is replaced with the suggested address
suggestion?: string
holdHint?: string
pending?: string
}
// receives the trimmed email; return a promise to show the busy state until it settles
onSubmit?: (values: { email: string }) => void | Promise<unknown>
disabled?: boolean
state?: ClosingOptin5State
id?: string
className?: string
}
const DEFAULT_TOPICS: React.ReactNode[] = [
'One practical idea you can use that week',
'A short note on what is working right now',
'A few links worth your time, already filtered',
]
const DEFAULT_PROMISES: React.ReactNode[] = [
'No spam, ever',
'One-click unsubscribe in every email',
'Your email is never sold or shared',
]
const DEFAULT_COPY = {
required: 'Please enter your email address.',
invalid: 'That email looks incomplete. Try something like you@example.com.',
suggestion: 'Did you mean {email}?',
holdHint: 'Tap the fix, or press the button again to keep it as typed.',
pending: 'Sending…',
}
const COMMON_DOMAINS = [
'gmail.com', 'googlemail.com', 'yahoo.com', 'outlook.com', 'hotmail.com', 'live.com', 'msn.com',
'icloud.com', 'me.com', 'mac.com', 'aol.com', 'proton.me', 'protonmail.com', 'mail.com', 'gmx.com',
'zoho.com', 'fastmail.com', 'hey.com', 'yandex.com', 'comcast.net', 'verizon.net', 'att.net',
]
// endings that are only ever typos of a known one
const TLD_FIXES: Record<string, string> = {
con: 'com', cmo: 'com', ocm: 'com', comm: 'com', vom: 'com', xom: 'com', cpm: 'com', nte: 'net',
}
// short real endings that are typos only on a known provider (gmail.co, yahoo.cm)
const PROVIDER_TYPOS = ['co', 'cm', 'om']
const EMAIL = /^[^ @]+@[^ @]+[.][^ @.]{2,}$/
export function ClosingOptin5(props: ClosingOptin5Props) {
const {
headline = 'Get one useful email a week, and nothing else',
highlight = 'one useful email a week',
lead = 'Short, practical notes you can use the same day.',
aside = '(No catch. Leave whenever you like.)',
getsTitle = 'Every week, you get:',
cadence = 'One email a week · a short read',
topics = DEFAULT_TOPICS,
promisesTitle = 'Our promises to your inbox:',
promises = DEFAULT_PROMISES,
investmentLabel = 'Your investment:',
investment = 'one email address. Take it back with one click.',
emailLabel = 'Your email address',
placeholder = 'you@example.com',
label = 'Send Me The Weekly Email',
secondaryLabel = 'or keep reading to see what’s inside',
secondaryHref,
productImage,
productAlt = '',
domains,
copy,
onSubmit,
disabled = false,
state = 'default',
id,
className,
} = props
const c = { ...DEFAULT_COPY, ...copy }
const known = domains && domains.length ? [...COMMON_DOMAINS, ...domains.map((d) => d.toLowerCase())] : COMMON_DOMAINS
const uid = React.useId()
const titleId = `${uid}-title`
const inputId = `${uid}-email`
const errorId = `${uid}-error`
const assistId = `${uid}-assist`
const isDisabled = disabled || state === 'disabled'
const [value, setValue] = React.useState('')
const [error, setError] = React.useState(state === 'error' ? c.required : '')
const [suggestion, setSuggestion] = React.useState<string | null>(null)
const [held, setHeld] = React.useState(0)
const [pending, setPending] = React.useState(false)
const [reveal, setReveal] = React.useState<'idle' | 'armed' | 'seen'>('idle')
const heldFor = React.useRef<string | null>(null)
const mounted = React.useRef(true)
const rootRef = React.useRef<HTMLElement | null>(null)
const inputRef = React.useRef<HTMLInputElement | null>(null)
const chipRef = React.useRef<HTMLButtonElement | null>(null)
React.useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
React.useEffect(() => {
setError(state === 'error' ? c.required : '')
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state])
// the block renders finished first; only when motion is allowed is the reveal 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((e) => e.isIntersecting)) {
setReveal('seen')
io.disconnect()
}
},
{ threshold: 0.2, rootMargin: '0px 0px -10% 0px' },
)
io.observe(el)
return () => io.disconnect()
}, [])
// a held submit moves focus to the fix so it is the next thing heard and tapped
React.useEffect(() => {
if (held) chipRef.current?.focus()
}, [held])
const check = (raw: string, mode: 'blur' | 'submit') => {
const v = raw.trim()
if (!v) return { error: mode === 'submit' ? c.required : '', fix: null as string | null }
const fix = suggestEmail(v, known)
if (!EMAIL.test(v)) return { error: mode === 'blur' && fix ? '' : c.invalid, fix }
return { error: '', fix }
}
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const next = event.target.value
setValue(next)
heldFor.current = null
if (held) setHeld(0)
if (suggestion) setSuggestion(null)
if (error && EMAIL.test(next.trim())) setError('')
}
const handleBlur = () => {
if (!value.trim()) {
setSuggestion(null)
return
}
const r = check(value, 'blur')
setError(r.error)
setSuggestion(r.fix)
}
const applyFix = () => {
if (!suggestion || isDisabled) return
setValue(suggestion)
setSuggestion(null)
setError('')
setHeld(0)
heldFor.current = null
inputRef.current?.focus()
}
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault()
if (isDisabled || pending) return
const v = value.trim()
const r = check(v, 'submit')
setError(r.error)
setSuggestion(r.fix)
if (r.error) {
setHeld(0)
inputRef.current?.focus()
return
}
// a likely typo holds the first submit once, so the visitor can take the fix
if (r.fix && heldFor.current !== v) {
heldFor.current = v
setHeld((n) => n + 1)
return
}
heldFor.current = null
setHeld(0)
const result: unknown = onSubmit?.({ email: v })
if (typeof result === 'object' && result !== null && typeof (result as { then?: unknown }).then === 'function') {
setPending(true)
const done = () => {
if (mounted.current) setPending(false)
}
;(result as Promise<unknown>).then(done, done)
}
}
const at = suggestion ? suggestion.lastIndexOf('@') : -1
const parts = c.suggestion.split('{email}')
const describedBy = [error ? errorId : '', suggestion ? assistId : ''].filter(Boolean).join(' ') || undefined
const renderItems = (items: React.ReactNode[], offset: number) => (
<ul className='co5-items'>
{items.map((item, i) => (
<li key={i} style={delay(offset + i)}>
<span className='co5-tick' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span className='co5-item-text'>{item}</span>
</li>
))}
</ul>
)
const rootClass = [
'cf-closing-optin-5',
reveal === 'armed' ? 'is-armed' : '',
reveal === 'seen' ? 'is-armed is-seen' : '',
className ?? '',
]
.filter(Boolean)
.join(' ')
return (
<section ref={rootRef} id={id} aria-labelledby={titleId} style={FX_HOST} className={rootClass}>
<style>{CSS}</style>
<Pattern name='grid' fade='corner' />
<div className='co5-inner'>
<div className='co5-head' data-reveal=''>
<h2 id={titleId} className='co5-title'>
{withMark(headline, highlight)}
</h2>
{lead || aside ? (
<p className='co5-lead'>
{lead}
{lead && aside ? ' ' : null}
{aside ? <em className='co5-aside'>{aside}</em> : null}
</p>
) : null}
</div>
{productImage ? (
<figure className='co5-clip' data-reveal='' style={delay(2)}>
<img src={productImage} alt={productAlt} width={560} height={560} loading='lazy' decoding='async' />
</figure>
) : null}
<div className={`co5-card${productImage ? ' has-clip' : ''}`} data-reveal='' style={delay(1)}>
<div className='co5-lists'>
<div className='co5-list'>
<h3 className='co5-list-title'>{getsTitle}</h3>
{cadence ? (
<p className='co5-cadence'>
<CalendarClock size={16} strokeWidth={2.5} aria-hidden='true' />
{cadence}
</p>
) : null}
{renderItems(topics, 1)}
</div>
{promises.length ? (
<>
<hr className='co5-rule' aria-hidden='true' />
<div className='co5-list'>
<h3 className='co5-list-title'>{promisesTitle}</h3>
{renderItems(promises, 2)}
</div>
</>
) : null}
</div>
<hr className='co5-rule co5-rule--form' aria-hidden='true' />
{investment ? (
<p className='co5-investment'>
{investmentLabel ? (
<>
<span className='co5-sc'>{investmentLabel}</span>{' '}
</>
) : null}
{investment}
</p>
) : null}
<form className='co5-form' noValidate onSubmit={handleSubmit}>
<label className='co5-label' htmlFor={inputId}>
{emailLabel}
</label>
<input
ref={inputRef}
id={inputId}
className='co5-input'
name='email'
type='email'
inputMode='email'
autoComplete='email'
autoCapitalize='none'
spellCheck={false}
placeholder={placeholder}
value={value}
disabled={isDisabled}
aria-invalid={error ? true : undefined}
aria-describedby={describedBy}
onChange={handleChange}
onBlur={handleBlur}
/>
{error ? (
<p id={errorId} className='co5-error'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
<div id={assistId} className='co5-assist' aria-live='polite'>
{suggestion ? (
<>
<button ref={chipRef} type='button' className='co5-chip' onClick={applyFix} disabled={isDisabled}>
<Sparkles size={16} strokeWidth={2.5} aria-hidden='true' />
{parts[0]}
<span className='co5-chip-email'>
{suggestion.slice(0, at + 1)}
<b>{suggestion.slice(at + 1)}</b>
</span>
{parts.slice(1).join('')}
</button>
{held ? <p className='co5-hint'>{c.holdHint}</p> : null}
</>
) : null}
</div>
<button
type='submit'
className='co5-btn'
disabled={isDisabled}
aria-busy={pending || undefined}
data-force={state === 'hover' || state === 'active' ? state : undefined}
>
{pending ? (
<>
<Loader2 className='co5-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{c.pending}
</>
) : (
label
)}
</button>
{secondaryLabel ? (
secondaryHref ? (
<a className='co5-more' href={secondaryHref}>
{secondaryLabel}
</a>
) : (
<p className='co5-more'>{secondaryLabel}</p>
)
) : null}
</form>
</div>
</div>
</section>
)
}
export default ClosingOptin5
function withMark(headline: React.ReactNode, phrase?: string) {
if (typeof headline !== 'string' || !phrase) return headline
const i = headline.indexOf(phrase)
if (i < 0) return headline
return (
<>
{headline.slice(0, i)}
<span className='co5-mark'>{phrase}</span>
{headline.slice(i + phrase.length)}
</>
)
}
function delay(i: number): React.CSSProperties {
return { ['--d' as string]: `${(Math.min(i, 4) * 0.07).toFixed(2)}s` } as React.CSSProperties
}
function splitDomain(domain: string): [string, string] {
const i = domain.lastIndexOf('.')
return i < 0 ? [domain, ''] : [domain.slice(0, i), domain.slice(i + 1)]
}
// optimal string alignment distance: a swapped pair of letters counts as one edit
function distance(a: string, b: string) {
const d: number[][] = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array<number>(b.length).fill(0)])
for (let j = 1; j <= b.length; j++) d[0][j] = j
for (let i = 1; i <= a.length; i++) {
for (let j = 1; j <= b.length; j++) {
const cost = a[i - 1] === b[j - 1] ? 0 : 1
d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost)
if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1)
}
}
return d[a.length][b.length]
}
// suggests a corrected address for a likely domain typo (gmial.com, yahoo.con, gmail.co, outlook), else null
function suggestEmail(raw: string, domains: string[]): string | null {
const v = raw.trim()
const at = v.lastIndexOf('@')
if (at < 1 || at === v.length - 1) return null
const local = v.slice(0, at)
const domain = v.slice(at + 1).toLowerCase().replace(/[.]+$/, '')
if (!domain || domains.includes(domain)) return null
const [name, tld] = splitDomain(domain)
let best: string | null = null
let bestScore = Infinity
for (const candidate of domains) {
const [kName, kTld] = splitDomain(candidate)
let score = Infinity
if (name === kName) {
if (!tld || tld.length >= 3 || PROVIDER_TYPOS.includes(tld)) score = 0.5
} else {
const limit = kName.length > 5 ? 2 : 1
const tldOk = !tld || tld === kTld || TLD_FIXES[tld] === kTld || (PROVIDER_TYPOS.includes(tld) && kTld === 'com')
const nd = distance(name, kName)
if (nd <= limit && tldOk) score = nd
}
if (score < bestScore) {
bestScore = score
best = candidate
}
}
if (best) return `${local}@${best}`
const fix = tld ? TLD_FIXES[tld] : undefined
return fix ? `${local}@${name}.${fix}` : null
}
const R = '.cf-closing-optin-5'
const CSS = `
${R}{--co5-btn:var(--button-bg,var(--cta));--co5-btn-2:var(--button-bg-2,var(--cta-2));--co5-shadow:var(--shadow,oklch(0.22 0.03 260));position:relative;overflow:clip;width:100%;box-sizing:border-box;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} :where(h2,h3,p,ul,figure){margin:0}
${R} :where(ul){padding:0;list-style:none}
${R} .co5-inner{position:relative;z-index:1;max-width:1120px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,37rem);grid-template-rows:auto 1fr;grid-template-areas:'head card' 'clip card';column-gap:clamp(32px,5vw,72px);align-items:start}
${R} .co5-head{grid-area:head;min-width:0;padding-top:8px}
${R} .co5-title{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);color:var(--ink);text-wrap:balance}
${R} .co5-mark{background:linear-gradient(to bottom,transparent 48%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 48%,color-mix(in oklch,var(--marker,#fae37c) 85%,transparent) 95%,transparent 95%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .1em;margin:0 -.04em;border-radius:.12em .22em .14em .2em}
${R} .co5-lead{margin-top:16px;max-width:34rem;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .co5-aside{font-style:italic;color:var(--ink)}
${R} .co5-clip{grid-area:clip;min-width:0;margin:24px calc(-1 * (clamp(32px,5vw,72px) + 24px)) 0 0;display:flex;justify-content:flex-end;pointer-events:none}
${R} .co5-clip img{display:block;width:min(100%,26rem);height:auto;aspect-ratio:1;object-fit:contain;object-position:50% 0;filter:drop-shadow(0 2px 3px oklch(from var(--co5-shadow) l c h / 0.28)) drop-shadow(0 18px 24px oklch(from var(--co5-shadow) l c h / 0.2))}
${R} .co5-card{grid-area:card;position:relative;z-index:2;min-width:0;container-type:inline-size;background:var(--card);color:var(--ink);border:1px solid oklch(from var(--accent) l c h / 0.26);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)}
${R} .co5-lists{display:grid;gap:24px}
${R} .co5-list{min-width:0}
@container (min-width:500px){${R} .co5-lists{grid-template-columns:1fr 1fr;column-gap:32px}${R} .co5-lists>.co5-rule{display:none}}
${R} .co5-rule{display:block;height:1px;margin:0;border:0;background:oklch(from var(--ink) l c h / 0.12)}
${R} .co5-rule--form{margin-top:24px}
${R} .co5-list-title{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);color:var(--ink);text-wrap:balance}
${R} .co5-cadence{margin-top:12px;font-size:15px;line-height:1.4;font-weight:600;color:var(--muted);text-wrap:balance}
${R} .co5-cadence svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:.4em;color:var(--accent)}
${R} .co5-items{display:grid;gap:12px;margin-top:16px}
${R} .co5-items li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.4;color:var(--ink)}
${R} .co5-item-text{min-width:0;text-wrap:pretty}
${R} .co5-tick{--co5-tick-ink:var(--success-ink,#fff);display:grid;width:24px;height:24px;place-items:center;border-radius:999px;background:var(--success);color:var(--co5-tick-ink);margin-top:calc((1.4em - 24px) / 2)}
${R} .co5-investment{margin-top:20px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
${R} .co5-sc{font-size:1.12em;font-variant-caps:all-small-caps;letter-spacing:.06em;font-weight:800;color:var(--accent)}
${R} .co5-form{margin-top:20px}
${R} .co5-label{display:block;margin-bottom:8px;font-size:16px;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink))}
${R} .co5-input{display:block;width:100%;min-height:56px;padding:0 16px;border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));background:var(--field);color:var(--field-ink);font-family:var(--font-body);font-size:17px;font-weight:500;line-height:1.2;box-shadow:inset 0 1px 2px oklch(from var(--co5-shadow) l c h / 0.08);appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
${R} .co5-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .co5-input:hover:not(:disabled):not(:focus){border-color:color-mix(in oklch,var(--ink) 40%,transparent)}
${R} .co5-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 / 0.35)}
${R} .co5-input[aria-invalid='true']{border-color:var(--danger)}
${R} .co5-input[aria-invalid='true']:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.3)}
${R} .co5-input:disabled{background:color-mix(in oklch,var(--ink) 5%,var(--field));color:var(--muted);cursor:not-allowed}
${R} .co5-error{margin-top:10px;font-size:15px;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
${R} .co5-error svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:.4em}
${R} .co5-assist{margin-top:10px}
${R} .co5-assist:empty{display:none}
${R} .co5-chip{display:inline-block;max-width:100%;min-height:44px;padding:10px 16px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));font-family:var(--font-body);font-size:15px;line-height:1.4;font-weight:600;text-align:left;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm));animation:co5-pop .3s cubic-bezier(.2,.7,.2,1) backwards;transition:background .16s ease,border-color .16s ease,transform .16s ease}
${R} .co5-chip svg{display:inline-block;vertical-align:-0.18em;margin-inline-end:.4em;color:var(--accent)}
${R} .co5-chip-email{overflow-wrap:anywhere}
${R} .co5-chip b{font-weight:800}
${R} .co5-chip:hover:not(:disabled){background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h)}
${R} .co5-chip:active:not(:disabled){transform:translateY(1px)}
${R} .co5-chip:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:2px}
${R} .co5-chip:disabled{cursor:not-allowed;opacity:1;box-shadow:none;color:var(--button-2-ink,var(--secondary-ink))}
${R} .co5-hint{margin-top:8px;font-size:15px;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
${R} .co5-btn{display:flex;width:100%;min-height:64px;margin-top:16px;padding:12px 28px;align-items:center;justify-content:center;gap:10px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-size:clamp(1.125rem,1.55vw,1.375rem);font-weight:var(--button-weight,800);line-height:1.15;text-transform:var(--button-case,none);text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--co5-btn) calc(l + 0.14) c h / 0.7),inset 0 -3px 0 oklch(from var(--co5-btn) calc(l - 0.16) c h),0 1px 2px oklch(from var(--co5-shadow) l c h / 0.3),0 8px 16px -6px oklch(from var(--co5-shadow) l c h / 0.42));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .co5-btn:hover:not(:disabled),${R} .co5-btn[data-force='hover']{background:linear-gradient(oklch(from var(--co5-btn) calc(l - 0.01) c h),oklch(from var(--co5-btn-2) calc(l - 0.07) c h));box-shadow:inset 0 1px 0 oklch(from var(--co5-btn) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--co5-btn) calc(l - 0.2) c h),0 1px 2px oklch(from var(--co5-shadow) l c h / 0.32),0 10px 20px -6px oklch(from var(--co5-shadow) l c h / 0.5);transform:translateY(-1px)}
${R} .co5-btn:active:not(:disabled),${R} .co5-btn[data-force='active']{background:linear-gradient(oklch(from var(--co5-btn) calc(l - 0.04) c h),oklch(from var(--co5-btn-2) calc(l - 0.09) c h));box-shadow:inset 0 2px 3px oklch(from var(--co5-btn) calc(l - 0.24) c h / 0.45),inset 0 -2px 0 oklch(from var(--co5-btn) calc(l - 0.18) c h),0 1px 2px oklch(from var(--co5-shadow) l c h / 0.3);transform:translateY(1px)}
${R} .co5-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .co5-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:none;cursor:not-allowed;transform:none}
${R} .co5-btn[aria-busy='true']{cursor:progress}
${R} .co5-more{display:block;margin-top:12px;font-size:15px;line-height:1.4;font-weight:500;text-align:center;color:var(--muted);text-wrap:pretty}
${R} a.co5-more{color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / 0.45);text-underline-offset:.18em}
${R} a.co5-more:hover{color:oklch(from var(--link,var(--accent)) calc(l - 0.08) c h);text-decoration-color:currentColor}
${R} a.co5-more:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px;border-radius:4px}
${R} .co5-spin{animation:co5-spin .8s linear infinite}
${R}.is-armed:not(.is-seen) [data-reveal]{opacity:.82;transform:translateY(8px)}
${R}.is-armed:not(.is-seen) .co5-tick{transform:scale(.9)}
${R}.is-seen [data-reveal]{animation:co5-rise .45s cubic-bezier(.2,.7,.2,1) var(--d,0s) both}
${R}.is-seen .co5-tick{animation:co5-pop .3s cubic-bezier(.2,.7,.2,1) calc(var(--d,0s) + .12s) backwards}
@keyframes co5-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes co5-pop{from{opacity:.6;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes co5-spin{to{transform:rotate(360deg)}}
@media (max-width:1023px){
${R} .co5-inner{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;grid-template-areas:'head' 'clip' 'card';max-width:42rem}
${R} .co5-head{padding-top:0}
${R} .co5-clip{margin:24px 0 0;height:clamp(168px,44vw,224px);overflow:hidden;justify-content:center}
${R} .co5-clip img{width:min(80%,340px)}
${R} .co5-card.has-clip{margin-top:-48px}
}
@media (max-width:480px){
${R} .co5-btn{min-height:60px;padding:12px 20px}
}
@media (prefers-reduced-motion:reduce){
${R} .co5-spin,${R} .co5-chip,${R} .co5-tick,${R} [data-reveal]{animation:none}
${R} .co5-btn,${R} .co5-input,${R} .co5-chip{transition:none}
${R} .co5-btn:hover:not(:disabled),${R} .co5-btn:active:not(:disabled){transform:none}
}
`
pieces/forms/closing-optin-5/specimen.tsx 47 lines
import __studioImage6d490123 from "../assets/1fbbfe6694949d8c.webp";
import React from 'react'
import { ClosingOptin5, type ClosingOptin5State } from '../closing-optin-5'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ClosingOptin5Specimen({ state = 'default' }: { state?: ClosingOptin5State }) {
return (
<ClosingOptin5
state={state}
headline='Get the 5-minute ops brief SaaS founders read before standup'
highlight='5-minute ops brief'
lead='One short email every Tuesday with the playbook, the metric and the tools that keep a lean SaaS team shipping.'
aside='(You’ll finish it before your coffee cools. That’s the point.)'
getsTitle='Every Tuesday, you get:'
cadence={
<>
Tuesdays at 7am ET · <span style={{ whiteSpace: 'nowrap' }}>a 5-minute read</span>
</>
}
topics={[
'One ops playbook you can run that week',
'The SaaS metric worth checking, and why it moves',
'Three tools worth a look, with setup notes',
]}
promisesTitle='And our promises to your inbox:'
promises={[
'No spam, and never a daily blast',
'One-click unsubscribe in every email',
'Your email is never sold or shared',
]}
investmentLabel='Your investment:'
investment='one email address. Take it back with one click, any Tuesday.'
emailLabel='Your work email'
placeholder='you@company.com'
label='Send Me The Ops Brief'
secondaryLabel='or keep reading to see last Tuesday’s issue'
productImage={slot(
'product',
__studioImage6d490123,
)}
productAlt=''
onSubmit={() => {}}
/>
)
}
| Name | Type | Details |
|---|---|---|
headline OptionalClosingOptin5 |
React.ReactNode |
|
highlight OptionalClosingOptin5 |
string |
|
lead OptionalClosingOptin5 |
React.ReactNode |
|
aside OptionalClosingOptin5 |
React.ReactNode |
|
getsTitle OptionalClosingOptin5 |
React.ReactNode |
|
cadence OptionalClosingOptin5 |
React.ReactNode |
|
topics OptionalClosingOptin5 |
React.ReactNode[] |
|
promisesTitle OptionalClosingOptin5 |
React.ReactNode |
|
promises OptionalClosingOptin5 |
React.ReactNode[] |
|
investmentLabel OptionalClosingOptin5 |
React.ReactNode |
|
investment OptionalClosingOptin5 |
React.ReactNode |
|
emailLabel OptionalClosingOptin5 |
string |
|
placeholder OptionalClosingOptin5 |
string |
|
label OptionalClosingOptin5 |
string |
|
secondaryLabel OptionalClosingOptin5 |
React.ReactNode |
|
secondaryHref OptionalClosingOptin5 |
string |
|
productImage OptionalClosingOptin5 |
string |
|
productAlt OptionalClosingOptin5 |
string |
|
domains OptionalClosingOptin5 |
string[] |
|
copy OptionalClosingOptin5 |
{
required?: string
invalid?: string
// '{email}' is replaced with the suggested address
suggestion?: string
holdHint?: string
pending?: string
} |
|
onSubmit OptionalClosingOptin5 |
(values: { email: string }) => void | Promise<unknown> |
|
disabled OptionalClosingOptin5 |
boolean |
|
state OptionalClosingOptin5 |
ClosingOptin5State |
|
id OptionalClosingOptin5 |
string |
|
className OptionalClosingOptin5 |
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-border--button-2-ink--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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
1fbbfe6694949d8c.webp
image/webp · 120 KB