Newsletter Signup 2
Newsletter signup set as an open magazine spread: the latest issue (cover, three headlines and a sample that opens inline) faces the editor’s promise, a short letter and the email form, so the reader judges the writing before giving an email.
Use it in a prompt
Use forms/newsletter-signup-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/forms/newsletter-signup-2.tsx. - Import it and pass your copy and images (Props tab):
import { NewsletterSignup2 } from "@/components/funneldna/forms/newsletter-signup-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/newsletter-signup-2/component.tsx 520 lines
// layout: magazine-spread
// Newsletter signup set as an open magazine spread: the latest issue (cover, three headlines and a sample that opens inline) faces the editor’s promise, a short letter and the email form, so the reader judges the writing before giving an email.
import * as React from 'react';
import { AlertCircle, BookOpen, CalendarDays, Clock, Gift, Loader2, Lock, Mail } from 'lucide-react';
import { FX_HOST, Texture } from '../fx/fx';
import linen from '../fx/textures/linen';
export type NewsletterSignup2Fact = {
text: string;
/** Lucide icon shown in the chip. */
icon?: 'calendar' | 'clock' | 'free' | 'mail' | 'none';
};
export type NewsletterSignup2Excerpt = {
title: string;
/** Bold sentence that opens the sample. */
leadIn?: string;
paragraphs: string[];
};
export type NewsletterSignup2Props = {
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
/** Large pull line under the headline (supplied facts only). */
pullLine?: string;
/** How often it arrives, read time, price: short chips. */
facts?: NewsletterSignup2Fact[];
salutation?: string;
/** The editor’s short letter, one string per paragraph. */
letter?: string[];
/** Handwritten first name for the sign-off; empty hides it and loads no script face. */
signature?: string;
signoffName?: string;
signoffRole?: string;
emailLabel?: string;
emailPlaceholder?: string;
buttonLabel?: string;
/** Button label while the promise returned by onSubmit is pending. */
busyLabel?: string;
privacy?: string;
requiredError?: string;
invalidError?: 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>;
/** Slot: product (the latest issue’s cover). Empty hides it. */
coverImage?: string;
coverAlt?: string;
sampleHeading?: string;
issueName?: string;
issueNumber?: string;
issueDate?: string;
/** Headlines from the latest issue (three reads best). With no headlines, excerpt or cover, the spread becomes promise beside form only. */
headlines?: string[];
/** Short supplied excerpt that the sample button opens inline. */
excerpt?: NewsletterSignup2Excerpt;
sampleOpenLabel?: string;
sampleCloseLabel?: string;
defaultSampleOpen?: boolean;
fullIssueLabel?: string;
/** Where the full issue lives. */
href?: string;
/** Called when the full-issue link is clicked. */
onAction?: (event: React.MouseEvent<HTMLElement>) => void;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
const DEFAULT_FACTS: NewsletterSignup2Fact[] = [
{ text: 'Every week', icon: 'calendar' },
{ text: '5-minute read', icon: 'clock' },
{ text: 'Free', icon: 'free' },
];
const DEFAULT_LETTER = [
'You don’t need another inbox habit. You need the few ideas that change your week.',
'So each issue is short, specific and ready to use. Read the sample first. If it isn’t worth five minutes, don’t subscribe.',
];
export function NewsletterSignup2({
headline = 'Get the week’s most useful ideas in one five-minute email',
highlight = 'one five-minute email',
pullLine = 'Read the latest issue first. Subscribe only if it earns a place in your inbox.',
facts = DEFAULT_FACTS,
salutation = 'Dear reader,',
letter = DEFAULT_LETTER,
signature = '',
signoffName = '',
signoffRole = '',
emailLabel = 'Your email address',
emailPlaceholder = 'you@example.com',
buttonLabel = 'Send Me The Next Issue',
busyLabel = 'Adding you to the list…',
privacy = 'We respect your inbox. Unsubscribe anytime.',
requiredError = 'Enter your email so we know where to send the next issue.',
invalidError = 'That email looks incomplete. Check it and try again.',
defaultEmail = '',
disabled = false,
onSubmit,
coverImage = '',
coverAlt = 'Cover of the latest issue',
sampleHeading = 'Read the latest issue before you sign up',
issueName = '',
issueNumber = '',
issueDate = '',
headlines = [],
excerpt,
sampleOpenLabel = 'Read a sample',
sampleCloseLabel = 'Hide the sample',
defaultSampleOpen = false,
fullIssueLabel = 'Read the full issue',
href,
onAction,
state = 'default',
className,
}: NewsletterSignup2Props) {
const uid = React.useId();
const headingId = uid + '-heading';
const emailId = uid + '-email';
const errorId = uid + '-error';
const noteId = uid + '-note';
const panelId = uid + '-sample';
const excerptTitleId = uid + '-sample-title';
const inputRef = React.useRef<HTMLInputElement>(null);
const mounted = React.useRef(true);
const [email, setEmail] = React.useState(defaultEmail);
const [touched, setTouched] = React.useState(false);
const [error, setError] = React.useState<string | null>(() =>
state === 'error' ? check(defaultEmail, requiredError, invalidError) ?? invalidError : null,
);
const [pending, setPending] = React.useState(false);
const [open, setOpen] = React.useState(defaultSampleOpen);
const isDisabled = disabled || state === 'disabled';
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
React.useEffect(() => {
setEmail(defaultEmail);
}, [defaultEmail]);
React.useEffect(() => {
setError(state === 'error' ? check(defaultEmail, requiredError, invalidError) ?? invalidError : null);
}, [state, defaultEmail, requiredError, invalidError]);
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const next = event.target.value;
setEmail(next);
setTouched(true);
if (error && !check(next, requiredError, invalidError)) setError(null);
};
const handleBlur = () => {
if (!touched) return;
setError(check(email, requiredError, invalidError));
};
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (isDisabled || pending) return;
const message = check(email, requiredError, invalidError);
setError(message);
setTouched(true);
if (message) {
inputRef.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 hasSample = headlines.length > 0 || Boolean(excerpt) || Boolean(coverImage);
const meta = [issueName, issueNumber, issueDate].filter(Boolean).join(' · ');
const describedBy = [error ? errorId : '', privacy ? noteId : ''].filter(Boolean).join(' ') || undefined;
return (
<section className={join('cf-newsletter-signup-2', className)} style={FX_HOST} aria-labelledby={headingId}>
<style>{CSS}</style>
{signature ? (
<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Caveat:wght@600&display=swap' />
) : null}
<Texture src={linen} tone='band-ink' />
<div className='ns2-inner'>
<div className='ns2-stack'>
<span className='ns2-sheet' aria-hidden='true' />
<div className='ns2-spread' data-layout={hasSample ? 'spread' : 'solo'}>
<div className='ns2-page ns2-promise'>
<div className='ns2-promise-grid'>
<div className='ns2-copy'>
<h2 id={headingId} className='ns2-headline'>
<Headline text={headline} phrase={highlight} />
</h2>
{pullLine ? <p className='ns2-pull'>{pullLine}</p> : null}
{facts.length ? (
<ul className='ns2-facts'>
{facts.map((fact) => (
<li key={fact.text}>
<FactIcon icon={fact.icon} />
<span>{fact.text}</span>
</li>
))}
</ul>
) : null}
{letter.length ? (
<div className='ns2-letter'>
{salutation ? <p className='ns2-salutation'>{salutation}</p> : null}
{letter.map((paragraph) => (
<p key={paragraph}>{paragraph}</p>
))}
{signature || signoffName ? (
<div className='ns2-signoff'>
{signature ? (
<span className='ns2-signature' aria-hidden={signoffName ? 'true' : undefined}>
{signature}
</span>
) : null}
{signoffName ? (
<span className='ns2-signer'>
<strong>{signoffName}</strong>
{signoffRole ? ', ' + signoffRole : ''}
</span>
) : null}
</div>
) : null}
</div>
) : null}
</div>
<div className='ns2-join'>
<form className='ns2-form' noValidate onSubmit={handleSubmit} aria-busy={pending || undefined}>
<label htmlFor={emailId} className='ns2-label'>
{emailLabel}
</label>
<div className='ns2-field'>
<Mail size={20} strokeWidth={2.5} aria-hidden='true' />
<input
ref={inputRef}
id={emailId}
className='ns2-input'
type='email'
name='email'
inputMode='email'
autoComplete='email'
enterKeyHint='send'
placeholder={emailPlaceholder}
value={email}
onChange={handleChange}
onBlur={handleBlur}
disabled={isDisabled}
aria-invalid={error ? true : undefined}
aria-describedby={describedBy}
/>
</div>
{error ? (
<p id={errorId} className='ns2-error' role='alert'>
<AlertCircle size={16} strokeWidth={2.5} aria-hidden='true' />
{error}
</p>
) : null}
<button
type='submit'
className={join('ns2-submit', state === 'hover' && 'is-hover', state === 'active' && 'is-active')}
disabled={isDisabled}
aria-busy={pending || undefined}
>
{pending ? (
<>
<Loader2 className='ns2-spin' size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{busyLabel}</span>
</>
) : (
<span>{buttonLabel}</span>
)}
</button>
{privacy ? (
<p id={noteId} className='ns2-note'>
<Lock size={16} strokeWidth={2.5} aria-hidden='true' />
{privacy}
</p>
) : null}
</form>
</div>
</div>
</div>
{hasSample ? (
<div className='ns2-page ns2-sample'>
<div className='ns2-issue' data-cover={coverImage ? 'true' : 'false'}>
{coverImage ? (
<img className='ns2-cover' src={coverImage} alt={coverAlt} width={600} height={800} loading='lazy' />
) : null}
<div className='ns2-issue-text'>
{sampleHeading ? <h3 className='ns2-sample-heading'>{sampleHeading}</h3> : null}
{meta ? <p className='ns2-meta'>{meta}</p> : null}
</div>
</div>
{headlines.length ? (
<ol className='ns2-headlines'>
{headlines.map((item, index) => (
<li key={item}>
<span className='ns2-num' aria-hidden='true'>
{String(index + 1).padStart(2, '0')}
</span>
<span className='ns2-hl'>{item}</span>
</li>
))}
</ol>
) : null}
{excerpt ? (
<div className='ns2-reader'>
<button
type='button'
className='ns2-disclose'
aria-expanded={open}
aria-controls={panelId}
onClick={() => setOpen((value) => !value)}
>
<BookOpen size={20} strokeWidth={2.5} aria-hidden='true' />
<span>{open ? sampleCloseLabel : sampleOpenLabel}</span>
</button>
<div
id={panelId}
className='ns2-panel'
data-open={open ? 'true' : 'false'}
role='region'
aria-labelledby={excerptTitleId}
>
<div className='ns2-panel-inner'>
<article className='ns2-excerpt'>
<h4 id={excerptTitleId} className='ns2-excerpt-title'>
{excerpt.title}
</h4>
{excerpt.paragraphs.map((paragraph, index) => (
<p key={paragraph}>
{index === 0 && excerpt.leadIn ? <strong>{excerpt.leadIn} </strong> : null}
{paragraph}
</p>
))}
</article>
{fullIssueLabel ? (
<p className='ns2-more'>
{href ? (
<a className='ns2-full' href={href} onClick={onAction}>
{fullIssueLabel}
</a>
) : (
<button type='button' className='ns2-full' onClick={onAction}>
{fullIssueLabel}
</button>
)}
</p>
) : null}
</div>
</div>
</div>
) : null}
</div>
) : null}
</div>
</div>
</div>
</section>
);
}
export default NewsletterSignup2;
function Headline({ text, phrase }: { 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='ns2-mark'>{phrase}</span>
{text.slice(at + phrase.length)}
</>
);
}
function FactIcon({ icon }: { icon?: NewsletterSignup2Fact['icon'] }) {
const props = { size: 16, strokeWidth: 2.5, 'aria-hidden': true as const };
if (icon === 'calendar') return <CalendarDays {...props} />;
if (icon === 'clock') return <Clock {...props} />;
if (icon === 'free') return <Gift {...props} />;
if (icon === 'mail') return <Mail {...props} />;
return null;
}
const EMAIL_PATTERN = /^[^ @]+@[^ @]+[.][^ @]{2,}$/;
function check(value: string, required: string, invalid: string) {
const trimmed = value.trim();
if (!trimmed) return required;
if (!EMAIL_PATTERN.test(trimmed)) return invalid;
return null;
}
function join(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ');
}
const R = '.cf-newsletter-signup-2';
const SH = 'var(--shadow, oklch(0.22 0.03 260))';
const BG = 'var(--button-bg, var(--cta))';
const BG2 = 'var(--button-bg-2, var(--cta-2))';
const BTN2 = 'var(--button-2-bg, var(--secondary))';
const EASE = 'cubic-bezier(.2,.7,.2,1)';
const CSS = `
${R}{position:relative;overflow:hidden;background:var(--band);color:var(--band-ink);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);font-family:var(--font-body)}
${R} *,${R} *::before,${R} *::after{box-sizing:border-box}
${R} .ns2-inner{position:relative;z-index:1;max-width:1120px;margin-inline:auto}
${R} .ns2-stack{position:relative}
${R} .ns2-sheet{position:absolute;left:clamp(10px,2vw,22px);right:clamp(10px,2vw,22px);top:12px;bottom:-10px;border-radius:var(--card-radius,var(--radius,14px));background:color-mix(in oklch,var(--ink) 9%,var(--card));box-shadow:var(--shadow-sm,0 1px 2px oklch(from ${SH} l c h / .25))}
${R} .ns2-spread{position:relative;display:grid;grid-template-columns:minmax(0,1fr);overflow:hidden;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-lg,0 2px 4px oklch(from ${SH} l c h / .22),0 12px 24px -8px oklch(from ${SH} l c h / .32)))}
${R} .ns2-page{position:relative;min-width:0;padding:clamp(24px,4vw,48px) clamp(20px,4vw,48px)}
${R} .ns2-sample{border-top:1px solid oklch(from var(--ink) l c h / .12)}
${R} .ns2-promise-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:32px}
${R} .ns2-copy,${R} .ns2-join{min-width:0}
${R} .ns2-headline{margin:0;color:var(--ink);font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance}
${R} .ns2-mark{background:linear-gradient(to bottom,transparent 54%,color-mix(in oklch,var(--marker,#fae37c) 80%,transparent) 54%,color-mix(in oklch,var(--marker,#fae37c) 80%,transparent) 93%,transparent 93%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .06em;margin:0 -.06em;border-radius:.18em .1em .22em .12em}
${R} .ns2-pull{margin:16px 0 0;color:var(--accent);font-family:var(--font-display);font-weight:700;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.25;letter-spacing:-.01em;text-wrap:balance}
${R} .ns2-facts{display:flex;flex-wrap:wrap;gap:8px;margin:24px 0 0;padding:0;list-style:none}
${R} .ns2-facts li{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2}
${R} .ns2-facts svg{flex:none;color:var(--accent)}
${R} .ns2-letter{margin-top:32px;max-width:64ch}
${R} .ns2-letter p{margin:0 0 12px;color:var(--ink);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.55;text-wrap:pretty}
${R} .ns2-letter p.ns2-salutation{font-weight:700}
${R} .ns2-signoff{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin-top:16px}
${R} .ns2-signature{--signature-font:var(--signature-face,'Caveat',var(--font-display));font-family:var(--signature-font);font-size:2rem;font-weight:600;line-height:1;color:var(--signature-ink,var(--ink))}
${R} .ns2-signer{color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .ns2-signer strong{color:var(--ink);font-weight:700}
${R} .ns2-form{display:grid}
${R} .ns2-label{display:block;margin-bottom:8px;color:var(--label-ink,var(--ink));font-size:1.0625rem;font-weight:700;line-height:1.3}
${R} .ns2-field{position:relative}
${R} .ns2-field svg{position:absolute;left:18px;top:50%;transform:translateY(-50%);color:color-mix(in oklch,var(--field-ink) 65%,var(--field));pointer-events:none}
${R} .ns2-input{display:block;width:100%;height:56px;padding:0 18px 0 50px;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:inherit;font-size:1.0625rem;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} .ns2-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
${R} .ns2-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 40%,transparent)}
${R} .ns2-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} .ns2-input[aria-invalid=true]{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .18)}
${R} .ns2-input[aria-invalid=true]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .35)}
${R} .ns2-input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 6%,var(--field));color:color-mix(in oklch,var(--field-ink) 70%,var(--field))}
${R} .ns2-error{margin:8px 0 0;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
${R} .ns2-error svg,${R} .ns2-note svg{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
${R} .ns2-submit{display:inline-flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:64px;margin-top:16px;padding:8px 28px;border:0;border-radius:var(--button-radius,var(--radius,12px));background:linear-gradient(oklch(from ${BG} calc(l + .04) c h),oklch(from ${BG2} 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:clamp(1.125rem,1.55vw,1.375rem);line-height:1.15;text-align:center;text-wrap:balance;text-shadow:var(--button-text-shadow,none);cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from ${BG} calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from ${BG} calc(l - .16) c h),0 1px 2px oklch(from ${SH} l c h / .3),0 8px 16px -6px oklch(from ${SH} l c h / .45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
${R} .ns2-submit:hover:not(:disabled),${R} .ns2-submit.is-hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(oklch(from ${BG} calc(l - .01) c h),oklch(from ${BG2} calc(l - .07) c h));box-shadow:inset 0 1px 0 oklch(from ${BG} calc(l + .1) c h / .6),inset 0 -3px 0 oklch(from ${BG} calc(l - .2) 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 / .55)}
${R} .ns2-submit:active:not(:disabled),${R} .ns2-submit.is-active:not(:disabled){transform:translateY(1px);background:linear-gradient(oklch(from ${BG} calc(l - .08) c h),oklch(from ${BG2} calc(l - .1) c h));box-shadow:inset 0 2px 4px oklch(from ${BG} calc(l - .24) c h / .55),inset 0 -2px 0 oklch(from ${BG} calc(l - .2) c h),0 1px 1px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .3)}
${R} .ns2-submit:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .ns2-submit:disabled{cursor:not-allowed;transform:none;background:${BTN2};color:color-mix(in oklch,var(--button-2-ink,var(--secondary-ink)) 70%,${BTN2});text-shadow:none;box-shadow:var(--button-2-shadow,var(--shadow-sm))}
${R} .ns2-submit[aria-busy=true]{cursor:progress}
${R} .ns2-spin{flex:none;animation:cf-ns2-spin .8s linear infinite}
${R} .ns2-note{margin:12px 0 0;color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
${R} .ns2-issue{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
${R} .ns2-issue[data-cover=true]{grid-template-columns:clamp(96px,12vw,150px) minmax(0,1fr);gap:clamp(16px,2vw,24px)}
${R} .ns2-cover{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;object-position:center top;border-radius:8px;filter:drop-shadow(0 2px 3px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .3)) drop-shadow(0 10px 14px oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .22))}
${R} .ns2-issue-text{min-width:0}
${R} .ns2-sample-heading{margin:0;color:var(--ink);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:-.01em;text-wrap:balance}
${R} .ns2-meta{margin:12px 0 0;color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4}
${R} .ns2-headlines{margin:24px 0 0;padding:0;list-style:none;border-bottom:1px solid oklch(from var(--ink) l c h / .12)}
${R} .ns2-headlines li{display:grid;grid-template-columns:2.5rem minmax(0,1fr);gap:12px;align-items:baseline;padding:16px 0;border-top:1px solid oklch(from var(--ink) l c h / .12)}
${R} .ns2-num{color:var(--accent);font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
${R} .ns2-hl{color:var(--ink);font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:700;line-height:1.35;text-wrap:pretty}
${R} .ns2-reader{margin-top:24px}
${R} .ns2-disclose{display:flex;width:100%;align-items:center;justify-content:center;gap:10px;min-height:56px;padding:0 24px;border:1px solid var(--button-2-border,transparent);border-radius:var(--button-radius,var(--radius,12px));background:${BTN2};color:var(--button-2-ink,var(--secondary-ink));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;cursor:pointer;box-shadow:var(--button-2-shadow,var(--shadow-sm));transition:background .16s ease,transform .16s ease}
${R} .ns2-disclose:hover{background:oklch(from ${BTN2} calc(l - .03) c h)}
${R} .ns2-disclose:active{transform:translateY(1px);background:oklch(from ${BTN2} calc(l - .06) c h)}
${R} .ns2-disclose[aria-expanded=true]{background:oklch(from ${BTN2} calc(l - .04) c h)}
${R} .ns2-disclose:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
${R} .ns2-disclose svg{flex:none}
${R} .ns2-panel{display:grid;grid-template-rows:0fr;visibility:hidden;transition:grid-template-rows .32s ${EASE},visibility 0s linear .32s}
${R} .ns2-panel[data-open=true]{grid-template-rows:1fr;visibility:visible;transition:grid-template-rows .32s ${EASE},visibility 0s}
${R} .ns2-panel-inner{min-height:0;overflow:hidden}
${R} .ns2-excerpt{margin-top:16px;padding:clamp(20px,2.6vw,28px);border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
${R} .ns2-excerpt-title{margin:0 0 12px;color:var(--ink);font-family:var(--font-display);font-weight:800;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.3;text-wrap:balance}
${R} .ns2-excerpt p{margin:0 0 12px;color:var(--ink);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.55;text-wrap:pretty}
${R} .ns2-excerpt p:last-child{margin-bottom:0}
${R} .ns2-excerpt strong{font-weight:700}
${R} .ns2-more{margin:16px 0 0}
${R} .ns2-full{display:inline;padding:0;border:0;background:none;font:inherit;font-size:1.0625rem;font-weight:700;color:var(--link,var(--accent));text-decoration:underline;text-decoration-color:oklch(from var(--link,var(--accent)) l c h / .45);text-underline-offset:.18em;cursor:pointer}
${R} .ns2-full:hover{color:oklch(from var(--link,var(--accent)) calc(l - .08) c h);text-decoration-color:currentColor}
${R} .ns2-full:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px;border-radius:4px}
@media (min-width:900px){
${R} .ns2-spread[data-layout=spread]{grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)}
${R} .ns2-spread[data-layout=spread] .ns2-sample{grid-column:1;grid-row:1;border-top:0}
${R} .ns2-spread[data-layout=spread] .ns2-promise{grid-column:2;grid-row:1;border-left:1px solid oklch(from var(--ink) l c h / .1)}
${R} .ns2-spread[data-layout=spread] .ns2-sample::after{content:'';position:absolute;inset:0 0 0 auto;width:44px;background:linear-gradient(to left,oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .09),transparent);pointer-events:none}
${R} .ns2-spread[data-layout=spread] .ns2-promise::before{content:'';position:absolute;inset:0 auto 0 0;width:28px;background:linear-gradient(to right,oklch(from var(--shadow, oklch(0.22 0.03 260)) l c h / .06),transparent);pointer-events:none}
${R} .ns2-spread[data-layout=solo] .ns2-promise-grid{grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:clamp(32px,5vw,72px);align-items:start}
${R} .ns2-spread[data-layout=solo] .ns2-join{padding:clamp(20px,3vw,32px);border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card))}
}
@media (max-width:520px){
${R} .ns2-headlines li{grid-template-columns:2rem minmax(0,1fr)}
${R} .ns2-submit{padding-inline:16px}
}
@media (prefers-reduced-motion:no-preference){
${R} .ns2-page{animation:cf-ns2-in .45s ${EASE} both}
${R} .ns2-sample{animation-delay:.07s}
}
@media (prefers-reduced-motion:reduce){
${R} .ns2-panel,${R} .ns2-panel[data-open=true],${R} .ns2-submit,${R} .ns2-disclose,${R} .ns2-input{transition:none}
${R} .ns2-spin{animation:none}
${R} .ns2-submit:hover:not(:disabled),${R} .ns2-submit.is-hover:not(:disabled),${R} .ns2-submit:active:not(:disabled),${R} .ns2-submit.is-active:not(:disabled),${R} .ns2-disclose:active{transform:none}
}
@keyframes cf-ns2-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-ns2-spin{to{transform:rotate(360deg)}}
`;
pieces/forms/newsletter-signup-2/specimen.tsx 67 lines
import __studioImage0a0ecf7c from "../assets/9dd4f60aa41ad319.webp";
import * as React from 'react';
import { NewsletterSignup2, type NewsletterSignup2Props } from '../newsletter-signup-2';
import defaults from '../../studio-defaults.json';
import { slot } from '../../slots';
export const states = ['default', 'hover', 'active', 'disabled', 'error'];
export default function NewsletterSignup2Specimen({ state = 'default' }: { state?: NewsletterSignup2Props['state'] }) {
return (
<NewsletterSignup2
state={state}
headline='Know what moved freight this week in five minutes flat'
highlight='in five minutes flat'
pullLine='One email every Tuesday at 6 a.m. Written for the people who run the docks, the lanes and the budget.'
facts={[
{ text: 'Every Tuesday, 6 a.m. CT', icon: 'calendar' },
{ text: '5-minute read', icon: 'clock' },
{ text: 'Free', icon: 'free' },
]}
salutation='Dear operator,'
letter={[
'You don’t have time for a 40-tab news habit. You have trucks to load.',
'So every Tuesday I read the rate reports, the rule changes and the carrier chatter, then send you only what changes your week. Read the sample first. If it isn’t worth five minutes, don’t subscribe.',
]}
signature='Mara'
signoffName='Mara Lindqvist'
signoffRole='Editor, The Freight Brief'
emailLabel='Your work email'
emailPlaceholder='you@company.com'
buttonLabel='Send Me Tuesday’s Brief'
busyLabel='Adding you to Tuesday’s list…'
privacy={defaults.sample.registration.privacy}
requiredError='Enter your work email so we know where to send Tuesday’s brief.'
invalidError='That email looks incomplete. Check it and try again.'
defaultEmail={state === 'error' ? 'dana@freightco' : ''}
onSubmit={() => undefined}
coverImage={slot(
'product',
__studioImage0a0ecf7c,
)}
coverAlt='Cover of The Freight Brief, Issue 112'
sampleHeading='Read this week’s issue before you sign up'
issueName='The Freight Brief'
issueNumber='Issue 112'
issueDate='Tuesday, Nov 18'
headlines={[
'Detention fees are back. Here’s how to read your carrier contract.',
'The three-question check that flags double-brokered loads',
'Returns are your hidden lane. Price them before peak.',
]}
excerpt={{
title: 'Detention fees are back. Here’s how to read your carrier contract.',
leadIn: 'Most shippers sign the rate sheet and skip the accessorials page.',
paragraphs: [
'That page is where detention lives, and it quietly grows your freight bill.',
'Start with free time. Two hours is common, but the clock can start at check-in or at the appointment time. That one word changes what you pay.',
'Then find out who records the driver’s departure. If your dock never logs it, the carrier’s timestamp wins every dispute.',
],
}}
sampleOpenLabel='Read a sample'
sampleCloseLabel='Hide the sample'
fullIssueLabel='Read the full issue'
onAction={() => undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalNewsletterSignup2 |
string |
Default 'Get the week’s most useful ideas in one five-minute email'
|
highlight OptionalNewsletterSignup2 |
string |
Default 'one five-minute email'
|
pullLine OptionalNewsletterSignup2 |
string |
Default 'Read the latest issue first. Subscribe only if it earns a place in your inbox.'
|
facts OptionalNewsletterSignup2 |
NewsletterSignup2Fact[] |
Default DEFAULT_FACTS
|
salutation OptionalNewsletterSignup2 |
string |
Default 'Dear reader,'
|
letter OptionalNewsletterSignup2 |
string[] |
Default DEFAULT_LETTER
|
signature OptionalNewsletterSignup2 |
string |
Default ''
|
signoffName OptionalNewsletterSignup2 |
string |
Default ''
|
signoffRole OptionalNewsletterSignup2 |
string |
Default ''
|
emailLabel OptionalNewsletterSignup2 |
string |
Default 'Your email address'
|
emailPlaceholder OptionalNewsletterSignup2 |
string |
Default 'you@example.com'
|
buttonLabel OptionalNewsletterSignup2 |
string |
Default 'Send Me The Next Issue'
|
busyLabel OptionalNewsletterSignup2 |
string |
Default 'Adding you to the list…'
|
privacy OptionalNewsletterSignup2 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
requiredError OptionalNewsletterSignup2 |
string |
Default 'Enter your email so we know where to send the next issue.'
|
invalidError OptionalNewsletterSignup2 |
string |
Default 'That email looks incomplete. Check it and try again.'
|
defaultEmail OptionalNewsletterSignup2 |
string |
Default ''
|
disabled OptionalNewsletterSignup2 |
boolean |
Default false
|
onSubmit OptionalNewsletterSignup2 |
(values: { email: string }) => void | Promise<unknown> |
|
coverImage OptionalNewsletterSignup2 |
string |
Default ''
|
coverAlt OptionalNewsletterSignup2 |
string |
Default 'Cover of the latest issue'
|
sampleHeading OptionalNewsletterSignup2 |
string |
Default 'Read the latest issue before you sign up'
|
issueName OptionalNewsletterSignup2 |
string |
Default ''
|
issueNumber OptionalNewsletterSignup2 |
string |
Default ''
|
issueDate OptionalNewsletterSignup2 |
string |
Default ''
|
headlines OptionalNewsletterSignup2 |
string[] |
Default []
|
excerpt OptionalNewsletterSignup2 |
NewsletterSignup2Excerpt |
|
sampleOpenLabel OptionalNewsletterSignup2 |
string |
Default 'Read a sample'
|
sampleCloseLabel OptionalNewsletterSignup2 |
string |
Default 'Hide the sample'
|
defaultSampleOpen OptionalNewsletterSignup2 |
boolean |
Default false
|
fullIssueLabel OptionalNewsletterSignup2 |
string |
Default 'Read the full issue'
|
href OptionalNewsletterSignup2 |
string |
|
onAction OptionalNewsletterSignup2 |
(event: React.MouseEvent<HTMLElement>) => void |
|
state OptionalNewsletterSignup2 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
Default 'default'
|
className OptionalNewsletterSignup2 |
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.
product- The main product shot or cover (ebook, kit, bottle).
-
2c539f422023a290.webp
image/webp · 115 KB
-
9dd4f60aa41ad319.webp
image/webp · 139 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB