Confirm Email Hero 1
Double opt-in first screen. It names the address, opens the visitor’s own inbox in one click and keeps a resend one tap away, so the lead becomes real.
Use it in a prompt
Use hero/confirm-email-hero 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/hero/confirm-email-hero.tsx. - Import it and pass your copy and images (Props tab):
import { ConfirmEmailHero } from "@/components/funneldna/hero/confirm-email-hero"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/confirm-email-hero/component.tsx 612 lines
// layout: spotlight-row
// Double opt-in first screen. It names the address, opens the visitor’s own inbox in one click and keeps a resend one tap away, so the lead becomes real.
import * as React from "react";
import { Check, Inbox, Mail, Search, X } from "lucide-react";
import { BackdropVideo, Divider, FX_HOST } from "../fx/fx";
import bokeh from "../fx/loops/bokeh";
/** Inbox providers the hero can detect from the email domain. */
export type MailProvider = "gmail" | "outlook" | "yahoo" | "icloud";
/** Every visible word. Placeholders: {provider} (provider name), {sender} (sender name or search term), {time} (m:ss). */
export type ConfirmEmailHeroCopy = {
progressDone: string;
progressNext: string;
sentTo: string;
/** Shown when no email prop is supplied. */
sentToMissing: string;
fixLink: string;
fieldLabel: string;
fieldPlaceholder: string;
save: string;
cancel: string;
errorEmpty: string;
errorInvalid: string;
/** Primary button when the provider is known. */
openLabel: string;
/** Primary button when the domain is not a known provider (no link). */
genericLabel: string;
openNote: string;
genericNote: string;
/** Used for {sender} when no senderName is supplied. */
senderFallback: string;
otherApps: string;
lookFor: string;
searchHint: string;
resendTitle: string;
resendBody: string;
resendLabel: string;
resendWait: string;
/** Announced to screen readers when the cooldown ends. */
resendReady: string;
resendFix: string;
};
export type ConfirmEmailHeroProps = {
/** The address the visitor signed up with. Drives provider detection. */
email?: string;
/** Sender name exactly as it appears in the inbox. */
senderName?: string;
senderEmail?: string;
/** Subject line of the confirmation email. */
subject?: string;
/** First line of the email body, shown as the inbox preview. */
preview?: string;
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
headlineEmphasis?: string;
lead?: string;
/** Seconds before the resend button unlocks, on load and after each resend. */
cooldownSeconds?: number;
copy?: Partial<ConfirmEmailHeroCopy>;
providerNames?: Partial<Record<MailProvider, string>>;
/** Background loop module from ../fx/loops. */
loop?: typeof bokeh;
/** Called with a validated new address. */
onChangeEmail?: (email: string) => void;
/** Called when the visitor asks for a fresh copy. */
onResend?: (email: string) => void;
/** Called when the primary button or a provider link is used; null means the generic button. */
onOpenInbox?: (provider: MailProvider | null, email: string) => void;
state?: "default" | "hover" | "active" | "error";
className?: string;
};
const DEFAULT_COPY: ConfirmEmailHeroCopy = {
progressDone: "Step 1 of 2 done",
progressNext: "confirm your email",
sentTo: "We sent your confirmation link to",
sentToMissing: "We sent your confirmation link to the address you entered.",
fixLink: "Wrong address? Fix it",
fieldLabel: "Your email address",
fieldPlaceholder: "you@example.com",
save: "Use this address",
cancel: "Cancel",
errorEmpty: "Enter your email address so we know where to send the link.",
errorInvalid: "That address looks incomplete. Check it reads like name@example.com.",
openLabel: "Open my {provider}",
genericLabel: "Open my email",
openNote: "Opens {provider} in a new tab. Look for {sender}.",
genericNote: "Open the inbox you signed up with and look for {sender}.",
senderFallback: "our email",
otherApps: "Use a different app:",
lookFor: "Look for this in your inbox",
searchHint: "Not at the top? Search your inbox for “{sender}”.",
resendTitle: "Didn’t arrive?",
resendBody: "Give it a minute and check Promotions and Spam. Still nothing? Send a fresh copy.",
resendLabel: "Resend the email",
resendWait: "Resend in {time}",
resendReady: "You can resend the email now.",
resendFix: "Typo in your address? Fix it",
};
const DEFAULT_PROVIDER_NAMES: Record<MailProvider, string> = {
gmail: "Gmail",
outlook: "Outlook",
yahoo: "Yahoo Mail",
icloud: "iCloud Mail",
};
const PROVIDER_ORDER: MailProvider[] = ["gmail", "outlook", "yahoo", "icloud"];
/** Exact domains, or a prefix followed by any country ending ("hotmail" matches hotmail.co.uk). */
const PROVIDER_DOMAINS: Record<MailProvider, string[]> = {
gmail: ["gmail.com", "googlemail.com"],
outlook: ["outlook", "hotmail", "live", "msn.com"],
yahoo: ["yahoo", "ymail.com", "rocketmail.com"],
icloud: ["icloud.com", "me.com", "mac.com"],
};
const EMAIL_RE = /^[^ @]+@[^ @]+[.][^ @.]{2,}$/;
export function ConfirmEmailHero(props: ConfirmEmailHeroProps) {
const {
email,
senderName,
senderEmail,
subject,
preview,
headline = "Almost there. Open your inbox and click confirm.",
headlineEmphasis = "click confirm",
lead = "One click on the button in our email confirms your address and sends what you signed up for.",
cooldownSeconds = 60,
copy: copyProp,
providerNames,
loop = bokeh,
onChangeEmail,
onResend,
onOpenInbox,
state = "default",
className,
} = props;
const copy: ConfirmEmailHeroCopy = { ...DEFAULT_COPY, ...copyProp };
const names: Record<MailProvider, string> = { ...DEFAULT_PROVIDER_NAMES, ...providerNames };
const uid = React.useId();
const ids = { head: `${uid}-h`, prog: `${uid}-p`, field: `${uid}-f`, err: `${uid}-e` };
const [address, setAddress] = React.useState((email ?? "").trim());
React.useEffect(() => {
setAddress((email ?? "").trim());
}, [email]);
const initialBroken = brokenDraft((email ?? "").trim());
const [editing, setEditing] = React.useState(state === "error");
const [draft, setDraft] = React.useState(state === "error" ? initialBroken : (email ?? "").trim());
const [error, setError] = React.useState<string | null>(
state === "error" ? (initialBroken ? copy.errorInvalid : copy.errorEmpty) : null,
);
React.useEffect(() => {
if (state !== "error") return;
const d = brokenDraft((email ?? "").trim());
setEditing(true);
setDraft(d);
setError(d ? copy.errorInvalid : copy.errorEmpty);
}, [state]);
const inputRef = React.useRef<HTMLInputElement>(null);
const fixRef = React.useRef<HTMLButtonElement>(null);
const focusNext = React.useRef<"input" | "fix" | null>(null);
React.useEffect(() => {
if (focusNext.current === "input") inputRef.current?.focus();
if (focusNext.current === "fix") fixRef.current?.focus();
focusNext.current = null;
}, [editing]);
const openEditor = () => {
if (editing) {
inputRef.current?.focus();
return;
}
setDraft(address);
setError(null);
focusNext.current = "input";
setEditing(true);
};
const closeEditor = () => {
setError(null);
focusNext.current = "fix";
setEditing(false);
};
const submitEmail = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
const value = draft.trim();
if (!value) {
setError(copy.errorEmpty);
inputRef.current?.focus();
return;
}
if (!EMAIL_RE.test(value)) {
setError(copy.errorInvalid);
inputRef.current?.focus();
return;
}
setAddress(value);
setError(null);
focusNext.current = "fix";
setEditing(false);
onChangeEmail?.(value);
};
const total = Math.max(0, Math.round(cooldownSeconds));
const [left, setLeft] = React.useState(total);
const counted = React.useRef(total > 0);
React.useEffect(() => {
if (left <= 0) return;
const timer = window.setTimeout(() => setLeft((s) => Math.max(0, s - 1)), 1000);
return () => window.clearTimeout(timer);
}, [left]);
const cooling = left > 0;
const resend = () => {
if (cooling) return;
onResend?.(address);
counted.current = true;
setLeft(total);
};
const live = !cooling && counted.current ? copy.resendReady : "";
const provider = detectProvider(address);
const others = PROVIDER_ORDER.filter((p) => p !== provider);
const name = senderName?.trim() ?? "";
const sender = name || copy.senderFallback;
const searchTerm = name || subject?.trim() || "";
const showMail = Boolean(name || subject?.trim());
const monogram = initials(name);
const ctaClass = ["cf-ceh__cta", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
return (
<section className={["cf-ceh", className].filter(Boolean).join(" ")} style={FX_HOST} aria-labelledby={ids.head}>
<BackdropVideo video={loop} treatment="fade-to-band" side="left" />
<div className="cf-ceh__inner">
<div className="cf-ceh__progress cf-ceh__rise" style={rise(0)}>
<p className="cf-ceh__progress-text" id={ids.prog}>
<span className="cf-ceh__badge is-ok" aria-hidden="true">
<Check strokeWidth={3} />
</span>
<strong>{copy.progressDone}</strong>
{copy.progressNext ? <>: {copy.progressNext}</> : null}
</p>
<div
className="cf-ceh__track"
role="progressbar"
aria-labelledby={ids.prog}
aria-valuemin={0}
aria-valuemax={2}
aria-valuenow={1}
>
<span className="cf-ceh__seg is-done">
<span className="cf-ceh__fill" />
</span>
<span className="cf-ceh__seg is-next">
<span className="cf-ceh__fill" />
</span>
</div>
</div>
<div className="cf-ceh__hero">
<h1 id={ids.head} className="cf-ceh__h1 cf-ceh__rise" style={rise(1)}>
{withMark(headline, headlineEmphasis)}
</h1>
{lead ? (
<p className="cf-ceh__lead cf-ceh__rise" style={rise(2)}>
{lead}
</p>
) : null}
<div className="cf-ceh__rise" style={rise(3)}>
{editing ? (
<form
className="cf-ceh__edit"
onSubmit={submitEmail}
onKeyDown={(e) => {
if (e.key === "Escape") closeEditor();
}}
noValidate
>
<label className="cf-ceh__label" htmlFor={ids.field}>
{copy.fieldLabel}
</label>
<div className="cf-ceh__edit-row">
<input
ref={inputRef}
id={ids.field}
className="cf-ceh__input"
type="email"
name="email"
autoComplete="email"
inputMode="email"
spellCheck={false}
placeholder={copy.fieldPlaceholder}
value={draft}
onChange={(e) => {
setDraft(e.target.value);
if (error) setError(null);
}}
aria-invalid={error ? true : undefined}
aria-describedby={error ? ids.err : undefined}
/>
<button type="submit" className="cf-ceh__btn2">
{copy.save}
</button>
<button type="button" className="cf-ceh__link" onClick={closeEditor}>
{copy.cancel}
</button>
</div>
{error ? (
<p id={ids.err} className="cf-ceh__err" role="alert">
<span className="cf-ceh__badge is-bad" aria-hidden="true">
<X strokeWidth={3} />
</span>
{error}
</p>
) : null}
</form>
) : (
<p className="cf-ceh__sent">
<Mail className="cf-ceh__inl" strokeWidth={2.5} aria-hidden="true" />
{address ? (
<>
{copy.sentTo} <strong className="cf-ceh__addr">{breakAt(address)}</strong>
</>
) : (
copy.sentToMissing
)}{" "}
<button ref={fixRef} type="button" className="cf-ceh__link cf-ceh__fix" onClick={openEditor}>
{copy.fixLink}
</button>
</p>
)}
</div>
<div className="cf-ceh__act cf-ceh__rise" style={rise(4)}>
{provider ? (
<a
className={ctaClass}
href={providerHref(provider, senderEmail)}
target="_blank"
rel="noopener noreferrer"
onClick={() => onOpenInbox?.(provider, address)}
>
{fill(copy.openLabel, { provider: names[provider] })}
</a>
) : (
<button type="button" className={ctaClass} onClick={() => onOpenInbox?.(null, address)}>
{copy.genericLabel}
</button>
)}
<div className="cf-ceh__act-side">
<p className="cf-ceh__note">
{provider
? fill(copy.openNote, { provider: names[provider], sender })
: fill(copy.genericNote, { sender })}
</p>
<p className="cf-ceh__others">
{copy.otherApps}{" "}
{others.map((p, i) => (
<React.Fragment key={p}>
{i > 0 ? (
<span className="cf-ceh__sep" aria-hidden="true">
·
</span>
) : null}
<a
className="cf-ceh__link"
href={providerHref(p, senderEmail)}
target="_blank"
rel="noopener noreferrer"
onClick={() => onOpenInbox?.(p, address)}
>
{names[p]}
</a>
</React.Fragment>
))}
</p>
</div>
</div>
</div>
<div className={`cf-ceh__row cf-ceh__rise${showMail ? "" : " is-solo"}`} style={rise(5)}>
{showMail ? (
<figure className="cf-ceh__mail">
<figcaption className="cf-ceh__cap">
<Inbox className="cf-ceh__inl" strokeWidth={2.5} aria-hidden="true" />
{copy.lookFor}
</figcaption>
<div className="cf-ceh__msg">
<span className="cf-ceh__avatar" aria-hidden="true">
{monogram || <Mail strokeWidth={2.5} />}
</span>
<div className="cf-ceh__msg-body">
{name || senderEmail ? (
<p className="cf-ceh__from">
<span className="cf-ceh__dot" aria-hidden="true" />
{name ? <strong>{name}</strong> : null}
{senderEmail ? <span className="cf-ceh__from-addr">{breakAt(senderEmail)}</span> : null}
</p>
) : null}
{subject ? <p className="cf-ceh__subj">{subject}</p> : null}
{preview ? <p className="cf-ceh__prev">{preview}</p> : null}
</div>
</div>
{searchTerm ? (
<p className="cf-ceh__hint">
<Search className="cf-ceh__inl" strokeWidth={2.5} aria-hidden="true" />
{fill(copy.searchHint, { sender: searchTerm })}
</p>
) : null}
</figure>
) : null}
<div className="cf-ceh__resend">
<h2 className="cf-ceh__h3">{copy.resendTitle}</h2>
<p className="cf-ceh__rbody">{copy.resendBody}</p>
<button
type="button"
className="cf-ceh__btn2 cf-ceh__resend-btn"
aria-disabled={cooling || undefined}
onClick={resend}
>
<span className="cf-ceh__time">
{cooling ? fill(copy.resendWait, { time: formatTime(left) }) : copy.resendLabel}
</span>
{total > 0 ? (
<span className="cf-ceh__drain" aria-hidden="true" style={{ transform: `scaleX(${left / total})` }} />
) : null}
</button>
<p className="cf-ceh__fixline">
<button type="button" className="cf-ceh__link" onClick={openEditor}>
{copy.resendFix}
</button>
</p>
<p className="cf-ceh__sr" aria-live="polite">
{live}
</p>
</div>
</div>
</div>
<div className="cf-ceh__edge" aria-hidden="true">
<Divider shape="wave" tone="surface" height={56} />
</div>
<style>{CSS}</style>
</section>
);
}
export default ConfirmEmailHero;
function detectProvider(address: string): MailProvider | null {
const at = address.lastIndexOf("@");
if (at < 0) return null;
const domain = address.slice(at + 1).trim().toLowerCase();
if (!domain) return null;
for (const p of PROVIDER_ORDER) {
if (PROVIDER_DOMAINS[p].some((d) => domain === d || domain.startsWith(d + "."))) return p;
}
return null;
}
function providerHref(provider: MailProvider, senderEmail?: string): string {
const hrefs: Record<MailProvider, string> = {
gmail: senderEmail
? `https://mail.google.com/mail/u/0/#search/${encodeURIComponent(`from:${senderEmail} in:anywhere`)}`
: "https://mail.google.com/mail/u/0/#inbox",
outlook: "https://outlook.live.com/mail/0/",
yahoo: "https://mail.yahoo.com/",
icloud: "https://www.icloud.com/mail/",
};
return hrefs[provider];
}
function fill(template: string, vars: Record<string, string>): string {
return template.replace(/{([a-z]+)}/gi, (match: string, key: string) => vars[key] ?? match);
}
function formatTime(seconds: number): string {
return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
}
function initials(name: string): string {
const words = name.split(/ +/).filter(Boolean);
return ((words[0]?.[0] ?? "") + (words[1]?.[0] ?? "")).toUpperCase();
}
/** The error state shows the supplied address with its ending clipped, as a realistic typo. */
function brokenDraft(address: string): string {
return address.replace(/[.][a-z]+$/i, "");
}
/** Lets a long address wrap before the @ instead of splitting its domain. */
function breakAt(address: string): React.ReactNode {
const at = address.indexOf("@");
if (at <= 0) return address;
return (
<>
{address.slice(0, at)}
<wbr />
{address.slice(at)}
</>
);
}
function rise(i: number): React.CSSProperties {
return { "--i": i } as React.CSSProperties;
}
function withMark(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="cf-ceh__mark">{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
const CSS = `
.cf-ceh{position:relative;overflow:hidden;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) calc(clamp(64px,8.5vw,120px) + 56px)}
.cf-ceh *,.cf-ceh *::before,.cf-ceh *::after{box-sizing:border-box}
:where(.cf-ceh) :where(p){margin:0}
.cf-ceh__inner{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-ceh__progress{margin:0 0 clamp(40px,6vw,72px)}
.cf-ceh__progress-text{font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty;margin-bottom:12px}
.cf-ceh__progress-text strong{font-weight:800}
.cf-ceh__badge{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:999px;vertical-align:-0.3em;margin-inline-end:.5em;color:var(--status-glyph,#fff)}
.cf-ceh__badge svg{width:13px;height:13px}
.cf-ceh__badge.is-ok{background:var(--success)}
.cf-ceh__badge.is-bad{background:var(--danger)}
.cf-ceh__track{display:grid;grid-template-columns:1fr 1fr;gap:6px;height:4px}
.cf-ceh__seg{position:relative;overflow:hidden;border-radius:999px;background:oklch(from var(--band-ink) l c h / .2)}
.cf-ceh__fill{position:absolute;inset:0;border-radius:inherit;background:var(--band-ink);transform-origin:left center}
.cf-ceh__seg.is-next .cf-ceh__fill{transform:scaleX(.08)}
.cf-ceh__hero{max-width:54rem}
.cf-ceh__h1{margin:0 0 max(clamp(16px,1.6vw,24px),.5em);font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);letter-spacing:var(--display-tracking,-0.025em);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;text-wrap:balance;color:var(--band-ink)}
.cf-ceh__mark{--cf-ceh-marker:oklch(from var(--marker,#fae37c) max(l, 0.88) min(c, 0.16) h / 1);color:var(--marker-ink,oklch(from var(--band) min(l, 0.2) c h));background:linear-gradient(to bottom,transparent 14%,var(--cf-ceh-marker) 14%,var(--cf-ceh-marker) 94%,transparent 94%);padding:0 .14em;margin:0 -.04em;border-radius:.12em .3em .18em .34em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-ceh__lead{font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;max-width:60ch;text-wrap:pretty;margin-bottom:clamp(24px,3vw,32px)}
.cf-ceh__sent{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;text-wrap:pretty;margin-bottom:24px}
.cf-ceh__addr{font-weight:800;overflow-wrap:break-word}
.cf-ceh__inl{display:inline-block;width:1.05em;height:1.05em;vertical-align:-0.17em;margin-inline-end:.45em}
.cf-ceh__link{appearance:none;background:none;border:0;padding:10px 2px;margin:-10px -2px;font:inherit;font-weight:700;color:var(--band-ink);text-decoration:underline;text-decoration-color:oklch(from var(--band-ink) l c h / .5);text-decoration-thickness:1.5px;text-underline-offset:.2em;cursor:pointer;white-space:nowrap;border-radius:6px}
.cf-ceh__link:hover{text-decoration-color:var(--band-ink)}
.cf-ceh__link:focus-visible{outline:2px solid var(--band-ink);outline-offset:2px}
.cf-ceh__fix{margin-inline-start:.2em}
.cf-ceh__edit{margin-bottom:24px;max-width:40rem}
.cf-ceh__label{display:block;font-size:1rem;line-height:1.3;font-weight:700;margin-bottom:8px;color:var(--band-ink)}
.cf-ceh__edit-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px}
.cf-ceh__input{flex:1 1 260px;min-width:0;height:56px;padding:0 16px;font:inherit;font-size:1.0625rem;font-weight:600;color:var(--field-ink);background:var(--field);border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));box-shadow:inset 0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .12);transition:box-shadow .16s ease,border-color .16s ease}
.cf-ceh__input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-ceh__input:focus{outline:2px solid var(--band-ink);outline-offset:3px;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
.cf-ceh__input[aria-invalid="true"]{border-color:var(--danger);box-shadow:inset 0 0 0 1px var(--danger)}
.cf-ceh__err{margin-top:12px;font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty;color:var(--band-ink)}
.cf-ceh__act{display:flex;flex-wrap:wrap;align-items:center;gap:16px 28px}
.cf-ceh__cta{--_bg:var(--button-bg,var(--cta));--_bg2:var(--button-bg-2,var(--cta-2));--_sh:var(--shadow,oklch(0.22 0.03 260));position:relative;flex:0 0 auto;min-width:min(100%,340px);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:72px;padding:12px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-decoration:none;text-wrap:balance;color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);background:linear-gradient(oklch(from var(--_bg) calc(l + 0.04) c h),oklch(from var(--_bg2) calc(l - 0.02) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--_bg) calc(l + 0.14) c h / .7),inset 0 -3px 0 oklch(from var(--_bg) calc(l - 0.16) c h),0 1px 2px oklch(from var(--_sh) l c h / .45),0 8px 16px -6px oklch(from var(--_sh) l c h / .6));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;-webkit-tap-highlight-color:transparent}
.cf-ceh__cta:hover,.cf-ceh__cta.is-hover{background:linear-gradient(oklch(from var(--_bg) calc(l - 0.01) c h),oklch(from var(--_bg2) calc(l - 0.07) c h));box-shadow:inset 0 1px 0 oklch(from var(--_bg) calc(l + 0.1) c h / .7),inset 0 -3px 0 oklch(from var(--_bg) calc(l - 0.2) c h),0 1px 2px oklch(from var(--_sh) l c h / .5),0 12px 20px -6px oklch(from var(--_sh) l c h / .7)}
.cf-ceh__cta:active,.cf-ceh__cta.is-active{transform:translateY(1px);background:linear-gradient(oklch(from var(--_bg) calc(l - 0.06) c h),oklch(from var(--_bg2) calc(l - 0.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--_sh) l c h / .35),inset 0 -2px 0 oklch(from var(--_bg) calc(l - 0.18) c h),0 1px 2px oklch(from var(--_sh) l c h / .4)}
.cf-ceh__cta:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-ceh__act-side{flex:1 1 260px;min-width:0;display:grid;gap:8px}
.cf-ceh__note{font-size:.9375rem;line-height:1.4;font-weight:600;text-wrap:pretty}
.cf-ceh__others{font-size:.9375rem;line-height:1.6;font-weight:500;text-wrap:pretty}
.cf-ceh__others .cf-ceh__link{padding:6px 2px;margin:-6px -2px}
.cf-ceh__sep{margin:0 .5em}
.cf-ceh__row{margin-top:clamp(48px,6vw,72px);display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:clamp(24px,4vw,56px);align-items:start}
.cf-ceh__row.is-solo{grid-template-columns:minmax(0,34rem)}
.cf-ceh__mail{margin:0;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / .22),0 4px 10px -2px oklch(0.22 0.03 260 / .2)));padding:clamp(20px,3vw,32px)}
.cf-ceh__cap{display:block;font-size:.9375rem;line-height:1.4;font-weight:700;color:var(--muted);margin-bottom:12px}
.cf-ceh__msg{display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px 14px;align-items:start;padding:16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
.cf-ceh__avatar{width:40px;height:40px;border-radius:999px;display:grid;place-items:center;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-family:var(--font-display);font-weight:800;font-size:.9375rem;letter-spacing:.02em}
.cf-ceh__avatar svg{width:20px;height:20px}
.cf-ceh__msg-body{min-width:0}
.cf-ceh__from{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 8px;font-size:1.0625rem;line-height:1.35}
.cf-ceh__from strong{font-weight:800}
.cf-ceh__dot{align-self:center;width:8px;height:8px;border-radius:999px;background:var(--accent-fill,var(--accent))}
.cf-ceh__from-addr{font-size:.9375rem;color:color-mix(in oklch,var(--ink) 72%,var(--card));overflow-wrap:break-word;min-width:0}
.cf-ceh__subj{margin-top:4px;font-size:1.0625rem;line-height:1.35;font-weight:700;text-wrap:pretty}
.cf-ceh__prev{margin-top:4px;font-size:.9375rem;line-height:1.45;color:color-mix(in oklch,var(--ink) 72%,var(--card));text-wrap:pretty}
.cf-ceh__hint{margin-top:16px;padding-top:16px;border-top:1px solid oklch(from var(--ink) l c h / .12);font-size:.9375rem;line-height:1.45;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-ceh__resend{position:relative;padding:clamp(20px,3vw,32px);border-radius:var(--card-radius,var(--radius,14px));background:oklch(from var(--band) l c h / .86);border:1px solid oklch(from var(--band-ink) l c h / .14);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}
.cf-ceh__h3{margin:0 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;text-wrap:balance;color:var(--band-ink)}
.cf-ceh__rbody{font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;margin-bottom:16px;text-wrap:pretty}
.cf-ceh__btn2{position:relative;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;min-height:56px;padding:0 24px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(var(--button-2-bg,var(--secondary)),var(--button-2-bg,var(--secondary))),var(--secondary);color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:1.0625rem;line-height:1.15;white-space:nowrap;cursor:pointer;transition:background .16s ease,transform .16s ease}
.cf-ceh__btn2:hover{background:linear-gradient(oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h),oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.04) c h)),oklch(from var(--secondary) calc(l - 0.04) c h)}
.cf-ceh__btn2:active{transform:translateY(1px)}
.cf-ceh__btn2:focus-visible{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-ceh__btn2[aria-disabled="true"]{cursor:not-allowed;transform:none;background:linear-gradient(var(--button-2-bg,var(--secondary)),var(--button-2-bg,var(--secondary))),var(--secondary);color:var(--button-2-ink,var(--secondary-ink))}
.cf-ceh__btn2[aria-disabled="true"] .cf-ceh__time{opacity:1}
.cf-ceh__resend .cf-ceh__btn2{width:100%}
.cf-ceh__time{font-variant-numeric:tabular-nums}
.cf-ceh__drain{position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--accent-fill,var(--accent));transform-origin:left center;transition:transform 1s linear}
.cf-ceh__fixline{margin-top:20px;font-size:.9375rem;line-height:1.4}
.cf-ceh__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.cf-ceh__edge{position:absolute;left:0;right:0;bottom:0;height:56px;z-index:1;pointer-events:none}
@keyframes cf-ceh-rise{from{opacity:.82;transform:translateY(8px)}}
@keyframes cf-ceh-fill{from{transform:scaleX(.25)}}
.cf-ceh__rise{animation:cf-ceh-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(min(var(--i,0) * .07s, .28s))}
.cf-ceh__seg.is-done .cf-ceh__fill{animation:cf-ceh-fill .6s .1s cubic-bezier(.2,.7,.2,1) both}
@media (max-width:820px){.cf-ceh__row{grid-template-columns:minmax(0,1fr)}}
@media (max-width:640px){.cf-ceh__act{flex-direction:column;align-items:stretch}.cf-ceh__cta{width:100%;min-width:0}.cf-ceh__act-side{flex:none}.cf-ceh__fix{display:block;width:fit-content;margin:-4px -2px -10px -2px;text-align:left}}
@media (max-width:520px){.cf-ceh__edit-row{flex-direction:column;align-items:stretch}.cf-ceh__input{flex:none;width:100%}.cf-ceh__edit-row .cf-ceh__btn2{width:100%}.cf-ceh__edit-row .cf-ceh__link{align-self:center}.cf-ceh__msg{grid-template-columns:32px minmax(0,1fr);gap:8px 10px;padding:14px}.cf-ceh__avatar{width:32px;height:32px;font-size:.8125rem}.cf-ceh__avatar svg{width:16px;height:16px}}
@media (prefers-reduced-motion:reduce){.cf-ceh__rise,.cf-ceh__fill,.cf-ceh__seg.is-done .cf-ceh__fill{animation:none}.cf-ceh__drain,.cf-ceh__cta,.cf-ceh__btn2,.cf-ceh__input{transition:none}}
`;
pieces/hero/confirm-email-hero/specimen.tsx 21 lines
import { ConfirmEmailHero } from "../confirm-email-hero";
import type { ConfirmEmailHeroProps } from "../confirm-email-hero";
export const states = ["default", "hover", "active", "error"];
export default function ConfirmEmailHeroSpecimen({ state = "default" }: { state?: ConfirmEmailHeroProps["state"] }) {
return (
<ConfirmEmailHero
state={state}
email="dana.reyes@gmail.com"
senderName="Field Notes Weekly"
senderEmail="hello@fieldnotesweekly.com"
subject="Confirm your Field Notes Weekly subscription"
preview="Tap the button inside and Saturday’s issue is yours: practical notes for running a small farm."
headline="Almost there. Open your inbox and click confirm."
headlineEmphasis="click confirm"
lead="One click in that email and your first issue of Field Notes Weekly lands Saturday at 6 a.m. Ten minutes of field-tested notes for small-farm owners, free every week."
cooldownSeconds={60}
/>
);
}
| Name | Type | Details |
|---|---|---|
email OptionalConfirmEmailHero |
string |
|
senderName OptionalConfirmEmailHero |
string |
|
senderEmail OptionalConfirmEmailHero |
string |
|
subject OptionalConfirmEmailHero |
string |
|
preview OptionalConfirmEmailHero |
string |
|
headline OptionalConfirmEmailHero |
string |
|
headlineEmphasis OptionalConfirmEmailHero |
string |
|
lead OptionalConfirmEmailHero |
string |
|
cooldownSeconds OptionalConfirmEmailHero |
number |
|
copy OptionalConfirmEmailHero |
Partial<ConfirmEmailHeroCopy> |
|
providerNames OptionalConfirmEmailHero |
Partial<Record<MailProvider, string>> |
|
loop OptionalConfirmEmailHero |
typeof bokeh |
|
onChangeEmail OptionalConfirmEmailHero |
(email: string) => void |
|
onResend OptionalConfirmEmailHero |
(email: string) => void |
|
onOpenInbox OptionalConfirmEmailHero |
(provider: MailProvider | null, email: string) => void |
|
state OptionalConfirmEmailHero |
"default" | "hover" | "active" | "error" |
|
className OptionalConfirmEmailHero |
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.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
- 81918c3a044a8083.mp4 video/mp4 · 162 KB
- ae01ab734361dabf.webm video/webm · 95.6 KB
-
c7f2dc1d98942dc6.webp
image/webp · 8.7 KB