Not Found 2
A 404 that turns a dead end into an opt-in: a giant type-set numeral on a colour block, a finder that suggests pages
Use it in a prompt
Use content/not-found-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/content/not-found-2.tsx. - Import it and pass your copy and images (Props tab):
import { NotFound2 } from "@/components/funneldna/content/not-found-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/content/not-found-2/component.tsx 900 lines
// layout: classic-centred-stack
// A 404 that turns a dead end into an opt-in: a giant type-set numeral on a colour block, a finder that suggests pages
// as the visitor types (listbox + keyboard), three popular links, then the lead magnet card straddling the block.
import * as React from 'react';
import { CircleAlert, FileText, Loader2, Lock, Search, SearchX } from 'lucide-react';
import { Backdrop, FX_HOST } from '../fx/fx';
import lightBackdrop from '../fx/backdrops/light';
export type NotFound2Page = {
label: string;
href: string;
/** One short line under the label in the suggestions. */
detail?: string;
/** Extra words the finder matches on (never shown). */
keywords?: string;
};
export type NotFound2State = 'default' | 'hover' | 'active' | 'error' | 'disabled';
export type NotFound2Props = {
/** The giant numeral (decorative; the headline carries the meaning). */
numeral?: string;
/** Read by screen readers before the headline. */
numeralLabel?: string;
/** One short, honest line under the numeral. */
headline?: string;
searchLabel?: string;
searchPlaceholder?: string;
searchButtonLabel?: string;
/** Inline error when the finder is submitted empty. */
emptySearchError?: string;
/** Template: {query} is replaced. Shown when nothing matches. */
noResults?: string;
/** Template: {count} is replaced. Announced to screen readers. */
resultsStatus?: string;
oneResultStatus?: string;
/** Accessible name of the suggestion list. */
suggestionsLabel?: string;
/** Key hint on the active suggestion. */
enterHint?: string;
popularLabel?: string;
/** Every page the finder can suggest. */
pages?: NotFound2Page[];
/** Three chips under the finder; defaults to the first three pages. */
popular?: NotFound2Page[];
maxSuggestions?: number;
/** Slot product: transparent cut-out of the lead magnet cover. */
magnetImage?: string;
magnetImageAlt?: string;
magnetTitle?: string;
magnetLead?: string;
/** Red mid-copy subhead, printed-sales-letter style. */
magnetSubhead?: string;
/** Plain instruction right above the button. */
magnetInstruction?: string;
emailLabel?: string;
emailPlaceholder?: string;
buttonLabel?: string;
busyLabel?: string;
privacy?: string;
emptyEmailError?: string;
invalidEmailError?: string;
/** The query and email the preview states show. */
stateQueries?: { active?: string; error?: string; email?: string };
/** fx backdrop photo behind the colour block (an imported fx backdrop asset). */
backdrop?: string;
/** Called when a suggestion or chip is chosen; call preventDefault to route it yourself. */
onSelectPage?: (page: NotFound2Page, event: React.MouseEvent<HTMLAnchorElement>) => void;
/** Called with the trimmed query when the finder is submitted without a chosen suggestion. */
onSearch?: (query: string) => void;
/** Validated opt-in values. Return a promise to show the busy state while it runs. */
onSubmit?: (values: { email: string }) => void | Promise<unknown>;
state?: NotFound2State;
className?: string;
};
const DEFAULT_PAGES: NotFound2Page[] = [
{ label: 'Home', href: '/', detail: 'Start from the top', keywords: 'start main front' },
{ label: 'Courses', href: '/courses', detail: 'Every course in one place', keywords: 'classes programs learn' },
{ label: 'Free training', href: '/free-training', detail: 'Watch the free on-demand workshop', keywords: 'webinar workshop video' },
{ label: 'Blog', href: '/blog', detail: 'Articles and how-tos', keywords: 'articles posts news' },
{ label: 'Member login', href: '/login', detail: 'Get back into your account', keywords: 'account sign in access members' },
{ label: 'Help & contact', href: '/contact', detail: 'Order help, access and refunds', keywords: 'support email refund' },
];
const DEFAULT_STATE_QUERIES = { active: 'co', error: 'price list', email: 'jane@example' };
export function NotFound2(props: NotFound2Props) {
const {
numeral = '404',
numeralLabel = 'Error 404.',
headline = 'That page isn’t here. Let’s find the right one.',
searchLabel = 'Search for the page you wanted',
searchPlaceholder = 'Try “courses”',
searchButtonLabel = 'Search',
emptySearchError = 'Type a word first, like “courses”.',
noResults = 'No page matches “{query}”. Try a popular page below.',
resultsStatus = '{count} pages found. Use the arrow keys to choose one.',
oneResultStatus = '1 page found. Press the down arrow to choose it.',
suggestionsLabel = 'Suggested pages',
enterHint = 'Enter',
popularLabel = 'Or jump to a popular page',
pages = DEFAULT_PAGES,
popular,
maxSuggestions = 6,
magnetImage,
magnetImageAlt = '',
magnetTitle = 'Grab the free starter guide',
magnetLead = 'Since you’re here, take the free starter guide: the first steps in one short read.',
magnetSubhead = 'Know exactly what to do first',
magnetInstruction = 'Click the button below to get instant access.',
emailLabel = 'Your email',
emailPlaceholder = 'you@example.com',
buttonLabel = 'Send it to me',
busyLabel = 'Sending…',
privacy = 'We respect your inbox. Unsubscribe anytime.',
emptyEmailError = 'Enter your email so we know where to send it.',
invalidEmailError = 'That email looks incomplete. Check the @ and the part after it.',
stateQueries = DEFAULT_STATE_QUERIES,
backdrop = lightBackdrop,
onSelectPage,
onSearch,
onSubmit,
state = 'default',
className,
} = props;
const uid = React.useId();
const headingId = `${uid}-h`;
const inputId = `${uid}-q`;
const listId = `${uid}-l`;
const noteId = `${uid}-n`;
const emailId = `${uid}-e`;
const errorId = `${uid}-x`;
const privacyId = `${uid}-p`;
const optionId = (i: number) => `${uid}-o${i}`;
const disabled = state === 'disabled';
const [query, setQuery] = React.useState(() => initialQuery(state, stateQueries));
const [open, setOpen] = React.useState(state === 'active');
const [active, setActive] = React.useState(state === 'active' ? 0 : -1);
const [searchError, setSearchError] = React.useState(false);
const [email, setEmail] = React.useState(state === 'error' ? stateQueries.email ?? '' : '');
const [emailError, setEmailError] = React.useState<'' | 'empty' | 'invalid'>(state === 'error' ? 'invalid' : '');
const [busy, setBusy] = React.useState(false);
const inputRef = React.useRef<HTMLInputElement>(null);
const emailRef = React.useRef<HTMLInputElement>(null);
const optionRefs = React.useRef<(HTMLAnchorElement | null)[]>([]);
const mounted = React.useRef(true);
const firstRun = React.useRef(true);
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
React.useEffect(() => {
if (firstRun.current) {
firstRun.current = false;
return;
}
setQuery(initialQuery(state, stateQueries));
setOpen(state === 'active');
setActive(state === 'active' ? 0 : -1);
setSearchError(false);
setEmail(state === 'error' ? stateQueries.email ?? '' : '');
setEmailError(state === 'error' ? 'invalid' : '');
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state]);
const q = query.trim();
const matches = React.useMemo(() => findPages(pages, q).slice(0, maxSuggestions), [pages, q, maxSuggestions]);
const listOpen = open && !disabled && q.length > 0 && matches.length > 0;
const activeIndex = listOpen && active >= 0 && active < matches.length ? active : -1;
const noMatch = q.length > 0 && matches.length === 0;
const chips = (popular ?? pages.slice(0, 3)).slice(0, 3);
const status = listOpen ? (matches.length === 1 ? oneResultStatus : fill(resultsStatus, q, matches.length)) : '';
const choose = (index: number) => {
optionRefs.current[index]?.click();
};
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'ArrowDown') {
if (!q || !matches.length) return;
event.preventDefault();
setOpen(true);
setActive((a) => (listOpen ? (a + 1) % matches.length : 0));
} else if (event.key === 'ArrowUp') {
if (!listOpen) return;
event.preventDefault();
setActive((a) => (a <= 0 ? matches.length - 1 : a - 1));
} else if (event.key === 'Enter') {
if (activeIndex >= 0) {
event.preventDefault();
choose(activeIndex);
}
} else if (event.key === 'Escape') {
if (listOpen) {
event.preventDefault();
setOpen(false);
setActive(-1);
} else if (query) {
event.preventDefault();
setQuery('');
}
} else if (event.key === 'Tab') {
setOpen(false);
}
};
const handleSearch = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (disabled) return;
if (activeIndex >= 0) {
choose(activeIndex);
return;
}
if (!q) {
setSearchError(true);
inputRef.current?.focus();
return;
}
setSearchError(false);
if (onSearch) {
setOpen(false);
onSearch(q);
return;
}
if (matches.length) {
setOpen(true);
setActive(0);
inputRef.current?.focus();
}
};
const handleEmailSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (disabled || busy) return;
const value = email.trim();
const problem: '' | 'empty' | 'invalid' = !value ? 'empty' : isEmail(value) ? '' : 'invalid';
setEmailError(problem);
if (problem) {
emailRef.current?.focus();
return;
}
const result = onSubmit?.({ email: value });
if (result && typeof (result as Promise<unknown>).then === 'function') {
setBusy(true);
(result as Promise<unknown>)
.then(
() => undefined,
() => undefined,
)
.then(() => {
if (mounted.current) setBusy(false);
});
}
};
const emailDescribedBy = [emailError ? errorId : '', privacy ? privacyId : ''].filter(Boolean).join(' ') || undefined;
const ctaClass = ['cf-nf2-cta', state === 'hover' && 'is-hover', busy && 'is-busy'].filter(Boolean).join(' ');
return (
<section className={['cf-nf2', className].filter(Boolean).join(' ')} aria-labelledby={headingId}>
<style>{CSS}</style>
<div className='cf-nf2-upper'>
<div className='cf-nf2-bg' style={{ ...FX_HOST, position: 'absolute' }} aria-hidden='true'>
<Backdrop src={backdrop} />
<div className='cf-nf2-scrim' />
</div>
<div className='cf-nf2-stack'>
<p className='cf-nf2-num' aria-hidden='true'>
{Array.from(numeral).map((ch, i) => (
<span key={i} style={delay(Math.min(i * 0.07, 0.28))}>
{ch}
</span>
))}
</p>
<h1 id={headingId} className='cf-nf2-h cf-nf2-in' style={delay(0.21)}>
<span className='cf-nf2-sr'>{numeralLabel} </span>
{headline}
</h1>
<form role='search' className='cf-nf2-search cf-nf2-in' style={delay(0.28)} onSubmit={handleSearch} noValidate>
<label htmlFor={inputId} className='cf-nf2-label'>
{searchLabel}
</label>
<div className={['cf-nf2-box', searchError && 'is-error', state === 'active' && 'is-focus'].filter(Boolean).join(' ')}>
<Search className='cf-nf2-lens' size={20} strokeWidth={2.5} aria-hidden='true' />
<input
ref={inputRef}
id={inputId}
className='cf-nf2-input'
type='text'
inputMode='search'
enterKeyHint='search'
role='combobox'
aria-expanded={listOpen}
aria-controls={listId}
aria-autocomplete='list'
aria-activedescendant={activeIndex >= 0 ? optionId(activeIndex) : undefined}
aria-invalid={searchError || undefined}
aria-describedby={noteId}
autoComplete='off'
spellCheck={false}
placeholder={searchPlaceholder}
value={query}
disabled={disabled}
onChange={(event) => {
const value = event.target.value;
setQuery(value);
setOpen(true);
setActive(-1);
if (searchError && value.trim()) setSearchError(false);
}}
onFocus={() => setOpen(true)}
onBlur={() => {
setOpen(false);
setActive(-1);
}}
onKeyDown={handleKeyDown}
/>
<button type='submit' className='cf-nf2-go' disabled={disabled}>
{searchButtonLabel}
</button>
<div id={listId} role='listbox' aria-label={suggestionsLabel} className='cf-nf2-list' hidden={!listOpen}>
{listOpen
? matches.map((page, i) => (
<a
key={page.href + page.label}
id={optionId(i)}
ref={(el) => {
optionRefs.current[i] = el;
}}
role='option'
aria-selected={i === activeIndex}
href={page.href}
tabIndex={-1}
className={['cf-nf2-opt', i === activeIndex && 'is-active'].filter(Boolean).join(' ')}
onMouseDown={(event) => event.preventDefault()}
onMouseEnter={() => setActive(i)}
onClick={(event) => {
setOpen(false);
onSelectPage?.(page, event);
}}
>
<FileText className='cf-nf2-opt-ic' size={18} strokeWidth={2.5} aria-hidden='true' />
<span className='cf-nf2-opt-text'>
<span className='cf-nf2-opt-label'>{highlight(page.label, q)}</span>
{page.detail ? <span className='cf-nf2-opt-detail'>{page.detail}</span> : null}
</span>
{i === activeIndex ? (
<kbd className='cf-nf2-kbd' aria-hidden='true'>
{enterHint}
</kbd>
) : null}
</a>
))
: null}
</div>
</div>
<div id={noteId} className='cf-nf2-note' aria-live='polite'>
{searchError ? (
<p className='cf-nf2-msg'>
<CircleAlert className='cf-nf2-ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{emptySearchError}
</p>
) : noMatch ? (
<p className='cf-nf2-msg'>
<SearchX className='cf-nf2-ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{fill(noResults, q, 0)}
</p>
) : null}
</div>
<p className='cf-nf2-sr' role='status'>
{status}
</p>
</form>
{chips.length ? (
<div className='cf-nf2-popular cf-nf2-in' style={delay(0.28)}>
<p className='cf-nf2-poplabel'>{popularLabel}</p>
<ul className='cf-nf2-chips'>
{chips.map((page, i) => (
<li key={page.href + page.label}>
<a
href={page.href}
className={['cf-nf2-chip', state === 'hover' && i === 0 && 'is-hover'].filter(Boolean).join(' ')}
onClick={(event) => onSelectPage?.(page, event)}
>
{page.label}
</a>
</li>
))}
</ul>
</div>
) : null}
</div>
</div>
<div className='cf-nf2-lower'>
<div className={['cf-nf2-card cf-nf2-in', !magnetImage && 'no-cover'].filter(Boolean).join(' ')} style={delay(0.28)}>
{magnetImage ? (
<div className='cf-nf2-cover'>
<img src={magnetImage} alt={magnetImageAlt} width={480} height={480} decoding='async' />
</div>
) : null}
<div className='cf-nf2-copy'>
<h2 className='cf-nf2-title'>{magnetTitle}</h2>
{magnetLead ? <p className='cf-nf2-lead'>{magnetLead}</p> : null}
{magnetSubhead ? <h3 className='cf-nf2-red'>{magnetSubhead}</h3> : null}
{magnetInstruction ? <p className='cf-nf2-instr'>{magnetInstruction}</p> : null}
<form className='cf-nf2-optin' noValidate onSubmit={handleEmailSubmit} aria-busy={busy || undefined}>
<label htmlFor={emailId} className='cf-nf2-elabel'>
{emailLabel}
</label>
<div className='cf-nf2-row'>
<input
ref={emailRef}
id={emailId}
className={['cf-nf2-email', emailError && 'is-error'].filter(Boolean).join(' ')}
type='email'
name='email'
inputMode='email'
autoComplete='email'
placeholder={emailPlaceholder}
value={email}
disabled={disabled}
aria-invalid={emailError ? true : undefined}
aria-describedby={emailDescribedBy}
onChange={(event) => {
const value = event.target.value;
setEmail(value);
if (emailError && isEmail(value.trim())) setEmailError('');
}}
/>
<button type='submit' className={ctaClass} disabled={disabled} aria-disabled={busy || undefined}>
{busy ? (
<>
<Loader2 className='cf-nf2-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
{busyLabel}
</>
) : (
buttonLabel
)}
</button>
</div>
{emailError ? (
<p id={errorId} className='cf-nf2-err' role='alert'>
<CircleAlert className='cf-nf2-ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{emailError === 'empty' ? emptyEmailError : invalidEmailError}
</p>
) : null}
{privacy ? (
<p id={privacyId} className='cf-nf2-privacy'>
<Lock className='cf-nf2-ic' size={16} strokeWidth={2.5} aria-hidden='true' />
{privacy}
</p>
) : null}
</form>
</div>
</div>
</div>
</section>
);
}
export default NotFound2;
function delay(seconds: number) {
return { '--d': `${seconds}s` } as React.CSSProperties;
}
function initialQuery(state: NotFound2State, queries: NotFound2Props['stateQueries'] = {}) {
if (state === 'active') return queries.active ?? '';
if (state === 'error') return queries.error ?? '';
return '';
}
function fill(template: string, query: string, count: number) {
return template.split('{query}').join(query).split('{count}').join(String(count));
}
function tokensOf(query: string) {
return query.toLowerCase().split(' ').filter(Boolean);
}
function rankPage(page: NotFound2Page, tokens: string[]) {
const label = page.label.toLowerCase();
const hay = [label, page.detail ?? '', page.keywords ?? '', page.href].join(' ').toLowerCase();
if (!tokens.every((t) => hay.includes(t))) return -1;
const t = tokens[0];
if (label.startsWith(t)) return 0;
if (label.split(' ').some((word) => word.startsWith(t))) return 1;
if (label.includes(t)) return 2;
return 3;
}
function findPages(pages: NotFound2Page[], query: string) {
const tokens = tokensOf(query);
if (!tokens.length) return [];
return pages
.map((page, order) => ({ page, order, rank: rankPage(page, tokens) }))
.filter((r) => r.rank >= 0)
.sort((a, b) => a.rank - b.rank || a.order - b.order)
.map((r) => r.page);
}
function highlight(label: string, query: string): React.ReactNode {
const token = tokensOf(query)[0];
const at = token ? label.toLowerCase().indexOf(token) : -1;
if (!token || at < 0) return label;
return (
<>
{label.slice(0, at)}
<strong>{label.slice(at, at + token.length)}</strong>
{label.slice(at + token.length)}
</>
);
}
function isEmail(value: string) {
const at = value.indexOf('@');
if (at < 1 || value.includes(' ')) return false;
const domain = value.slice(at + 1);
if (domain.includes('@')) return false;
const dot = domain.lastIndexOf('.');
return dot > 0 && dot < domain.length - 2;
}
const CSS = `
.cf-nf2 {
--nf-overlap: clamp(80px, 10vw, 128px);
--nf-gutter: clamp(16px, 5vw, 48px);
--nf-shadow: var(--shadow, oklch(0.22 0.03 256));
--nf-focus: var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
--nf-red: var(--subhead-ink, color-mix(in oklab, var(--cta, oklch(0.576 0.209 29.5)) 50%, var(--ink, oklch(0.21 0.034 263))));
--nf-shadow-sm: var(--shadow-sm, 0 1px 1px oklch(from var(--nf-shadow) l c h / 0.18), 0 1px 3px oklch(from var(--nf-shadow) l c h / 0.14));
--nf-shadow-md: var(--shadow-md, 0 1px 2px oklch(from var(--nf-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--nf-shadow) l c h / 0.2));
--nf-shadow-lg: var(--shadow-lg, 0 2px 4px oklch(from var(--nf-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--nf-shadow) l c h / 0.32));
position: relative;
isolation: isolate;
overflow-x: clip;
background: var(--surface, oklch(1 0 0));
color: var(--ink, oklch(0.21 0.034 263));
font-family: var(--font-body, system-ui, sans-serif);
}
.cf-nf2 *, .cf-nf2 *::before, .cf-nf2 *::after { box-sizing: border-box; }
.cf-nf2-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cf-nf2-ic { display: inline-block; vertical-align: -0.15em; margin-inline-end: 0.4em; }
.cf-nf2-upper {
position: relative;
padding: clamp(56px, 8vw, 112px) var(--nf-gutter) 88px;
text-align: center;
background: var(--band, oklch(0.27 0.067 256));
color: var(--band-ink, oklch(1 0 0));
}
.cf-nf2-bg {
inset: 0 0 calc(-1 * var(--nf-overlap)) 0;
z-index: 0;
overflow: hidden;
background: var(--band, oklch(0.27 0.067 256));
pointer-events: none;
}
.cf-nf2-scrim {
position: absolute;
inset: 0;
z-index: 2;
background: oklch(from var(--band, oklch(0.27 0.067 256)) l c h / 0.7);
}
.cf-nf2-stack { position: relative; z-index: 3; max-width: 46rem; margin: 0 auto; }
.cf-nf2-num {
margin: 0 0 clamp(12px, 2vw, 24px);
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: clamp(8.5rem, 26vw, 19rem);
line-height: 0.82;
letter-spacing: -0.055em;
font-variant-numeric: lining-nums tabular-nums;
white-space: nowrap;
color: var(--band-ink, oklch(1 0 0));
text-shadow: 0 2px 3px oklch(from var(--nf-shadow) calc(l - 0.06) c h / 0.35);
}
.cf-nf2-num span { display: inline-block; animation: cf-nf2-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) both; }
.cf-nf2-num span:last-child { letter-spacing: 0; }
.cf-nf2-in { animation: cf-nf2-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) both; }
@keyframes cf-nf2-rise { from { opacity: 0.82; transform: translateY(8px); } }
.cf-nf2-h {
margin: 0 auto clamp(24px, 3vw, 32px);
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.025em);
font-size: clamp(2rem, 3.6vw, 3.25rem);
line-height: 1.06;
text-wrap: balance;
color: var(--band-ink, oklch(1 0 0));
}
.cf-nf2-search { position: relative; z-index: 5; max-width: 40rem; margin: 0 auto; }
.cf-nf2-label {
display: block;
margin: 0 0 12px;
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
font-weight: 700;
line-height: 1.3;
color: var(--band-ink, oklch(1 0 0));
}
.cf-nf2-box { position: relative; }
.cf-nf2-lens {
position: absolute;
left: 20px;
top: 32px;
transform: translateY(-50%);
pointer-events: none;
color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 70%, var(--field, oklch(1 0 0)));
}
.cf-nf2-input {
display: block;
width: 100%;
height: 64px;
margin: 0;
padding: 0 124px 0 54px;
appearance: none;
background: var(--field, oklch(1 0 0));
color: var(--field-ink, oklch(0.21 0.034 263));
border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 22%, transparent));
border-radius: var(--field-radius, var(--radius, 12px));
font: 500 clamp(1.0625rem, 1.25vw, 1.125rem) / 1.2 var(--font-body, system-ui, sans-serif);
box-shadow: var(--nf-shadow-md);
transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cf-nf2-input::placeholder { color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 65%, var(--field, oklch(1 0 0))); opacity: 1; }
.cf-nf2-input:hover:not(:disabled):not(:focus) { border-color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 40%, var(--field, oklch(1 0 0))); }
.cf-nf2-input:focus, .cf-nf2-box.is-focus .cf-nf2-input {
outline: none;
border-color: var(--nf-focus);
box-shadow: 0 0 0 3px oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.6), var(--nf-shadow-md);
}
.cf-nf2-box.is-error .cf-nf2-input {
border: 2px solid var(--danger, oklch(0.5 0.17 27));
box-shadow: 0 0 0 3px oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.6), var(--nf-shadow-md);
}
.cf-nf2-input:disabled { cursor: not-allowed; background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 6%, var(--field, oklch(1 0 0))); }
.cf-nf2-go {
position: absolute;
top: 8px;
right: 8px;
height: 48px;
min-width: 96px;
padding: 0 20px;
display: inline-flex;
align-items: center;
justify-content: center;
border: 1px solid var(--button-2-border, transparent);
border-radius: max(0px, calc(var(--field-radius, var(--radius, 12px)) - 4px));
background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263)));
font-family: var(--button-font, var(--font-display, inherit));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.0625rem, 1.25vw, 1.125rem);
line-height: 1;
white-space: nowrap;
box-shadow: var(--button-2-shadow, var(--nf-shadow-sm));
cursor: pointer;
transition: background 0.16s ease, transform 0.16s ease;
}
.cf-nf2-go:hover:not(:disabled) { background: oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263))) calc(l - 0.04) c h); }
.cf-nf2-go:active:not(:disabled) { transform: translateY(1px); }
.cf-nf2-go:focus-visible { outline: 3px solid var(--nf-focus); outline-offset: 2px; }
.cf-nf2-go:disabled { cursor: not-allowed; }
.cf-nf2-list {
position: absolute;
top: calc(100% + 8px);
left: 0;
right: 0;
z-index: 10;
display: grid;
gap: 2px;
padding: 6px;
text-align: left;
background: var(--card, oklch(1 0 0));
border: 1px solid var(--card-border, oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--nf-shadow-lg);
animation: cf-nf2-drop 0.16s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cf-nf2-list[hidden] { display: none; }
@keyframes cf-nf2-drop { from { opacity: 0.82; transform: translateY(-4px); } }
.cf-nf2-opt {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 14px;
border-radius: 10px;
color: var(--ink, oklch(0.21 0.034 263));
text-decoration: none;
cursor: pointer;
}
.cf-nf2-opt-ic { flex: none; margin-top: 2px; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-nf2-opt-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cf-nf2-opt-label { font-size: clamp(1.0625rem, 1.25vw, 1.125rem); font-weight: 500; line-height: 1.3; color: var(--ink, oklch(0.21 0.034 263)); }
.cf-nf2-opt-label strong { font-weight: 800; }
.cf-nf2-opt-detail { font-size: 0.9375rem; font-weight: 500; line-height: 1.4; color: var(--muted, oklch(0.45 0.03 258)); text-wrap: pretty; }
.cf-nf2-opt.is-active {
background: color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 10%, var(--card, oklch(1 0 0)));
box-shadow: inset 0 0 0 2px oklch(from var(--accent, oklch(0.5 0.17 257)) l c h / 0.45);
}
.cf-nf2-opt.is-active .cf-nf2-opt-ic { color: var(--accent, oklch(0.5 0.17 257)); }
.cf-nf2-opt.is-active .cf-nf2-opt-detail { color: var(--ink, oklch(0.21 0.034 263)); }
.cf-nf2-kbd {
flex: none;
align-self: center;
padding: 4px 12px;
border-radius: 999px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 7%, var(--card, oklch(1 0 0)));
color: var(--ink, oklch(0.21 0.034 263));
font: 800 0.875rem / 1.2 var(--font-body, system-ui, sans-serif);
}
.cf-nf2-msg {
margin: 12px 0 0;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
text-wrap: pretty;
color: var(--band-ink, oklch(1 0 0));
}
.cf-nf2-popular { margin-top: 24px; }
.cf-nf2-poplabel { margin: 0 0 12px; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; color: var(--band-ink, oklch(1 0 0)); }
.cf-nf2-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cf-nf2-chip {
display: inline-flex;
align-items: center;
min-height: 32px;
padding: 4px 14px;
border-radius: 999px;
border: 1px solid oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.26);
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.12);
color: var(--band-ink, oklch(1 0 0));
font-size: 0.875rem;
font-weight: 800;
line-height: 1.2;
text-decoration: none;
transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}
.cf-nf2-chip:hover, .cf-nf2-chip.is-hover {
background: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.2);
border-color: oklch(from var(--band-ink, oklch(1 0 0)) l c h / 0.45);
}
.cf-nf2-chip:active { transform: translateY(1px); }
.cf-nf2-chip:focus-visible { outline: 3px solid var(--band-ink, oklch(1 0 0)); outline-offset: 2px; }
.cf-nf2-lower { position: relative; z-index: 2; padding: 0 var(--nf-gutter) clamp(64px, 8.5vw, 120px); }
.cf-nf2-card {
position: relative;
max-width: 56rem;
margin: 0 auto;
display: grid;
grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
gap: clamp(24px, 4vw, 40px);
align-items: start;
padding: clamp(20px, 3vw, 32px) clamp(20px, 3.5vw, 40px);
background: var(--card, oklch(1 0 0));
border: 1px solid var(--card-border, oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.12));
border-radius: var(--card-radius, var(--radius, 14px));
box-shadow: var(--card-shadow, var(--nf-shadow-lg));
color: var(--ink, oklch(0.21 0.034 263));
text-align: left;
}
.cf-nf2-card.no-cover { grid-template-columns: minmax(0, 1fr); }
.cf-nf2-cover { margin-top: -56px; }
.cf-nf2-cover img {
display: block;
width: 100%;
height: auto;
aspect-ratio: 1 / 1;
object-fit: contain;
filter: drop-shadow(0 2px 3px oklch(from var(--nf-shadow) l c h / 0.3)) drop-shadow(0 14px 16px oklch(from var(--nf-shadow) l c h / 0.26));
}
.cf-nf2-title {
margin: 0 0 12px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: -0.01em;
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
text-wrap: balance;
color: var(--ink, oklch(0.21 0.034 263));
}
.cf-nf2-lead { margin: 0 0 20px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); line-height: 1.5; text-wrap: pretty; color: var(--ink, oklch(0.21 0.034 263)); }
.cf-nf2-red {
margin: 0 0 8px;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
letter-spacing: -0.01em;
font-size: clamp(1.125rem, 1.5vw, 1.375rem);
line-height: 1.25;
text-wrap: balance;
color: var(--nf-red);
}
.cf-nf2-instr { margin: 0 0 16px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); font-weight: 700; line-height: 1.45; text-wrap: pretty; color: var(--ink, oklch(0.21 0.034 263)); }
.cf-nf2-elabel { display: block; margin: 0 0 8px; font-size: clamp(1.0625rem, 1.25vw, 1.125rem); font-weight: 700; line-height: 1.3; color: var(--label-ink, var(--ink, oklch(0.21 0.034 263))); }
.cf-nf2-row { display: flex; gap: 12px; align-items: stretch; }
.cf-nf2-email {
flex: 1;
min-width: 0;
height: 56px;
margin: 0;
padding: 0 16px;
appearance: none;
background: var(--field, oklch(1 0 0));
color: var(--field-ink, oklch(0.21 0.034 263));
border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 22%, transparent));
border-radius: var(--field-radius, var(--radius, 12px));
font: 500 clamp(1.0625rem, 1.25vw, 1.125rem) / 1.2 var(--font-body, system-ui, sans-serif);
transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cf-nf2-email::placeholder { color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 65%, var(--field, oklch(1 0 0))); opacity: 1; }
.cf-nf2-email:hover:not(:disabled):not(:focus):not(.is-error) { border-color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 40%, var(--field, oklch(1 0 0))); }
.cf-nf2-email:focus { outline: none; border-color: var(--nf-focus); box-shadow: 0 0 0 3px oklch(from var(--nf-focus) l c h / 0.35); }
.cf-nf2-email.is-error { border: 2px solid var(--danger, oklch(0.5 0.17 27)); box-shadow: 0 0 0 3px oklch(from var(--danger, oklch(0.5 0.17 27)) l c h / 0.2); }
.cf-nf2-email:disabled { cursor: not-allowed; background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 6%, var(--field, oklch(1 0 0))); }
.cf-nf2-err { margin: 8px 0 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; text-wrap: pretty; color: var(--danger, oklch(0.5 0.17 27)); }
.cf-nf2-privacy { margin: 12px 0 0; font-size: 0.9375rem; font-weight: 500; line-height: 1.4; text-wrap: pretty; color: var(--muted, oklch(0.45 0.03 258)); }
.cf-nf2-cta {
--nf-b: var(--button-bg, var(--cta, oklch(0.576 0.209 29.5)));
--nf-b2: var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5)));
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 56px;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--nf-b) calc(l + 0.04) c h), oklch(from var(--nf-b2) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
font-family: var(--button-font, var(--font-display, inherit));
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;
white-space: nowrap;
text-shadow: var(--button-text-shadow, none);
cursor: pointer;
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--nf-b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--nf-b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--nf-shadow) l c h / 0.3), 0 8px 16px -6px oklch(from var(--nf-shadow) l c h / 0.45));
transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.cf-nf2-cta:hover:not(:disabled), .cf-nf2-cta.is-hover {
background: linear-gradient(oklch(from var(--nf-b) calc(l - 0.01) c h), oklch(from var(--nf-b2) calc(l - 0.07) c h));
box-shadow: inset 0 1px 0 oklch(from var(--nf-b) calc(l + 0.1) c h / 0.7), inset 0 -3px 0 oklch(from var(--nf-b) calc(l - 0.2) c h), 0 1px 2px oklch(from var(--nf-shadow) l c h / 0.32), 0 10px 18px -6px oklch(from var(--nf-shadow) l c h / 0.52);
}
.cf-nf2-cta:active:not(:disabled) {
transform: translateY(1px);
box-shadow: inset 0 2px 4px oklch(from var(--nf-b) calc(l - 0.22) c h / 0.45), inset 0 -2px 0 oklch(from var(--nf-b) calc(l - 0.16) c h), 0 1px 2px oklch(from var(--nf-shadow) l c h / 0.3);
}
.cf-nf2-cta:focus-visible { outline: 3px solid var(--nf-focus); outline-offset: 3px; }
.cf-nf2-cta.is-busy { cursor: progress; }
.cf-nf2-cta:disabled {
cursor: not-allowed;
background: var(--button-2-bg, var(--secondary, oklch(0.93 0.015 263)));
color: var(--button-2-ink, var(--secondary-ink, oklch(0.21 0.034 263)));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--nf-shadow-sm));
}
.cf-nf2-spin { animation: cf-nf2-spin 0.8s linear infinite; }
@keyframes cf-nf2-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
.cf-nf2 { --nf-overlap: 80px; }
.cf-nf2-input { padding-right: 112px; }
.cf-nf2-go { min-width: 88px; padding: 0 16px; }
.cf-nf2-kbd { display: none; }
.cf-nf2-card { grid-template-columns: minmax(0, 1fr); gap: 16px; text-align: center; }
.cf-nf2-cover { width: min(10rem, 60%); margin: -56px auto 0; }
.cf-nf2-row { flex-direction: column; }
.cf-nf2-email { flex: none; width: 100%; height: 56px; }
.cf-nf2-cta { width: 100%; min-height: 64px; }
}
@media (pointer: coarse) {
.cf-nf2-chip { min-height: 44px; padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-nf2 .cf-nf2-num span, .cf-nf2 .cf-nf2-in, .cf-nf2 .cf-nf2-list, .cf-nf2 .cf-nf2-spin { animation: none; }
.cf-nf2 .cf-nf2-input, .cf-nf2 .cf-nf2-go, .cf-nf2 .cf-nf2-chip, .cf-nf2 .cf-nf2-email, .cf-nf2 .cf-nf2-cta { transition: none; }
}
`;
pieces/content/not-found-2/specimen.tsx 46 lines
import __studioImage8dfc5021 from "../assets/1f33fab443178205.webp";
// Specimen: The Copy Kitchen 404, with its page list, three popular links and the free Headline Recipe Card.
import * as React from 'react';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
import kitchen from '../../fx/backdrops/kitchen';
import { NotFound2, type NotFound2Page, type NotFound2State } from '../not-found-2';
export const states = ['default', 'hover', 'active', 'error', 'disabled'];
const PAGES: NotFound2Page[] = [
{ label: 'Home', href: '/', detail: 'Courses, free training and the blog', keywords: 'start main front' },
{ label: 'Headline Bootcamp', href: '/courses/headline-bootcamp', detail: 'Six lessons on writing headlines people read', keywords: 'headlines course class titles hooks' },
{ label: 'Sales Page Masterclass', href: '/courses/sales-page-masterclass', detail: 'Plan and write a long-form sales page', keywords: 'sales letter long form course' },
{ label: 'Email Copy Lab', href: '/courses/email-copy-lab', detail: 'Subject lines, sequences and newsletters', keywords: 'email newsletter subject course' },
{ label: 'Free headline workshop', href: '/free-training', detail: 'Watch the free on-demand workshop', keywords: 'webinar training video free' },
{ label: 'Copy teardown blog', href: '/blog', detail: 'Weekly breakdowns of ads and sales pages', keywords: 'articles posts examples' },
{ label: 'Student login', href: '/login', detail: 'Get back into your courses', keywords: 'account sign in members access' },
{ label: 'Help & contact', href: '/contact', detail: 'Order help, access and refunds', keywords: 'support refund email' },
];
export default function NotFound2Specimen({ state }: { state?: NotFound2State }) {
return (
<NotFound2
state={state}
backdrop={kitchen}
headline='That page isn’t here. Let’s find the right one.'
searchPlaceholder='Try “headlines”'
emptySearchError='Type a word first, like “headlines”.'
pages={PAGES}
popular={[PAGES[1], PAGES[4], PAGES[6]]}
stateQueries={{ active: 'head', error: 'recipe box', email: 'dana@copykitchen' }}
magnetImage={slot(
'product',
__studioImage8dfc5021,
)}
magnetImageAlt='The Headline Recipe Card, a printable page of fill-in-the-blank headline formulas'
magnetTitle='Grab the free Headline Recipe Card'
magnetLead='Since you’re here: 21 fill-in-the-blank headline formulas from Headline Bootcamp, on one printable page.'
magnetSubhead='Pick a recipe. Fill the blanks. Publish.'
magnetInstruction='Click the button below to get instant access.'
buttonLabel='Send it to me'
privacy={defaults.sample.registration.privacy}
/>
);
}
| Name | Type | Details |
|---|---|---|
numeral OptionalNotFound2 |
string |
|
numeralLabel OptionalNotFound2 |
string |
|
headline OptionalNotFound2 |
string |
|
searchLabel OptionalNotFound2 |
string |
|
searchPlaceholder OptionalNotFound2 |
string |
|
searchButtonLabel OptionalNotFound2 |
string |
|
emptySearchError OptionalNotFound2 |
string |
|
noResults OptionalNotFound2 |
string |
|
resultsStatus OptionalNotFound2 |
string |
|
oneResultStatus OptionalNotFound2 |
string |
|
suggestionsLabel OptionalNotFound2 |
string |
|
enterHint OptionalNotFound2 |
string |
|
popularLabel OptionalNotFound2 |
string |
|
pages OptionalNotFound2 |
NotFound2Page[] |
|
popular OptionalNotFound2 |
NotFound2Page[] |
|
maxSuggestions OptionalNotFound2 |
number |
|
magnetImage OptionalNotFound2 |
string |
|
magnetImageAlt OptionalNotFound2 |
string |
|
magnetTitle OptionalNotFound2 |
string |
|
magnetLead OptionalNotFound2 |
string |
|
magnetSubhead OptionalNotFound2 |
string |
|
magnetInstruction OptionalNotFound2 |
string |
|
emailLabel OptionalNotFound2 |
string |
|
emailPlaceholder OptionalNotFound2 |
string |
|
buttonLabel OptionalNotFound2 |
string |
|
busyLabel OptionalNotFound2 |
string |
|
privacy OptionalNotFound2 |
string |
|
emptyEmailError OptionalNotFound2 |
string |
|
invalidEmailError OptionalNotFound2 |
string |
|
stateQueries OptionalNotFound2 |
{ active?: string; error?: string; email?: string } |
|
backdrop OptionalNotFound2 |
string |
|
onSelectPage OptionalNotFound2 |
(page: NotFound2Page, event: React.MouseEvent<HTMLAnchorElement>) => void |
|
onSearch OptionalNotFound2 |
(query: string) => void |
|
onSubmit OptionalNotFound2 |
(values: { email: string }) => void | Promise<unknown> |
|
state OptionalNotFound2 |
NotFound2State |
|
className OptionalNotFound2 |
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-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
product- The main product shot or cover (ebook, kit, bottle).
-
1f33fab443178205.webp
image/webp · 156 KB
-
59f3da641341e0e5.webp
image/webp · 37.7 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB
-
f6dd01ecec4a2c0e.webp
image/webp · 105 KB