Newsletter Signup 3
Article end-cap signup: a slim hairline strip asks for the email the moment the reader got value (reciprocity). Focusing the field reveals how often they want it, and that choice goes out with the email.
Use it in a prompt
Use forms/newsletter-signup-3 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/forms/newsletter-signup-3.tsx. - Import it and pass your copy and images (Props tab):
import { NewsletterSignup3 } from "@/components/funneldna/forms/newsletter-signup-3"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/newsletter-signup-3/component.tsx 668 lines
// layout: hello-strip
// Article end-cap signup: a slim hairline strip asks for the email the moment the reader got value (reciprocity). Focusing the field reveals how often they want it, and that choice goes out with the email.
import * as React from 'react';
import { AlertCircle, Check, Loader2, Lock, Users } from 'lucide-react';
export type NewsletterSignup3Frequency = {
/** Value sent with onSubmit, e.g. 'weekly'. */
value: string;
label: string;
/** Short detail after the label, e.g. 'Sundays'. */
hint?: string;
};
export type NewsletterSignup3Values = { email: string; frequency: string };
export type NewsletterSignup3Props = {
/** The one line, asked the moment the reader finishes the article. */
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
/** Bold lead-in of the small line under the headline, e.g. 'Next up:'. */
nextLabel?: string;
/** What arrives next. Empty hides the line. */
nextTitle?: string;
/** Slot: product. A cut-out shot of what arrives next, transparent background. Empty hides it. */
productImage?: string;
productAlt?: string;
emailLabel?: string;
emailPlaceholder?: string;
/** The action, written as the outcome. */
buttonLabel?: string;
/** Button label while the promise returned by onSubmit is pending. */
busyLabel?: string;
/** Legend over the frequency chips that appear once the field is focused. */
frequencyLegend?: string;
/** Frequency choices. The chosen value is sent with onSubmit. Empty removes the chips. */
frequencies?: NewsletterSignup3Frequency[];
defaultFrequency?: string;
/** Show the frequency chips before the field is focused. */
defaultOpen?: boolean;
privacy?: string;
/** Supplied reader count only. Empty hides the line. */
readerCount?: string;
/** Reader line. {count} is replaced by readerCount. */
readerTemplate?: string;
requiredError?: string;
invalidError?: string;
defaultEmail?: string;
disabled?: boolean;
/** Called with the validated email and the chosen frequency. Return a promise to show the busy state. Never sends data itself. */
onSubmit?: (values: NewsletterSignup3Values) => void | Promise<unknown>;
state?: 'default' | 'hover' | 'active' | 'disabled' | 'error';
className?: string;
};
const DEFAULT_FREQUENCIES: NewsletterSignup3Frequency[] = [
{ value: 'every-post', label: 'Every new post' },
{ value: 'weekly', label: 'Weekly roundup' },
];
export function NewsletterSignup3({
headline = 'Liked this? Get the next one in your inbox',
highlight = 'the next one',
nextLabel = 'Next up:',
nextTitle = '',
productImage = '',
productAlt = '',
emailLabel = 'Your email',
emailPlaceholder = 'you@example.com',
buttonLabel = 'Send me the next one',
busyLabel = 'Signing you up\u2026',
frequencyLegend = 'How often should it land?',
frequencies = DEFAULT_FREQUENCIES,
defaultFrequency = '',
defaultOpen = false,
privacy = 'We respect your inbox. Unsubscribe anytime.',
readerCount = '',
readerTemplate = 'Join {count} readers.',
requiredError = 'Enter your email so we know where to send it.',
invalidError = 'That email looks incomplete. Check it and try again.',
defaultEmail = '',
disabled = false,
onSubmit,
state = 'default',
className,
}: NewsletterSignup3Props) {
const uid = React.useId();
const headingId = uid + '-heading';
const emailId = uid + '-email';
const errorId = uid + '-error';
const noteId = uid + '-note';
const groupName = uid + '-frequency';
const inputRef = React.useRef<HTMLInputElement>(null);
const mounted = React.useRef(true);
const stateError = state === 'error' ? (defaultEmail.trim() ? invalidError : requiredError) : null;
const [email, setEmail] = React.useState(defaultEmail);
const [error, setError] = React.useState<string | null>(stateError);
const [frequency, setFrequency] = React.useState(defaultFrequency || frequencies[0]?.value || '');
const [open, setOpen] = React.useState(defaultOpen || state === 'error' || Boolean(defaultEmail));
const [pending, setPending] = React.useState(false);
const isDisabled = disabled || state === 'disabled';
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
React.useEffect(() => {
setError(state === 'error' ? (defaultEmail.trim() ? invalidError : requiredError) : null);
if (state === 'error') setOpen(true);
}, [state, defaultEmail, invalidError, requiredError]);
React.useEffect(() => {
if (defaultOpen) setOpen(true);
}, [defaultOpen]);
const hasChips = frequencies.length > 0;
const current = frequencies.some((option) => option.value === frequency) ? frequency : frequencies[0]?.value || '';
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 = () => {
if (!email.trim()) return;
setError(validate(email));
};
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (isDisabled || pending) return;
const message = validate(email);
setError(message);
if (message) {
setOpen(true);
inputRef.current?.focus();
return;
}
const result = onSubmit?.({ email: email.trim(), frequency: current });
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 [before, marked, after] = splitPhrase(headline, highlight);
const proof = readerCount ? fillCount(readerTemplate, readerCount) : '';
const hasFoot = Boolean(privacy || proof);
const describedBy = [error ? errorId : '', hasFoot ? noteId : ''].filter(Boolean).join(' ') || undefined;
return (
<section
className={join('cf-ns3', open && hasChips && 'is-open', isDisabled && 'is-disabled', className)}
aria-labelledby={headingId}
>
<style>{CSS}</style>
<div className={join('cf-ns3__inner', productImage && 'has-media')}>
<div className="cf-ns3__lede">
{productImage ? (
<img
className="cf-ns3__media"
src={productImage}
alt={productAlt}
width={88}
height={88}
loading="lazy"
decoding="async"
/>
) : null}
<div className="cf-ns3__copy">
<h2 id={headingId} className="cf-ns3__headline">
{before}
{marked ? <span className="cf-ns3__mark">{marked}</span> : null}
{after}
</h2>
{nextTitle ? (
<p className="cf-ns3__next">
{nextLabel ? <strong>{nextLabel}</strong> : null}
{nextLabel ? ' ' : ''}
{nextTitle}
</p>
) : null}
</div>
</div>
<form className="cf-ns3__form" noValidate onSubmit={handleSubmit} aria-labelledby={headingId}>
<label className="cf-ns3__label" htmlFor={emailId}>
{emailLabel}
</label>
<input
ref={inputRef}
id={emailId}
className="cf-ns3__input"
type="email"
name="email"
autoComplete="email"
inputMode="email"
enterKeyHint="send"
placeholder={emailPlaceholder}
value={email}
onChange={handleChange}
onFocus={() => setOpen(true)}
onBlur={handleBlur}
disabled={isDisabled}
required
aria-invalid={error ? true : undefined}
aria-describedby={describedBy}
/>
{error ? (
<p id={errorId} className="cf-ns3__error" aria-live="polite">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{error}
</p>
) : null}
{hasChips ? (
<div className="cf-ns3__more">
<div className="cf-ns3__clip">
<fieldset className="cf-ns3__chips" disabled={isDisabled || pending}>
<legend className="cf-ns3__legend">{frequencyLegend}</legend>
<div className="cf-ns3__row">
{frequencies.map((option) => {
const selected = option.value === current;
return (
<label key={option.value} className={join('cf-ns3__chip', selected && 'is-selected')}>
<input
className="cf-ns3__radio"
type="radio"
name={groupName}
value={option.value}
checked={selected}
onChange={() => setFrequency(option.value)}
/>
<span className="cf-ns3__dot" aria-hidden="true">
<Check size={12} strokeWidth={3} />
</span>
<span>
{option.label}
{option.hint ? <span className="cf-ns3__hint">{' \u00b7 ' + option.hint}</span> : null}
</span>
</label>
);
})}
</div>
</fieldset>
</div>
</div>
) : null}
<button
type="submit"
className={join(
'cf-ns3__btn',
state === 'hover' && 'is-hover',
state === 'active' && 'is-active',
pending && 'is-busy',
)}
disabled={isDisabled}
aria-busy={pending || undefined}
>
{pending ? (
<>
<Loader2 className="cf-ns3__spin" size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{busyLabel}</span>
</>
) : (
<span>{buttonLabel}</span>
)}
</button>
{hasFoot ? (
<div id={noteId} className="cf-ns3__foot">
{proof ? (
<p className="cf-ns3__proof">
<Users size={16} strokeWidth={2.5} aria-hidden="true" />
{proof}
</p>
) : null}
{privacy ? (
<p>
<Lock size={16} strokeWidth={2.5} aria-hidden="true" />
{privacy}
</p>
) : null}
</div>
) : null}
</form>
</div>
</section>
);
}
export default NewsletterSignup3;
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
function splitPhrase(text: string, phrase: string): [string, string, string] {
if (!phrase) return [text, '', ''];
const index = text.toLowerCase().indexOf(phrase.toLowerCase());
if (index < 0) return [text, '', ''];
return [text.slice(0, index), text.slice(index, index + phrase.length), text.slice(index + phrase.length)];
}
function fillCount(template: string, count: string) {
return template.split('{count}').join(count);
}
function join(...parts: Array<string | false | null | undefined>) {
return parts.filter(Boolean).join(' ');
}
const CSS = `
.cf-ns3 {
--ns3-shadow: var(--shadow, oklch(0.22 0.03 260));
--ns3-focus: var(--field-focus, var(--accent, oklch(0.5 0.17 257)));
--ns3-marker: var(--marker, #fae37c);
--ns3-bg: var(--button-bg, var(--cta, oklch(0.576 0.209 29.5)));
--ns3-bg2: var(--button-bg-2, var(--cta-2, oklch(0.506 0.206 29.5)));
container: cfns3 / inline-size;
box-sizing: border-box;
width: 100%;
padding: clamp(24px, 4vw, 40px) clamp(16px, 5vw, 48px);
color: var(--ink, oklch(0.21 0.034 263));
font-family: var(--font-body, system-ui, sans-serif);
}
.cf-ns3 *, .cf-ns3 *::before, .cf-ns3 *::after { box-sizing: border-box; }
.cf-ns3__inner {
max-width: 1120px;
margin: 0 auto;
padding-top: clamp(24px, 3vw, 32px);
border-top: 1px solid oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.14);
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 20px 48px;
align-items: start;
}
.cf-ns3__lede {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 16px;
align-items: center;
}
.cf-ns3__inner.has-media .cf-ns3__lede { grid-template-columns: 64px minmax(0, 1fr); }
.cf-ns3__media {
display: block;
width: 64px;
height: 64px;
object-fit: contain;
object-position: center;
filter: drop-shadow(0 2px 3px oklch(from var(--ns3-shadow) l c h / 0.28)) drop-shadow(0 10px 12px oklch(from var(--ns3-shadow) l c h / 0.18));
}
.cf-ns3__copy { min-width: 0; }
.cf-ns3__headline {
margin: 0;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.01em);
font-size: clamp(1.3125rem, 1.8vw, 1.625rem);
line-height: 1.15;
color: var(--ink, oklch(0.21 0.034 263));
text-wrap: balance;
}
.cf-ns3__mark {
color: inherit;
background-image: linear-gradient(
to bottom,
transparent 0 30%,
var(--ns3-marker) 30% 94%,
transparent 94%
);
padding: 0 0.14em;
margin: 0 -0.06em;
border-radius: 0.18em 0.32em 0.22em 0.28em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-ns3__next {
margin: 12px 0 0;
font-size: 0.9375rem;
font-weight: 500;
line-height: 1.4;
color: var(--muted, oklch(0.446 0.03 258));
text-wrap: pretty;
}
.cf-ns3__next strong { color: var(--ink, oklch(0.21 0.034 263)); font-weight: 800; }
.cf-ns3__form {
min-width: 0;
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'label' 'input' 'error' 'more' 'button' 'foot';
}
.cf-ns3__label {
grid-area: label;
margin-bottom: 8px;
font-size: 1rem;
font-weight: 700;
line-height: 1.25;
color: var(--label-ink, var(--ink, oklch(0.21 0.034 263)));
}
.cf-ns3__input {
grid-area: input;
width: 100%;
min-width: 0;
height: 56px;
margin: 0;
padding: 0 16px;
border: 1px solid var(--field-border, color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 22%, transparent));
border-radius: var(--field-radius, var(--radius, 12px));
background: var(--field, #ffffff);
color: var(--field-ink, oklch(0.21 0.034 263));
font-family: var(--font-body, inherit);
font-size: 1.0625rem;
font-weight: 500;
box-shadow: inset 0 1px 2px oklch(from var(--ns3-shadow) l c h / 0.08);
appearance: none;
transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.cf-ns3__input::placeholder {
color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 65%, var(--field, #ffffff));
opacity: 1;
}
.cf-ns3__input:hover:not(:disabled) { border-color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 40%, transparent); }
.cf-ns3__input:focus {
outline: none;
border-color: var(--ns3-focus);
box-shadow: 0 0 0 3px oklch(from var(--ns3-focus) l c h / 0.35);
}
.cf-ns3__input[aria-invalid='true'] { border-color: var(--danger, oklch(0.5 0.17 27)); }
.cf-ns3__input[aria-invalid='true']:focus { box-shadow: 0 0 0 3px oklch(from var(--danger, oklch(0.5 0.17 27)) l c h / 0.3); }
.cf-ns3__input:disabled {
cursor: not-allowed;
background: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 6%, var(--field, #ffffff));
color: color-mix(in oklch, var(--field-ink, oklch(0.21 0.034 263)) 70%, var(--field, #ffffff));
}
.cf-ns3__error {
grid-area: error;
margin: 8px 0 0;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--danger, oklch(0.5 0.17 27));
text-wrap: pretty;
}
.cf-ns3__error svg, .cf-ns3__foot svg {
display: inline-block;
vertical-align: -0.15em;
margin-inline-end: 0.4em;
}
.cf-ns3__more {
grid-area: more;
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cf-ns3.is-open .cf-ns3__more { grid-template-rows: 1fr; }
.cf-ns3__clip {
min-height: 0;
overflow: hidden;
margin: 0 -6px;
visibility: hidden;
transition: visibility 0s linear 0.32s;
}
.cf-ns3.is-open .cf-ns3__clip { visibility: visible; transition-delay: 0s; }
.cf-ns3__chips {
min-width: 0;
margin: 0;
padding: 12px 6px 6px;
border: 0;
opacity: 0.82;
transform: translateY(-8px);
transition: opacity 0.32s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cf-ns3.is-open .cf-ns3__chips { opacity: 1; transform: none; }
.cf-ns3__legend {
float: left;
width: 100%;
margin: 0 0 8px;
padding: 0;
font-size: 0.9375rem;
font-weight: 600;
line-height: 1.4;
color: var(--muted, oklch(0.446 0.03 258));
}
.cf-ns3__row { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.cf-ns3__chip {
position: relative;
display: inline-flex;
align-items: center;
gap: 8px;
min-height: 40px;
padding: 6px 16px 6px 10px;
border: 1px solid oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.14);
border-radius: 999px;
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 5%, var(--surface, #ffffff));
color: var(--ink, oklch(0.21 0.034 263));
font-size: 0.9375rem;
font-weight: 700;
line-height: 1.2;
cursor: pointer;
user-select: none;
transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cf-ns3__chip:hover {
background: color-mix(in oklch, var(--ink, oklch(0.21 0.034 263)) 9%, var(--surface, #ffffff));
border-color: oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.24);
}
.cf-ns3__chip:active { transform: translateY(1px); }
.cf-ns3__chip.is-selected {
background: color-mix(in oklch, var(--accent, oklch(0.5 0.17 257)) 12%, var(--surface, #ffffff));
border-color: oklch(from var(--accent, oklch(0.5 0.17 257)) l c h / 0.6);
box-shadow: var(--shadow-sm, 0 1px 2px oklch(from var(--ns3-shadow) l c h / 0.2));
}
.cf-ns3__chip:has(.cf-ns3__radio:focus-visible) {
outline: 3px solid oklch(from var(--ns3-focus) l c h / 0.5);
outline-offset: 2px;
}
.cf-ns3__radio {
position: absolute;
width: 1px;
height: 1px;
margin: 0;
opacity: 0;
pointer-events: none;
}
.cf-ns3__dot {
flex: none;
display: grid;
place-items: center;
width: 18px;
height: 18px;
border-radius: 50%;
border: 2px solid oklch(from var(--ink, oklch(0.21 0.034 263)) l c h / 0.32);
background: var(--card, #ffffff);
color: transparent;
transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.cf-ns3__chip.is-selected .cf-ns3__dot {
background: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
border-color: var(--accent-fill, var(--accent, oklch(0.5 0.17 257)));
color: var(--accent-fill-ink, var(--card, #ffffff));
}
.cf-ns3__hint { font-weight: 500; }
.cf-ns3__chips:disabled .cf-ns3__chip { cursor: not-allowed; color: var(--muted, oklch(0.446 0.03 258)); transform: none; }
.cf-ns3__btn {
grid-area: button;
margin: 12px 0 0;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
min-height: 56px;
padding: 0 28px;
border: 0;
border-radius: var(--button-radius, var(--radius, 12px));
background: linear-gradient(oklch(from var(--ns3-bg) calc(l + 0.04) c h), oklch(from var(--ns3-bg2) calc(l - 0.02) c h));
color: var(--button-ink, var(--cta-ink, #ffffff));
font-family: var(--button-font, var(--font-display, inherit));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.125rem, 1.4vw, 1.25rem);
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 var(--ns3-bg) calc(l + 0.14) c h / 0.7),
inset 0 -3px 0 oklch(from var(--ns3-bg) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--ns3-shadow) l c h / 0.3),
0 8px 16px -6px oklch(from var(--ns3-shadow) l c h / 0.35));
transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cf-ns3__btn:hover:not(:disabled), .cf-ns3__btn.is-hover:not(:disabled) {
background: linear-gradient(oklch(from var(--ns3-bg) calc(l - 0.01) c h), oklch(from var(--ns3-bg2) calc(l - 0.07) c h));
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--ns3-bg) calc(l + 0.12) c h / 0.7),
inset 0 -3px 0 oklch(from var(--ns3-bg) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--ns3-shadow) l c h / 0.34),
0 10px 18px -6px oklch(from var(--ns3-shadow) l c h / 0.42));
}
.cf-ns3__btn:active:not(:disabled), .cf-ns3__btn.is-active:not(:disabled) {
transform: translateY(1px);
background: linear-gradient(oklch(from var(--ns3-bg) calc(l - 0.05) c h), oklch(from var(--ns3-bg2) calc(l - 0.1) c h));
box-shadow:
inset 0 2px 3px oklch(from var(--ns3-bg) calc(l - 0.24) c h / 0.45),
inset 0 -2px 0 oklch(from var(--ns3-bg) calc(l - 0.18) c h),
0 1px 1px oklch(from var(--ns3-shadow) l c h / 0.25);
}
.cf-ns3__btn:focus-visible {
outline: 3px solid oklch(from var(--ns3-focus) l c h / 0.55);
outline-offset: 3px;
}
.cf-ns3__btn.is-busy { cursor: progress; }
.cf-ns3__btn:disabled {
cursor: not-allowed;
background: var(--secondary, oklch(0.93 0.015 263));
color: var(--muted, oklch(0.446 0.03 258));
text-shadow: none;
box-shadow: none;
transform: none;
}
.cf-ns3__spin { animation: cf-ns3-spin 0.8s linear infinite; }
@keyframes cf-ns3-spin { to { transform: rotate(360deg); } }
.cf-ns3__foot {
grid-area: foot;
margin: 12px 0 0;
display: flex;
flex-wrap: wrap;
gap: 4px 20px;
font-size: 0.9375rem;
font-weight: 500;
line-height: 1.4;
color: var(--muted, oklch(0.446 0.03 258));
}
.cf-ns3__foot p { margin: 0; text-wrap: pretty; }
.cf-ns3__proof { color: var(--ink, oklch(0.21 0.034 263)); font-weight: 600; }
@container cfns3 (max-width: 599px) {
.cf-ns3__btn {
min-height: 60px;
padding: 0 16px;
font-size: 1.0625rem;
}
}
@container cfns3 (min-width: 600px) {
.cf-ns3__form {
grid-template-columns: minmax(12rem, 1fr) auto;
column-gap: 12px;
grid-template-areas: 'label label' 'input button' 'error error' 'more more' 'foot foot';
}
.cf-ns3__btn { margin-top: 0; width: auto; white-space: nowrap; }
}
@container cfns3 (min-width: 900px) {
.cf-ns3__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 600px); }
.cf-ns3__inner.has-media .cf-ns3__lede { grid-template-columns: 88px minmax(0, 1fr); gap: 20px; }
.cf-ns3__media { width: 88px; height: 88px; }
}
@media (pointer: coarse) {
.cf-ns3__chip { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
.cf-ns3__more, .cf-ns3__clip, .cf-ns3__chips, .cf-ns3__chip, .cf-ns3__dot, .cf-ns3__btn, .cf-ns3__input { transition: none; }
.cf-ns3__chips { opacity: 1; transform: none; }
.cf-ns3__chip:active, .cf-ns3__btn:active:not(:disabled), .cf-ns3__btn.is-active:not(:disabled) { transform: none; }
.cf-ns3__spin { animation: none; }
}
`;
pieces/forms/newsletter-signup-3/specimen.tsx 42 lines
import __studioImagefea9e9fa from "../assets/84225213b4f7efd9.webp";
import * as React from 'react';
import { NewsletterSignup3 } from '../newsletter-signup-3';
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 NewsletterSignup3Specimen({ state = 'default' }: { state?: SpecimenState }) {
return (
<NewsletterSignup3
key={state}
state={state}
headline="Liked this? The next recipe lands Thursday"
highlight="lands Thursday"
nextLabel="Next up:"
nextTitle="Ginger-scallion noodles in 15 minutes"
productImage={slot(
'product',
__studioImagefea9e9fa,
)}
productAlt="A bowl of ginger-scallion noodles topped with sliced green onions"
emailLabel="Your email"
emailPlaceholder="you@example.com"
buttonLabel="Send me Thursday's recipe"
busyLabel={'Saving your spot\u2026'}
frequencyLegend="How often should it land?"
frequencies={[
{ value: 'every-recipe', label: 'Every recipe', hint: 'Mon & Thu' },
{ value: 'weekly-roundup', label: 'Weekly roundup', hint: 'Sundays' },
]}
readerCount="9,200"
readerTemplate="Join {count} home cooks who get Weeknight Wok."
privacy={defaults.sample.registration.privacy}
requiredError="Enter your email so we know where to send the recipe."
defaultOpen={state === 'hover' || state === 'active' || state === 'error'}
defaultEmail={state === 'error' ? 'dana@example' : ''}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalNewsletterSignup3 |
string |
Default 'Liked this? Get the next one in your inbox'
|
highlight OptionalNewsletterSignup3 |
string |
Default 'the next one'
|
nextLabel OptionalNewsletterSignup3 |
string |
Default 'Next up:'
|
nextTitle OptionalNewsletterSignup3 |
string |
Default ''
|
productImage OptionalNewsletterSignup3 |
string |
Default ''
|
productAlt OptionalNewsletterSignup3 |
string |
Default ''
|
emailLabel OptionalNewsletterSignup3 |
string |
Default 'Your email'
|
emailPlaceholder OptionalNewsletterSignup3 |
string |
Default 'you@example.com'
|
buttonLabel OptionalNewsletterSignup3 |
string |
Default 'Send me the next one'
|
busyLabel OptionalNewsletterSignup3 |
string |
Default 'Signing you up\u2026'
|
frequencyLegend OptionalNewsletterSignup3 |
string |
Default 'How often should it land?'
|
frequencies OptionalNewsletterSignup3 |
NewsletterSignup3Frequency[] |
Default DEFAULT_FREQUENCIES
|
defaultFrequency OptionalNewsletterSignup3 |
string |
Default ''
|
defaultOpen OptionalNewsletterSignup3 |
boolean |
Default false
|
privacy OptionalNewsletterSignup3 |
string |
Default 'We respect your inbox. Unsubscribe anytime.'
|
readerCount OptionalNewsletterSignup3 |
string |
Default ''
|
readerTemplate OptionalNewsletterSignup3 |
string |
Default 'Join {count} readers.'
|
requiredError OptionalNewsletterSignup3 |
string |
Default 'Enter your email so we know where to send it.'
|
invalidError OptionalNewsletterSignup3 |
string |
Default 'That email looks incomplete. Check it and try again.'
|
defaultEmail OptionalNewsletterSignup3 |
string |
Default ''
|
disabled OptionalNewsletterSignup3 |
boolean |
Default false
|
onSubmit OptionalNewsletterSignup3 |
(values: NewsletterSignup3Values) => void | Promise<unknown> |
|
state OptionalNewsletterSignup3 |
'default' | 'hover' | 'active' | 'disabled' | 'error' |
Default 'default'
|
className OptionalNewsletterSignup3 |
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.
--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).
-
84225213b4f7efd9.webp
image/webp · 112 KB
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB