Newsletter Signup 6
Donor newsletter signup set as a field scoreboard. Supplied impact figures and recent issue titles show the work already happening. The email form is the final, largest tile, so the reader joins the people already watching.
Use it in a prompt
Use forms/newsletter-signup-6 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/newsletter-signup-6.tsx. - Import it and pass your copy and images (Props tab):
import { NewsletterSignup6 } from "@/components/funneldna/forms/newsletter-signup-6"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/newsletter-signup-6/component.tsx 629 lines
// layout: fact-scoreboard
// Donor newsletter signup set as a field scoreboard. Supplied impact figures and recent issue titles show the work already happening. The email form is the final, largest tile, so the reader joins the people already watching.
import * as React from 'react';
import { AlertCircle, Check, Droplets, Heart, Loader2, Lock, Mail, Mountain, Sprout, Users } from 'lucide-react';
import { FX_HOST, Texture } from '../fx/fx';
import topo from '../fx/textures/topo';
export type NewsletterFigure = {
/** Supplied figure exactly as it should read, e.g. '12,480'. Counts up once from zero when motion is allowed. */
value: string;
/** What the number counts, e.g. 'trees planted this season'. */
label: string;
detail?: string;
icon?: 'tree' | 'people' | 'land' | 'water' | 'heart' | 'none';
};
export type NewsletterIssue = {
title: string;
/** Issue number label, e.g. 'No. 24'. */
number?: string;
date?: string;
/** Link to the issue. Without it the row is a button that calls onIssueAction. */
href?: string;
};
export type NewsletterSignup6Props = {
headline?: string;
/** Phrase inside the headline set in the accent colour. */
emphasis?: string;
lead?: string;
/** Italic aside in the writer's voice. */
aside?: string;
/** Writer's name line under the aside. */
signoff?: string;
/** Supplied impact figures only (up to four). When empty, the board collapses to the promise, issues and form. */
figures?: NewsletterFigure[];
/** Slot: scene. A photo from the field. When empty, the photo tile is hidden. */
sceneImage?: string;
sceneAlt?: string;
/** Plain caption under the photo. */
sceneCaption?: string;
issuesHeading?: string;
issues?: NewsletterIssue[];
onIssueAction?: (issue: NewsletterIssue, index: number) => void;
formHeadline?: string;
formLead?: string;
/** Supplied reader count only. When empty, the bandwagon line is hidden. */
subscriberCount?: string;
/** Bandwagon line. {count} is replaced by subscriberCount. */
proofTemplate?: string;
emailLabel?: string;
emailPlaceholder?: string;
/** Commitment line the reader ticks before joining. When empty, it is removed. */
commitLabel?: string;
commitDefault?: boolean;
buttonLabel?: string;
/** Button label while the promise returned by onSubmit is pending. */
busyLabel?: string;
privacy?: string;
requiredError?: string;
invalidError?: string;
commitError?: string;
defaultEmail?: string;
disabled?: boolean;
/** Called with the validated email. Return a promise to show the busy state. Never sends data itself. */
onSubmit?: (values: { email: string }) => void | Promise<unknown>;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
type Phase = 'idle' | 'wait' | 'in';
export function NewsletterSignup6({
headline = 'Watch the work happen, straight from the field',
emphasis = 'straight from the field',
lead = 'Get a short field report from our crews: what went in the ground, who showed up and which land is now protected.',
aside = '(Muddy boots and all.)',
signoff = '',
figures = [],
sceneImage = '',
sceneAlt = '',
sceneCaption = '',
issuesHeading = 'Catch up on the last three reports',
issues = DEFAULT_ISSUES,
onIssueAction,
formHeadline = 'Get the next field report',
formLead = 'Free, short and straight from our crews.',
subscriberCount = '',
proofTemplate = 'Join {count} people already watching the work happen.',
emailLabel = 'Your email address',
emailPlaceholder = 'you@example.com',
commitLabel = 'Yes, send me the field report by email',
commitDefault = false,
buttonLabel = 'Send Me The Field Report',
busyLabel = 'Adding you to the list…',
privacy = 'We respect your inbox. Unsubscribe anytime.',
requiredError = 'Enter your email address so we know where to send the report.',
invalidError = 'That email looks incomplete. Check it and try again.',
commitError = 'Tick the box so we know you want the report.',
defaultEmail = '',
disabled = false,
onSubmit,
state = 'default',
className,
}: NewsletterSignup6Props) {
const uid = React.useId();
const headingId = uid + '-heading';
const formHeadingId = uid + '-form-heading';
const emailId = uid + '-email';
const errorId = uid + '-error';
const commitErrorId = uid + '-commit-error';
const noteId = uid + '-note';
const inputRef = React.useRef<HTMLInputElement>(null);
const commitRef = React.useRef<HTMLInputElement>(null);
const rootRef = React.useRef<HTMLElement>(null);
const mounted = React.useRef(true);
const initialError = state === 'error' ? (defaultEmail ? invalidError : requiredError) : null;
const [email, setEmail] = React.useState(defaultEmail);
const [error, setError] = React.useState<string | null>(initialError);
const [committed, setCommitted] = React.useState(commitDefault);
const [commitInvalid, setCommitInvalid] = React.useState(false);
const [pending, setPending] = React.useState(false);
const [phase, setPhase] = React.useState<Phase>('idle');
const isDisabled = disabled || state === 'disabled';
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
React.useEffect(() => {
setError(state === 'error' ? (defaultEmail ? invalidError : requiredError) : null);
}, [state, defaultEmail, invalidError, requiredError]);
// Reveal and count-up run once when the band enters view. Real values render first; nothing moves under reduced motion.
useIsoLayoutEffect(() => {
const node = rootRef.current;
if (!node || typeof window === 'undefined' || typeof IntersectionObserver === 'undefined') return;
if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const rect = node.getBoundingClientRect();
if (rect.top < window.innerHeight * 0.85 && rect.bottom > 0) {
setPhase('in');
return;
}
setPhase('wait');
const observer = new IntersectionObserver(
(entries) => {
if (entries.some((entry) => entry.isIntersecting)) {
setPhase('in');
observer.disconnect();
}
},
{ threshold: 0.15 },
);
observer.observe(node);
return () => observer.disconnect();
}, []);
const validate = (value: string) => {
const trimmed = value.trim();
if (!trimmed) return requiredError;
if (!EMAIL_PATTERN.test(trimmed)) return invalidError;
return null;
};
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const next = event.target.value;
setEmail(next);
if (error && !validate(next)) setError(null);
};
const handleBlur = () => {
const trimmed = email.trim();
if (trimmed && !EMAIL_PATTERN.test(trimmed)) setError(invalidError);
};
const handleCommit = (event: React.ChangeEvent<HTMLInputElement>) => {
setCommitted(event.target.checked);
if (event.target.checked) setCommitInvalid(false);
};
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (isDisabled || pending) return;
const message = validate(email);
const commitMissing = Boolean(commitLabel) && !committed;
setError(message);
setCommitInvalid(commitMissing);
if (message) {
inputRef.current?.focus();
return;
}
if (commitMissing) {
commitRef.current?.focus();
return;
}
const result = onSubmit?.({ email: email.trim() });
if (result && typeof (result as Promise<unknown>).then === 'function') {
setPending(true);
const done = () => {
if (mounted.current) setPending(false);
};
(result as Promise<unknown>).then(done, done);
}
};
const figs = figures.filter((figure) => figure && figure.value && figure.label).slice(0, 4);
const hasPhoto = Boolean(sceneImage);
const hasIssues = issues.length > 0;
const plan = planSpans(figs.length, hasPhoto, hasIssues);
const proof = subscriberCount ? proofTemplate.split('{count}').join(subscriberCount) : '';
const describedBy = [error ? errorId : '', privacy ? noteId : ''].filter(Boolean).join(' ');
let tileIndex = 0;
const tileStyle = (span: number, sm: number) =>
({ '--span': span, '--sm': sm, '--i': Math.min(tileIndex++, 4) }) as React.CSSProperties;
return (
<section
ref={rootRef}
className={join('cf-newsletter-signup-6', className)}
data-reveal={phase}
aria-labelledby={headingId}
style={FX_HOST}
>
<style>{CSS}</style>
<Texture src={topo} tone='band-ink' />
<div className='nl6-wrap'>
<div className='nl6-grid'>
<div className='nl6-tile nl6-card nl6-promise' style={tileStyle(plan.promise, 2)}>
<h2 id={headingId} className='nl6-h2'>
{renderEmphasis(headline, emphasis)}
</h2>
{lead ? <p className='nl6-lead'>{lead}</p> : null}
{aside ? <p className='nl6-aside'>{aside}</p> : null}
{signoff ? <p className='nl6-signoff'>{signoff}</p> : null}
</div>
{figs.map((figure, index) => {
const Icon = figure.icon && figure.icon !== 'none' ? FIGURE_ICONS[figure.icon] : null;
const sm = figs.length % 2 === 1 && index === 0 ? 2 : 1;
return (
<div
key={figure.label + index}
className={join('nl6-tile nl6-fig', index === 0 ? 'nl6-fig--lead' : 'nl6-tint')}
style={tileStyle(plan.fig[index], sm)}
>
{Icon ? (
<span className='nl6-disc' aria-hidden='true'>
<Icon size={20} strokeWidth={2.5} />
</span>
) : (
<span />
)}
<div className='nl6-fig-copy'>
<CountUp value={figure.value} phase={phase} />
<p className='nl6-fig-label'>{figure.label}</p>
{figure.detail ? <p className='nl6-fig-detail'>{figure.detail}</p> : null}
</div>
</div>
);
})}
{hasPhoto ? (
<figure className='nl6-tile nl6-photo' style={tileStyle(plan.photo, 2)}>
<div className='nl6-photo-frame'>
<img src={sceneImage} alt={sceneAlt} width={1200} height={800} loading='lazy' decoding='async' />
</div>
{sceneCaption ? <figcaption>{sceneCaption}</figcaption> : null}
</figure>
) : null}
{hasIssues ? (
<div className='nl6-tile nl6-tint nl6-issues' style={tileStyle(plan.issues, 2)}>
<h3 className='nl6-h3'>{issuesHeading}</h3>
<ol className='nl6-issue-list'>
{issues.map((issue, index) => {
const meta = [issue.number, issue.date].filter(Boolean).join(' · ');
const inner = (
<>
{meta ? <span className='nl6-issue-meta'>{meta}</span> : null}
<span className='nl6-issue-title'>{issue.title}</span>
</>
);
return (
<li key={issue.title + index}>
{issue.href ? (
<a className='nl6-issue' href={issue.href}>
{inner}
</a>
) : (
<button type='button' className='nl6-issue' onClick={() => onIssueAction?.(issue, index)}>
{inner}
</button>
)}
</li>
);
})}
</ol>
</div>
) : null}
<div className='nl6-tile nl6-card nl6-form-tile' style={tileStyle(plan.form, 2)}>
<h3 id={formHeadingId} className='nl6-h3'>
{formHeadline}
</h3>
{proof ? (
<p className='nl6-proof'>
<Users size={18} strokeWidth={2.5} aria-hidden='true' />
{proof}
</p>
) : null}
{formLead ? <p className='nl6-form-lead'>{formLead}</p> : null}
<form className='nl6-form' noValidate onSubmit={handleSubmit} aria-labelledby={formHeadingId}>
<label className='nl6-label' htmlFor={emailId}>
{emailLabel}
</label>
<div className='nl6-field'>
<Mail className='nl6-field-icon' size={20} strokeWidth={2.5} aria-hidden='true' />
<input
ref={inputRef}
id={emailId}
className='nl6-input'
type='email'
name='email'
inputMode='email'
autoComplete='email'
placeholder={emailPlaceholder}
value={email}
onChange={handleChange}
onBlur={handleBlur}
disabled={isDisabled}
aria-invalid={error ? true : undefined}
aria-describedby={describedBy || undefined}
required
/>
</div>
<div aria-live='polite'>
{error ? (
<p id={errorId} className='nl6-error'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
</div>
{commitLabel ? (
<>
<label className={join('nl6-commit', commitInvalid && 'is-invalid', isDisabled && 'is-disabled')}>
<input
ref={commitRef}
className='nl6-commit-input'
type='checkbox'
name='commit'
checked={committed}
onChange={handleCommit}
disabled={isDisabled}
aria-invalid={commitInvalid ? true : undefined}
aria-describedby={commitInvalid ? commitErrorId : undefined}
/>
<span className='nl6-commit-box' aria-hidden='true'>
<Check size={16} strokeWidth={3} />
</span>
<span className='nl6-commit-text'>{commitLabel}</span>
</label>
<div aria-live='polite'>
{commitInvalid ? (
<p id={commitErrorId} className='nl6-error nl6-error--commit'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{commitError}
</p>
) : null}
</div>
</>
) : null}
<button
type='submit'
className={join('nl6-btn', state === 'hover' && 'is-hover', state === 'active' && 'is-active')}
disabled={isDisabled}
aria-busy={pending ? true : undefined}
>
{pending ? (
<>
<Loader2 className='nl6-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{busyLabel}</span>
</>
) : (
<span>{buttonLabel}</span>
)}
</button>
{privacy ? (
<p id={noteId} className='nl6-privacy'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{privacy}
</p>
) : null}
</form>
</div>
</div>
</div>
</section>
);
}
export default NewsletterSignup6;
const DEFAULT_ISSUES: NewsletterIssue[] = [
{ title: 'Where your gifts went this month' },
{ title: 'Meet the volunteers behind the spring push' },
{ title: 'The ground we’re working to protect next' },
];
const FIGURE_ICONS = { tree: Sprout, people: Users, land: Mountain, water: Droplets, heart: Heart } as const;
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
const useIsoLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
function join(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ');
}
function renderEmphasis(text: string, phrase: string) {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className='nl6-em'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
// Desktop column spans that keep every scoreboard row full: promise + lead figure, remaining figures + photo, issues + form.
function planSpans(figCount: number, hasPhoto: boolean, hasIssues: boolean) {
const fig: number[] = [];
let promise = 12;
let photo = 0;
let photoInFirstRow = false;
if (figCount >= 1) {
promise = 7;
fig[0] = 5;
} else if (hasPhoto) {
promise = 7;
photo = 5;
photoInFirstRow = true;
}
const secondRow = Math.max(0, figCount - 1) + (hasPhoto && !photoInFirstRow ? 1 : 0);
const each = secondRow ? 12 / secondRow : 12;
for (let index = 1; index < figCount; index += 1) fig[index] = each;
if (hasPhoto && !photoInFirstRow) photo = each;
return { promise, fig, photo, issues: hasIssues ? 5 : 0, form: hasIssues ? 7 : 12 };
}
type ParsedFigure = { prefix: string; suffix: string; target: number; decimals: number; grouped: boolean };
function parseFigure(value: string): ParsedFigure | null {
const match = /^(\D*?)(\d[\d,]*(?:\.\d+)?)(.*)$/.exec(value.trim());
if (!match) return null;
const raw = match[2];
const target = Number(raw.replace(/,/g, ''));
if (!Number.isFinite(target)) return null;
const decimals = raw.includes('.') ? raw.split('.')[1].length : 0;
return { prefix: match[1], suffix: match[3], target, decimals, grouped: raw.includes(',') };
}
function formatFigure(parsed: ParsedFigure, amount: number) {
let text = amount.toFixed(parsed.decimals);
if (parsed.grouped) {
const [whole, fraction] = text.split('.');
text = whole.replace(/\B(?=(\d{3})+(?!\d))/g, ',') + (fraction ? '.' + fraction : '');
}
return parsed.prefix + text + parsed.suffix;
}
// The final supplied value is always in the accessible DOM and reserves the width. Only the visual copy counts.
function CountUp({ value, phase }: { value: string; phase: Phase }) {
const parsed = React.useMemo(() => parseFigure(value), [value]);
const [shown, setShown] = React.useState(value);
useIsoLayoutEffect(() => {
if (!parsed || phase === 'idle') {
setShown(value);
return;
}
setShown(formatFigure(parsed, 0));
if (phase === 'wait') return;
let frame = 0;
const start = performance.now();
const duration = 1200;
const tick = (now: number) => {
const t = Math.min(1, (now - start) / duration);
if (t >= 1) {
setShown(value);
return;
}
const eased = 1 - Math.pow(1 - t, 3);
setShown(formatFigure(parsed, parsed.target * eased));
frame = requestAnimationFrame(tick);
};
frame = requestAnimationFrame(tick);
return () => cancelAnimationFrame(frame);
}, [phase, value, parsed]);
return (
<span className='nl6-num'>
<span className='nl6-num-ghost' aria-hidden='true'>
{value}
</span>
<span className='nl6-num-live' aria-hidden='true'>
{shown}
</span>
<span className='nl6-sr'>{value}</span>
</span>
);
}
const R = '.cf-newsletter-signup-6';
const BODY = 'clamp(1.0625rem, 1.25vw, 1.125rem)';
const LEAD = 'clamp(1.125rem, 1.5vw, 1.375rem)';
// Every colour below is written as a literal token recipe (no interpolated colour constants), so the theme lint reads it.
const CSS = `
${R}{position:relative;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .nl6-wrap{position:relative;z-index:1;max-width:1120px;margin:0 auto}
${R} .nl6-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
${R} .nl6-tile{grid-column:span var(--span,12);min-width:0;margin:0;border-radius:var(--card-radius,var(--radius,14px));padding:clamp(20px,3vw,32px)}
${R} .nl6-card{background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));box-shadow:var(--card-shadow,var(--shadow-md,0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22),0 4px 10px -2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .2)))}
${R} .nl6-tint{background:color-mix(in oklch,var(--band-ink) 8%,var(--band));color:var(--band-ink);border:1px solid oklch(from var(--band-ink) l c h / .14)}
${R} .nl6-promise{display:flex;flex-direction:column;justify-content:flex-start}
${R} .nl6-h2{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--ink)}
${R} .nl6-em{color:var(--accent)}
${R} .nl6-lead{margin:16px 0 0;max-width:64ch;font-size:${LEAD};font-weight:500;line-height:1.4;color:var(--muted);text-wrap:pretty}
${R} .nl6-aside{margin:12px 0 0;max-width:64ch;font-size:${BODY};font-style:italic;font-weight:500;line-height:1.5;color:var(--ink);text-wrap:pretty}
${R} .nl6-signoff{margin:24px 0 0;font-size:.9375rem;font-weight:700;line-height:1.4;color:var(--ink)}
${R} .nl6-fig{display:flex;flex-direction:column;justify-content:space-between;gap:24px;container-type:inline-size}
${R} .nl6-fig--lead{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));border:1px solid oklch(from var(--accent-fill,var(--accent)) calc(l - .08) c h);box-shadow:var(--shadow-md,0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22),0 4px 10px -2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .2)),inset 0 1px 0 oklch(from var(--accent-fill,var(--accent)) calc(l + .1) c h / .6)}
${R} .nl6-disc{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:999px;background:oklch(from var(--band-ink) l c h / .12)}
${R} .nl6-fig--lead .nl6-disc{background:oklch(from var(--accent-fill-ink,var(--card)) l c h / .16)}
${R} .nl6-fig-copy{display:flex;flex-direction:column;align-items:flex-start}
${R} .nl6-num{position:relative;display:inline-grid;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:clamp(2.5rem,4.2vw,3.75rem);font-size:min(clamp(2.5rem,4.2vw,3.75rem),26cqi)}
${R} .nl6-fig--lead .nl6-num{font-size:clamp(3rem,6.2vw,5.25rem);font-size:min(clamp(3rem,6.2vw,5.25rem),30cqi)}
${R} .nl6-num-ghost,${R} .nl6-num-live{grid-area:1/1}
${R} .nl6-num-ghost{visibility:hidden}
${R} .nl6-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
${R} .nl6-fig-label{margin:12px 0 0;font-size:${BODY};font-weight:700;line-height:1.3;text-wrap:pretty}
${R} .nl6-fig-detail{margin:4px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .nl6-photo{padding:0;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:12px}
${R} .nl6-photo-frame{position:relative;min-height:clamp(200px,17vw,248px);border-radius:12px;overflow:hidden}
${R} .nl6-photo img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 40%;border-radius:12px;display:block}
${R} .nl6-photo figcaption{padding-inline:4px;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--band-ink)}
${R} .nl6-h3{margin:0;font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:-.01em;text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;text-wrap:balance}
${R} .nl6-issues{display:flex;flex-direction:column}
${R} .nl6-issues .nl6-h3{margin-bottom:16px;color:var(--band-ink)}
${R} .nl6-issue-list{flex:1;display:grid;grid-auto-rows:1fr;margin:0 -12px;padding:0;list-style:none}
${R} .nl6-issue-list > li{display:flex;min-width:0}
${R} .nl6-issue-list > li + li{border-top:1px solid oklch(from var(--band-ink) l c h / .14)}
${R} .nl6-issue{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:4px;min-height:64px;margin:0;padding:12px;border:0;border-radius:calc(var(--button-radius,var(--radius,12px)) - 2px);background:transparent;color:var(--band-ink);font:inherit;text-align:left;text-decoration:none;cursor:pointer;transition:background .16s ease}
${R} .nl6-issue:hover{background:oklch(from var(--band-ink) l c h / .1)}
${R} .nl6-issue:active{background:oklch(from var(--band-ink) l c h / .16)}
${R} .nl6-issue:hover .nl6-issue-title{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:.18em}
${R} .nl6-issue:focus-visible{outline:3px solid oklch(from var(--band-ink) l c h / .75);outline-offset:2px}
${R} .nl6-issue-meta{font-size:.875rem;font-weight:800;line-height:1.2;letter-spacing:.04em;font-variant-numeric:tabular-nums}
${R} .nl6-issue-title{font-family:var(--font-display);font-size:${BODY};font-weight:800;line-height:1.3;text-wrap:pretty}
${R} .nl6-form-tile{display:flex;flex-direction:column;border-color:color-mix(in oklch,var(--accent) 34%,var(--card));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .22),0 12px 24px -8px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32)))}
${R} .nl6-form-tile .nl6-h3{color:var(--ink)}
${R} .nl6-proof{margin:12px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--ink);text-wrap:pretty}
${R} .nl6-proof svg{display:inline-block;vertical-align:-.22em;margin-inline-end:.4em;color:var(--accent)}
${R} .nl6-form-lead{margin:8px 0 0;font-size:${BODY};line-height:1.5;color:var(--muted);text-wrap:pretty}
${R} .nl6-form{display:flex;flex-direction:column;margin-top:24px}
${R} .nl6-label{margin-bottom:8px;font-size:${BODY};font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
${R} .nl6-field{position:relative}
${R} .nl6-field-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink) 60%,var(--field));pointer-events:none}
${R} .nl6-input{display:block;width:100%;min-height:56px;margin:0;padding:0 16px 0 48px;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:${BODY};font-weight:500;line-height:1.2;box-shadow:inset 0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .08);transition:border-color .16s ease,box-shadow .16s ease}
${R} .nl6-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .nl6-input:hover:not(:disabled):not(:focus){border-color:color-mix(in oklch,var(--field-ink) 40%,var(--field))}
${R} .nl6-input:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .35)}
${R} .nl6-input[aria-invalid='true']{border-color:var(--danger)}
${R} .nl6-input[aria-invalid='true']:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
${R} .nl6-input:disabled{background:color-mix(in oklch,var(--field-ink) 6%,var(--field));cursor:not-allowed}
${R} .nl6-error{margin:8px 0 0;font-size:.9375rem;font-weight:600;line-height:1.4;color:var(--danger);text-wrap:pretty}
${R} .nl6-error svg{display:inline-block;vertical-align:-.2em;margin-inline-end:.4em}
${R} .nl6-error--commit{padding-left:38px}
${R} .nl6-commit{position:relative;display:flex;align-items:flex-start;gap:12px;margin-top:20px;font-size:${BODY};font-weight:600;line-height:1.4;color:var(--ink);cursor:pointer}
${R} .nl6-commit-input{position:absolute;left:0;top:0;width:26px;height:26px;margin:0;opacity:0;cursor:pointer}
${R} .nl6-commit-box{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:8px;border:2px solid color-mix(in oklch,var(--field-ink) 55%,var(--field));background:var(--field);color:transparent;transition:background .16s ease,border-color .16s ease}
${R} .nl6-commit:hover .nl6-commit-box{border-color:var(--field-focus,var(--accent))}
${R} .nl6-commit-input:checked + .nl6-commit-box{background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card))}
${R} .nl6-commit-input:focus-visible + .nl6-commit-box{box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / .4)}
${R} .nl6-commit.is-invalid .nl6-commit-box{border-color:var(--danger)}
${R} .nl6-commit.is-disabled,${R} .nl6-commit.is-disabled .nl6-commit-input{cursor:not-allowed}
${R} .nl6-commit.is-disabled .nl6-commit-box{background:color-mix(in oklch,var(--field-ink) 6%,var(--field))}
${R} .nl6-commit-text{padding-top:1px;text-wrap:pretty}
${R} .nl6-btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:24px;padding:0 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .02) c h));color:var(--button-ink,var(--cta-ink));font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);text-transform:var(--button-case,none);font-size:${LEAD};line-height:1.15;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(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .nl6-btn:not(:disabled):hover,${R} .nl6-btn.is-hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .07) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .18) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .32),0 10px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .52))}
${R} .nl6-btn:not(:disabled):active,${R} .nl6-btn.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - .04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - .08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - .16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / .3)}
${R} .nl6-btn:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .nl6-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:var(--button-2-shadow,var(--shadow-sm));text-shadow:none;cursor:not-allowed}
${R} .nl6-btn[aria-busy='true']{cursor:progress}
${R} .nl6-spin{animation:nl6-spin .8s linear infinite}
${R} .nl6-privacy{margin:12px 0 0;font-size:.9375rem;font-weight:500;line-height:1.4;color:var(--muted);text-align:center;text-wrap:pretty}
${R} .nl6-privacy svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
@keyframes nl6-spin{to{transform:rotate(360deg)}}
@keyframes nl6-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
${R}[data-reveal='wait'] .nl6-tile{opacity:.82;transform:translateY(8px)}
${R}[data-reveal='in'] .nl6-tile{animation:nl6-rise .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
@media (max-width:760px){
${R} .nl6-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
${R} .nl6-tile{grid-column:span var(--sm,2)}
${R} .nl6-form-tile{order:-1}
${R} .nl6-fig{justify-content:flex-start;gap:16px}
${R} .nl6-fig-label{margin-top:8px;font-size:1rem}
${R} .nl6-photo{grid-template-rows:auto auto}
${R} .nl6-photo-frame{min-height:0;aspect-ratio:16/10}
${R} .nl6-issue-list{grid-auto-rows:auto}
${R} .nl6-btn{padding:0 16px;font-size:1.0625rem;letter-spacing:-.005em}
}
@media (prefers-reduced-motion:reduce){
${R} .nl6-tile{animation:none !important;opacity:1 !important;transform:none !important}
${R} .nl6-btn,${R} .nl6-input,${R} .nl6-issue,${R} .nl6-commit-box{transition:none}
${R} .nl6-btn:not(:disabled):hover,${R} .nl6-btn.is-hover:not(:disabled),${R} .nl6-btn:not(:disabled):active,${R} .nl6-btn.is-active:not(:disabled){transform:none}
${R} .nl6-spin{animation:none}
}
`;
pieces/forms/newsletter-signup-6/specimen.tsx 44 lines
import __studioImagea39249bb from "../assets/606859569f731ad1.webp";
import { NewsletterSignup6 } from '../newsletter-signup-6';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
type SpecimenState = 'default' | 'hover' | 'active' | 'disabled' | 'error';
export default function NewsletterSignup6Specimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<NewsletterSignup6
state={state}
headline='Watch your trees go in the ground'
emphasis='go in the ground'
lead='Every other Thursday, our crews send home what they planted, who showed up and which acres are now safe for good.'
aside='(I know. A newsletter about dirt. Wait until you see the photos.)'
signoff='Maya Ortiz, field director, Greenbelt Trust'
figures={[
{ value: '12,480', label: 'trees planted this season', detail: 'Native oak, hazel and alder saplings', icon: 'tree' },
{ value: '318', label: 'volunteers in the field', icon: 'people' },
{ value: '2,140', label: 'acres protected for good', icon: 'land' },
]}
sceneImage={slot('scene', __studioImagea39249bb)}
sceneAlt='Volunteers planting young oak saplings on a hillside at sunrise'
sceneCaption='Spring planting on the north ridge'
issuesHeading='Catch up on the last three field notes'
issues={[
{ number: 'No. 24', date: 'Oct 30', title: 'The north ridge finally has shade' },
{ number: 'No. 23', date: 'Oct 16', title: '318 people, one muddy Saturday' },
{ number: 'No. 22', date: 'Oct 2', title: 'Why we bought the old orchard' },
]}
formHeadline='Get the next issue of Greenbelt field notes'
formLead='Free, every other Thursday. Two minutes to read.'
subscriberCount='4,600'
proofTemplate='Join {count} neighbours already watching the work happen.'
commitLabel='Yes, send me the field notes every other Thursday'
buttonLabel='Send Me The Field Notes'
privacy={defaults.sample.registration.privacy}
defaultEmail={state === 'error' ? 'maya@greenbelt' : ''}
onSubmit={() => undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalNewsletterSignup6 |
string |
Default 'Watch the work happen, straight from the field'
|
emphasis OptionalNewsletterSignup6 |
string |
Default 'straight from the field'
|
lead OptionalNewsletterSignup6 |
string |
Default 'Get a short field report from our crews: what went in the ground, who showed up and which land is now protected.'
|
aside OptionalNewsletterSignup6 |
string |
Default '(Muddy boots and all.)'
|
signoff OptionalNewsletterSignup6 |
string |
Default ''
|
figures OptionalNewsletterSignup6 |
NewsletterFigure[] |
Default []
|
sceneImage OptionalNewsletterSignup6 |
string |
Default ''
|
sceneAlt OptionalNewsletterSignup6 |
string |
Default ''
|
sceneCaption OptionalNewsletterSignup6 |
string |
Default ''
|
issuesHeading OptionalNewsletterSignup6 |
string |
Default 'Catch up on the last three reports'
|
issues OptionalNewsletterSignup6 |
NewsletterIssue[] |
Default DEFAULT_ISSUES
|
onIssueAction OptionalNewsletterSignup6 |
(issue: NewsletterIssue, index: number) => void |
|
formHeadline OptionalNewsletterSignup6 |
string |
Default 'Get the next field report'
|
formLead OptionalNewsletterSignup6 |
string |
Default 'Free, short and straight from our crews.'
|
subscriberCount OptionalNewsletterSignup6 |
string |
Default ''
|
proofTemplate OptionalNewsletterSignup6 |
string |
Default 'Join {count} people already watching the work happen.'
|
emailLabel OptionalNewsletterSignup6 |
string |
Default 'Your email address'
|
emailPlaceholder OptionalNewsletterSignup6 |
string |
Default 'you@example.com'
|
commitLabel OptionalNewsletterSignup6 |
string |
Default 'Yes, send me the field report by email'
|
commitDefault OptionalNewsletterSignup6 |
boolean |
Default false
|
buttonLabel OptionalNewsletterSignup6 |
string |
Default 'Send Me The Field Report'
|
busyLabel OptionalNewsletterSignup6 |
string |
Default 'Adding you to the list…'
|
privacy OptionalNewsletterSignup6 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
requiredError OptionalNewsletterSignup6 |
string |
Default 'Enter your email address so we know where to send the report.'
|
invalidError OptionalNewsletterSignup6 |
string |
Default 'That email looks incomplete. Check it and try again.'
|
commitError OptionalNewsletterSignup6 |
string |
Default 'Tick the box so we know you want the report.'
|
defaultEmail OptionalNewsletterSignup6 |
string |
Default ''
|
disabled OptionalNewsletterSignup6 |
boolean |
Default false
|
onSubmit OptionalNewsletterSignup6 |
(values: { email: string }) => void | Promise<unknown> |
|
state OptionalNewsletterSignup6 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
Default 'default'
|
className OptionalNewsletterSignup6 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
606859569f731ad1.webp
image/webp · 236 KB
-
a57ca5c86a05001f.webp
image/webp · 108 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB