Closing Opt-in 3
Closing opt-in block: Russell's two choices scaled down to a free decision. The light half says what happens if the visitor closes the page; the dark band holds the guide, its promise and the inline form. When the form takes focus, the other choice quietly fades. The builder wires onSubmit.
Use it in a prompt
Use forms/closing-optin-3 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-3.tsx. - Import it and pass your copy and images (Props tab):
import { ClosingOptin3 } from "@/components/funneldna/forms/closing-optin-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/closing-optin-3/component.tsx 503 lines
// layout: split-contrast
// Closing opt-in block: Russell's two choices scaled down to a free decision. The light half says what happens if the visitor closes the page; the dark band holds the guide, its promise and the inline form. When the form takes focus, the other choice quietly fades. The builder wires onSubmit.
import React from 'react'
import { AlertCircle, Check, Loader2, Lock, X } from 'lucide-react'
import { FX_HOST, Texture } from '../fx/fx'
import linen from '../fx/textures/linen'
export type ClosingOptin3Field = {
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 ClosingOptin3State = 'default' | 'hover' | 'active' | 'disabled' | 'error'
export type ClosingOptin3Props = {
// the lead-in to the first choice, beside the cross badge
leaveIntro?: React.ReactNode
// two short lines: what happens if they close the page
leaveLines?: React.ReactNode[]
// slot: scene, the "before" picture under the first choice (desktop only); muted, and it fades further when the form takes focus
leaveImage?: string
leaveImageAlt?: string
// the first choice condensed to one line for phones
phoneLine?: React.ReactNode
// word on the disc between the two choices
orLabel?: string
// the freebie's promise
headline?: React.ReactNode
// phrase inside a string headline that gets the marker stroke
highlight?: string
lead?: React.ReactNode
// short fascinations shown beside the cover
bullets?: React.ReactNode[]
// accessible name of the bullet list
bulletsLabel?: string
// slot: product, the guide's cover on a transparent background
coverImage?: string
coverAlt?: string
// 1 to 3 fields; first name and email by default
fields?: ClosingOptin3Field[]
label?: string
// button label while onSubmit's promise is pending
pendingLabel?: string
// one reassurance line under the button
note?: React.ReactNode
copy?: {
// '{label}' is replaced with the field label
required?: string
invalidEmail?: string
}
// subtle linen texture on the dark half
texture?: boolean
// 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?: ClosingOptin3State
id?: string
className?: string
}
const DEFAULT_FIELDS: ClosingOptin3Field[] = [
{ name: 'firstName', label: 'First name', type: 'text', autoComplete: 'given-name', placeholder: 'Jane' },
{ name: 'email', label: 'Email address', type: 'email', autoComplete: 'email', placeholder: 'you@example.com' },
]
const DEFAULT_LEAVE: React.ReactNode[] = ['You keep guessing what works.', 'And next month looks a lot like this one.']
const DEFAULT_BULLETS: React.ReactNode[] = [
'The one change to make first, and why it matters',
'How to check your work before anyone sees it',
'Why guessing costs more than the plan takes',
]
const DEFAULT_COPY = {
required: 'Please enter your {label}.',
invalidEmail: 'That email looks incomplete. Try something like you@example.com.',
}
type Copy = typeof DEFAULT_COPY
const PLACEHOLDERS: Record<string, string> = { email: 'you@example.com', tel: '(555) 123-4567', text: 'Jane' }
const EMAIL = /^[^ @]+@[^ @]+[.][^ @]+$/
export function ClosingOptin3(props: ClosingOptin3Props) {
const {
leaveIntro = 'If you close this page',
leaveLines = DEFAULT_LEAVE,
leaveImage,
leaveImageAlt = '',
phoneLine = 'Close this page and you keep guessing.',
orLabel = 'or',
headline = 'Get the free guide and start with a clear plan',
highlight = 'a clear plan',
lead = 'Everything you need for your next step, in one free download.',
bullets = DEFAULT_BULLETS,
bulletsLabel = 'What is inside the free guide',
coverImage,
coverAlt = '',
fields = DEFAULT_FIELDS,
label = 'Send Me The Free Guide',
pendingLabel = 'Sending your guide…',
note = 'Free download · Unsubscribe anytime',
copy,
texture = true,
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 headId = `${uid}-head`
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 [narrow, setNarrow] = React.useState(false)
const [reveal, setReveal] = React.useState<'idle' | 'armed' | 'seen'>('idle')
const rootRef = React.useRef<HTMLElement | null>(null)
const inputs = React.useRef<Record<string, HTMLInputElement | null>>({})
const dirty = React.useRef<Record<string, boolean>>({})
const mounted = React.useRef(true)
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])
// one-time entrance: renders finished first; only armed and played once in view when motion is allowed
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.15 },
)
io.observe(el)
return () => io.disconnect()
}, [])
const update = (name: string, value: string) => {
dirty.current[name] = true
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: ClosingOptin3Field) => {
const value = values[field.name] ?? ''
if (!dirty.current[field.name] && !value.trim()) return
const message = fieldError(field, value, c)
setErrors((e) => {
const next = { ...e }
if (message) next[field.name] = message
else delete next[field.name]
return next
})
}
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 lines = leaveLines.slice(0, 2)
const buttonClass = ['co3-cta', state === 'hover' ? 'is-hover' : '', state === 'active' ? 'is-active' : ''].filter(Boolean).join(' ')
return (
<section
ref={rootRef}
id={id}
className={['cf-closing-optin-3', className].filter(Boolean).join(' ')}
data-narrow={narrow ? 'true' : 'false'}
data-reveal={reveal}
aria-labelledby={headId}
>
<style>{CSS}</style>
<div className='co3-leave'>
<div className='co3-leave-inner'>
<div className='co3-rv' style={vi(0)}>
<div className='co3-leave-desk'>
<p className='co3-leave-intro'>
<span className='co3-x' aria-hidden='true'>
<X size={16} strokeWidth={3} />
</span>
<span>{leaveIntro}</span>
</p>
{lines[0] ? <p className='co3-leave-line'>{lines[0]}</p> : null}
{lines[1] ? <p className='co3-leave-sub'>{lines[1]}</p> : null}
</div>
<p className='co3-leave-phone'>
<span className='co3-x co3-x-inline' aria-hidden='true'>
<X size={14} strokeWidth={3} />
</span>
{phoneLine}
</p>
</div>
{leaveImage ? (
<figure className='co3-leave-photo co3-rv' style={vi(1)}>
<img src={leaveImage} alt={leaveImageAlt} width={640} height={800} loading='lazy' decoding='async' />
</figure>
) : null}
</div>
</div>
<div className='co3-offer'>
{texture ? (
<div
className='co3-fx'
aria-hidden='true'
style={{ ...FX_HOST, position: 'absolute', inset: 0, overflow: 'hidden', zIndex: 0, pointerEvents: 'none' }}
>
<Texture src={linen} tone='band-ink' />
</div>
) : null}
<span className='co3-or' aria-hidden='true'>
{orLabel}
</span>
<div className='co3-offer-inner'>
<div className={coverImage ? 'co3-grid' : 'co3-grid no-cover'}>
<div className='co3-head co3-rv' style={vi(1)}>
<h2 id={headId} className='co3-h2'>
{withMark(headline, highlight)}
</h2>
{lead ? <p className='co3-lead'>{lead}</p> : null}
</div>
{coverImage ? (
<figure className='co3-cover co3-rv' style={vi(2)}>
<img src={coverImage} alt={coverAlt} width={512} height={512} loading='lazy' decoding='async' />
</figure>
) : null}
{bullets.length ? (
<ul className='co3-list co3-rv' aria-label={bulletsLabel} style={vi(2)}>
{bullets.map((b, i) => (
<li key={i}>
<span className='co3-tick' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span>{b}</span>
</li>
))}
</ul>
) : null}
</div>
<form
className='co3-form co3-rv'
style={vi(3)}
noValidate
aria-labelledby={headId}
onSubmit={handleSubmit}
onFocus={() => setNarrow(true)}
onBlur={(e) => {
const next = e.relatedTarget as Node | null
if (!next || !e.currentTarget.contains(next)) setNarrow(false)
}}
>
<div className={list.length === 2 ? 'co3-fields is-two' : 'co3-fields'}>
{list.map((f) => {
const fid = `${uid}-${f.name}`
const eid = `${fid}-error`
const err = errors[f.name]
const type = f.type ?? 'text'
return (
<div className='co3-field' key={f.name}>
<label className='co3-label' htmlFor={fid}>
{f.label}
</label>
<input
ref={(el) => {
inputs.current[f.name] = el
}}
id={fid}
className='co3-input'
name={f.name}
type={type}
autoComplete={f.autoComplete}
inputMode={type === 'email' ? 'email' : type === 'tel' ? 'tel' : undefined}
placeholder={f.placeholder ?? PLACEHOLDERS[type]}
required={f.required !== false}
value={values[f.name] ?? ''}
onChange={(e) => update(f.name, e.target.value)}
onBlur={() => blur(f)}
aria-invalid={err ? true : undefined}
aria-describedby={err ? eid : undefined}
disabled={isDisabled}
readOnly={pending}
/>
<div aria-live='polite'>
{err ? (
<p id={eid} className='co3-error'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{err}
</p>
) : null}
</div>
</div>
)
})}
</div>
<button type='submit' className={buttonClass} disabled={isDisabled} aria-busy={pending || undefined}>
{pending ? <Loader2 className='co3-spin' size={20} strokeWidth={2.5} aria-hidden='true' /> : null}
<span>{pending ? pendingLabel : label}</span>
</button>
{note ? (
<p className='co3-note'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{note}
</p>
) : null}
</form>
</div>
</div>
</section>
)
}
export default ClosingOptin3
function vi(i: number): React.CSSProperties {
return { ['--i' as string]: i } as React.CSSProperties
}
function withMark(node: React.ReactNode, phrase?: string): React.ReactNode {
if (typeof node !== 'string' || !phrase) return node
const at = node.indexOf(phrase)
if (at < 0) return node
return (
<>
{node.slice(0, at)}
<span className='co3-mark'>{phrase}</span>
{node.slice(at + phrase.length)}
</>
)
}
function fieldError(field: ClosingOptin3Field, raw: string, c: Copy): string {
const value = raw.trim()
if (!value) return field.required === false ? '' : c.required.replace('{label}', field.label.toLowerCase())
if ((field.type ?? 'text') === 'email' && !EMAIL.test(value)) return c.invalidEmail
return ''
}
function validate(list: ClosingOptin3Field[], values: Record<string, string>, c: Copy): Record<string, string> {
const found: Record<string, string> = {}
for (const f of list) {
const message = fieldError(f, values[f.name] ?? '', c)
if (message) found[f.name] = message
}
return found
}
function isThenable(v: unknown): v is PromiseLike<unknown> {
return typeof v === 'object' && v !== null && typeof (v as { then?: unknown }).then === 'function'
}
const CSS = `
.cf-closing-optin-3{--co3-top:clamp(56px,8vw,112px);--co3-bottom:clamp(64px,8.5vw,120px);--co3-gutter:clamp(16px,5vw,48px);--co3-shadow:var(--shadow,oklch(0.22 0.03 260));--co3-ring:oklch(from var(--field-focus,var(--accent)) calc(l + 0.22) c h);position:relative;display:grid;grid-template-columns:minmax(0,41fr) minmax(0,59fr);align-items:stretch;overflow-x:clip;background:var(--surface);color:var(--ink);font-family:var(--font-body)}
.cf-closing-optin-3 :where(*,*::before,*::after){box-sizing:border-box}
.cf-closing-optin-3 .co3-leave{position:relative;display:flex;justify-content:flex-end;padding:var(--co3-top) clamp(56px,5vw,80px) var(--co3-bottom) var(--co3-gutter);background:var(--surface);transition:background-color .4s ease}
.cf-closing-optin-3 .co3-leave-inner{display:flex;flex-direction:column;width:100%;max-width:400px;transform-origin:right top;transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.cf-closing-optin-3 .co3-leave-photo{position:relative;flex:1 1 auto;min-height:280px;margin:40px 0 0;border-radius:12px;overflow:hidden;background:color-mix(in oklch,var(--ink) 6%,var(--surface))}
.cf-closing-optin-3 .co3-leave-photo img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center;border-radius:12px;filter:saturate(.72);transition:filter .4s ease,opacity .4s ease}
.cf-closing-optin-3[data-narrow='true'] .co3-leave-photo img{filter:saturate(.3);opacity:.55}
.cf-closing-optin-3 .co3-leave-intro{display:flex;align-items:center;gap:12px;margin:0 0 16px;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--muted);transition:color .4s ease}
.cf-closing-optin-3 .co3-x{display:inline-grid;place-items:center;flex:0 0 auto;width:28px;height:28px;border-radius:999px;background:var(--danger);color:var(--co3-glyph,#fff);transition:background-color .4s ease}
.cf-closing-optin-3 .co3-leave-line{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-transform:var(--display-case,none);color:var(--ink);text-wrap:balance;transition:color .4s ease}
.cf-closing-optin-3 .co3-leave-sub{margin:12px 0 0;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty;transition:color .4s ease}
.cf-closing-optin-3 .co3-leave-phone{display:none;margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:1.3125rem;line-height:1.25;letter-spacing:-0.01em;text-transform:var(--display-case,none);text-align:center;color:var(--ink);text-wrap:balance;transition:color .4s ease}
.cf-closing-optin-3 .co3-x-inline{width:24px;height:24px;vertical-align:-0.28em;margin-inline-end:10px}
.cf-closing-optin-3[data-narrow='true'] .co3-leave{background:color-mix(in oklch,var(--ink) 4%,var(--surface))}
.cf-closing-optin-3[data-narrow='true'] .co3-leave-inner{transform:scale(.97)}
.cf-closing-optin-3[data-narrow='true'] :is(.co3-leave-intro,.co3-leave-line,.co3-leave-sub,.co3-leave-phone){color:color-mix(in oklch,var(--ink) 38%,var(--surface))}
.cf-closing-optin-3[data-narrow='true'] .co3-x{background:color-mix(in oklch,var(--danger) 40%,var(--surface))}
.cf-closing-optin-3 .co3-offer{position:relative;isolation:isolate;padding:var(--co3-top) var(--co3-gutter) var(--co3-bottom) clamp(56px,6vw,96px);background:var(--band);color:var(--band-ink)}
.cf-closing-optin-3 .co3-offer-inner{position:relative;z-index:1;width:100%;max-width:640px}
.cf-closing-optin-3 .co3-or{position:absolute;z-index:2;left:0;top:calc(var(--co3-top) - 2px);display:grid;place-items:center;width:56px;height:56px;border-radius:999px;transform:translateX(-50%);background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--co3-shadow) l c h / .22),0 4px 10px -2px oklch(from var(--co3-shadow) l c h / .2));font-family:var(--font-display);font-size:.875rem;font-weight:800;line-height:1;letter-spacing:.08em;text-transform:uppercase}
.cf-closing-optin-3 .co3-grid{display:grid;grid-template-columns:184px minmax(0,1fr);grid-template-areas:'head head' 'cover list';column-gap:32px;row-gap:32px;align-items:start}
.cf-closing-optin-3 .co3-grid.no-cover{grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'list'}
.cf-closing-optin-3 .co3-head{grid-area:head;min-width:0}
.cf-closing-optin-3 .co3-h2{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);color:var(--band-ink);text-wrap:balance}
.cf-closing-optin-3 .co3-mark{color:var(--field-ink);background-color:var(--field,#fff);background-image:linear-gradient(var(--marker,#fae37c),var(--marker,#fae37c));padding:0 .12em .03em;margin:0 -.02em;border-radius:.08em .3em .12em .24em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-closing-optin-3 .co3-lead{margin:16px 0 0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);font-weight:500;line-height:1.4;color:var(--band-ink);text-wrap:pretty}
.cf-closing-optin-3 .co3-cover{grid-area:cover;margin:0;min-width:0}
.cf-closing-optin-3 .co3-cover img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;object-position:center;border-radius:0;filter:drop-shadow(0 2px 3px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .55)) drop-shadow(0 14px 18px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .5))}
.cf-closing-optin-3 .co3-list{grid-area:list;display:grid;gap:16px;margin:0;padding:8px 0 0;list-style:none;min-width:0}
.cf-closing-optin-3 .co3-list li{display:grid;grid-template-columns:24px minmax(0,1fr);gap:12px;align-items:start;font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:600;line-height:1.45;color:var(--band-ink);text-wrap:pretty}
.cf-closing-optin-3 .co3-tick{display:grid;place-items:center;width:24px;height:24px;margin-top:1px;border-radius:999px;background:var(--success);color:var(--co3-glyph,#fff)}
.cf-closing-optin-3 .co3-form{margin:40px 0 0;container-type:inline-size}
.cf-closing-optin-3 .co3-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
@container (min-width:480px){.cf-closing-optin-3 .co3-fields.is-two{grid-template-columns:repeat(2,minmax(0,1fr))}}
.cf-closing-optin-3 .co3-field{min-width:0}
.cf-closing-optin-3 .co3-label{display:block;margin:0 0 8px;font-size:1rem;font-weight:700;line-height:1.3;color:var(--band-ink)}
.cf-closing-optin-3 .co3-input{display:block;width:100%;height:56px;margin:0;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:1.0625rem;font-weight:500;line-height:1.2;box-shadow:inset 0 1px 2px oklch(from var(--co3-shadow) l c h / .14);outline:none;-webkit-appearance:none;appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
.cf-closing-optin-3 .co3-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-closing-optin-3 .co3-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--field-ink) 40%,var(--field))}
.cf-closing-optin-3 .co3-input:focus{border-color:var(--field-focus,var(--accent));box-shadow:inset 0 1px 2px oklch(from var(--co3-shadow) l c h / .14),0 0 0 3px var(--co3-ring)}
.cf-closing-optin-3 .co3-input[aria-invalid='true']{border-color:var(--danger);box-shadow:0 0 0 2px oklch(from var(--danger) calc(l + 0.18) c h)}
.cf-closing-optin-3 .co3-input[aria-invalid='true']:focus{box-shadow:0 0 0 3px oklch(from var(--danger) calc(l + 0.18) c h)}
.cf-closing-optin-3 .co3-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 8%,var(--field));color:color-mix(in oklch,var(--field-ink) 72%,var(--field))}
.cf-closing-optin-3 .co3-error{display:block;width:fit-content;max-width:100%;margin:8px 0 0;padding:6px 12px;border-radius:8px;background:var(--danger-soft);color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-closing-optin-3 .co3-error svg{display:inline-block;vertical-align:-.17em;margin-inline-end:.4em}
.cf-closing-optin-3 .co3-cta{--co3-bg:var(--button-bg,var(--cta));--co3-bg2:var(--button-bg-2,var(--cta-2));display:inline-flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:72px;margin:24px 0 0;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--co3-bg) calc(l + 0.04) c h),oklch(from var(--co3-bg2) calc(l - 0.02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);font-size:clamp(1.125rem,1.55vw,1.375rem);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(--co3-bg) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--co3-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .5),0 8px 16px -6px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .55));cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-closing-optin-3 .co3-cta:not(:disabled):not([aria-busy='true']):is(:hover,.is-hover){transform:translateY(-1px);background:linear-gradient(oklch(from var(--co3-bg) calc(l - 0.01) c h),oklch(from var(--co3-bg2) calc(l - 0.07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--co3-bg) calc(l + 0.12) c h / .7),inset 0 -3px 0 oklch(from var(--co3-bg) calc(l - 0.2) c h),0 1px 2px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .55),0 10px 18px -6px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .65))}
.cf-closing-optin-3 .co3-cta:not(:disabled):not([aria-busy='true']):is(:active,.is-active){transform:translateY(1px);background:linear-gradient(oklch(from var(--co3-bg) calc(l - 0.06) c h),oklch(from var(--co3-bg2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--co3-bg) calc(l - 0.22) c h / .55),inset 0 -2px 0 oklch(from var(--co3-bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--co3-shadow) calc(l - 0.1) c h / .45)}
.cf-closing-optin-3 .co3-cta:focus-visible{outline:3px solid var(--co3-ring);outline-offset:3px}
.cf-closing-optin-3 .co3-cta[aria-busy='true']{cursor:progress;background:linear-gradient(oklch(from var(--co3-bg) calc(l - 0.02) c h),oklch(from var(--co3-bg2) calc(l - 0.06) c h))}
.cf-closing-optin-3 .co3-cta: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,0 1px 2px oklch(from var(--co3-shadow) l c h / .2)))}
.cf-closing-optin-3 .co3-spin{flex:0 0 auto;animation:co3-spin .8s linear infinite}
.cf-closing-optin-3 .co3-note{margin:16px 0 0;text-align:center;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--band-ink);text-wrap:pretty}
.cf-closing-optin-3 .co3-note svg{display:inline-block;vertical-align:-.17em;margin-inline-end:.4em}
.cf-closing-optin-3[data-reveal='armed'] .co3-rv{opacity:.82;transform:translateY(8px)}
.cf-closing-optin-3[data-reveal='seen'] .co3-rv{animation:co3-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
@keyframes co3-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes co3-spin{to{transform:rotate(360deg)}}
@media (max-width:1180px) and (min-width:861px){
.cf-closing-optin-3 .co3-grid{grid-template-columns:140px minmax(0,1fr);column-gap:24px}
}
@media (max-width:860px){
.cf-closing-optin-3{grid-template-columns:minmax(0,1fr)}
.cf-closing-optin-3 .co3-leave{justify-content:center;padding:28px var(--co3-gutter) 48px}
.cf-closing-optin-3 .co3-leave-inner{max-width:640px;transform-origin:center top}
.cf-closing-optin-3 .co3-leave-desk,.cf-closing-optin-3 .co3-leave-photo{display:none}
.cf-closing-optin-3 .co3-leave-phone{display:block}
.cf-closing-optin-3 .co3-offer{padding:64px var(--co3-gutter) var(--co3-bottom)}
.cf-closing-optin-3 .co3-offer-inner{margin-inline:auto}
.cf-closing-optin-3 .co3-or{left:50%;top:0;transform:translate(-50%,-50%)}
.cf-closing-optin-3 .co3-grid{grid-template-columns:128px minmax(0,1fr);column-gap:20px;row-gap:24px}
.cf-closing-optin-3 .co3-form{margin-top:32px}
}
@media (max-width:480px){
.cf-closing-optin-3 .co3-grid:not(.no-cover){grid-template-columns:minmax(0,1fr);grid-template-areas:'head' 'cover' 'list';row-gap:16px}
.cf-closing-optin-3 .co3-cover{justify-self:start;width:144px;margin-left:-8px}
.cf-closing-optin-3 .co3-list{padding-top:0;gap:12px}
.cf-closing-optin-3 .co3-cta{padding:0 20px}
}
@media (prefers-reduced-motion:reduce){
.cf-closing-optin-3 :is(.co3-leave,.co3-leave-inner,.co3-leave-intro,.co3-leave-line,.co3-leave-sub,.co3-leave-phone,.co3-x,.co3-input,.co3-cta,.co3-leave-photo img){transition:none}
.cf-closing-optin-3 .co3-rv,.cf-closing-optin-3 .co3-spin{animation:none}
.cf-closing-optin-3[data-narrow='true'] .co3-leave-inner{transform:none}
.cf-closing-optin-3 .co3-cta:not(:disabled):not([aria-busy='true']):is(:hover,.is-hover),.cf-closing-optin-3 .co3-cta:not(:disabled):not([aria-busy='true']):is(:active,.is-active){transform:none}
}
`
pieces/forms/closing-optin-3/specimen.tsx 42 lines
import __studioImage334c3ec8 from "../assets/667862e9cc267cbf.webp";
import __studioImage0b469daa from "../assets/d07cca49a5b97009.webp";
import React from 'react'
import { ClosingOptin3, type ClosingOptin3State } from '../closing-optin-3'
import defaults from '../../studio-defaults.json'
import { slot } from '../../slots'
export const states = ['default', 'hover', 'active', 'disabled', 'error']
export default function ClosingOptin3Specimen({ state = 'default' }: { state?: ClosingOptin3State }) {
return (
<ClosingOptin3
state={state}
leaveIntro='If you close this page'
leaveLines={['You keep guessing at titles, photos and prices.', 'And your best pieces keep waiting to be found.']}
leaveImage={slot(
'scene',
__studioImage334c3ec8,
)}
leaveImageAlt='Handmade pieces waiting on a studio shelf'
phoneLine='Close this page and you keep guessing.'
headline='Grab the free playbook and write listings buyers can find'
highlight='listings buyers can find'
lead='The Handmade Shop Listing Playbook takes you through titles, photos and descriptions, one listing at a time.'
bullets={[
'The title formula that matches how buyers really search',
'How to shoot product photos on your kitchen table',
'Why your description should answer one question first',
]}
bulletsLabel='Inside The Handmade Shop Listing Playbook'
coverImage={slot(
'product',
__studioImage0b469daa,
)}
coverAlt='The Handmade Shop Listing Playbook, a free guide for craft sellers'
label='Send Me The Free Playbook'
pendingLabel='Sending your playbook…'
note={`Free PDF · ${defaults.sample.registration.privacy}`}
onSubmit={() => new Promise<void>((resolve) => setTimeout(resolve, 1400))}
/>
)
}
| Name | Type | Details |
|---|---|---|
leaveIntro OptionalClosingOptin3 |
React.ReactNode |
|
leaveLines OptionalClosingOptin3 |
React.ReactNode[] |
|
leaveImage OptionalClosingOptin3 |
string |
|
leaveImageAlt OptionalClosingOptin3 |
string |
|
phoneLine OptionalClosingOptin3 |
React.ReactNode |
|
orLabel OptionalClosingOptin3 |
string |
|
headline OptionalClosingOptin3 |
React.ReactNode |
|
highlight OptionalClosingOptin3 |
string |
|
lead OptionalClosingOptin3 |
React.ReactNode |
|
bullets OptionalClosingOptin3 |
React.ReactNode[] |
|
bulletsLabel OptionalClosingOptin3 |
string |
|
coverImage OptionalClosingOptin3 |
string |
|
coverAlt OptionalClosingOptin3 |
string |
|
fields OptionalClosingOptin3 |
ClosingOptin3Field[] |
|
label OptionalClosingOptin3 |
string |
|
pendingLabel OptionalClosingOptin3 |
string |
|
note OptionalClosingOptin3 |
React.ReactNode |
|
copy OptionalClosingOptin3 |
{
// '{label}' is replaced with the field label
required?: string
invalidEmail?: string
} |
|
texture OptionalClosingOptin3 |
boolean |
|
onSubmit OptionalClosingOptin3 |
(values: Record<string, string>) => void | Promise<unknown> |
|
disabled OptionalClosingOptin3 |
boolean |
|
state OptionalClosingOptin3 |
ClosingOptin3State |
|
id OptionalClosingOptin3 |
string |
|
className OptionalClosingOptin3 |
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- 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).
scene- A wide atmosphere photo behind or beside the copy.
-
2c539f422023a290.webp
image/webp · 115 KB
-
667862e9cc267cbf.webp
image/webp · 109 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d07cca49a5b97009.webp
image/webp · 43 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB