Cheatsheet Opt-in 1
Cheat sheet opt-in: the one-page sheet sits tilted on a lit stage with its first checks readable and the rest faded, so the paper sells the email.
Use it in a prompt
Use hero/cheatsheet-optin from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/hero/cheatsheet-optin.tsx. - Import it and pass your copy and images (Props tab):
import { CheatsheetOptin } from "@/components/funneldna/hero/cheatsheet-optin"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/cheatsheet-optin/component.tsx 520 lines
// layout: product-stage
// Cheat sheet opt-in: the one-page sheet sits tilted on a lit stage with its first checks readable and the rest faded, so the paper sells the email.
import * as React from "react";
import { AlertCircle, Check, Loader2, Lock } from "lucide-react";
export type CheatsheetOptinField = {
name: string;
label: string;
type?: string;
/** Example answer shown in the empty field; a sensible default is used per field type. */
placeholder?: string;
autoComplete?: string;
/** Defaults to true. */
required?: boolean;
};
export type CheatsheetOptinSection = {
/** Red printed-letter subhead on the sheet. */
title: string;
items: { title: string; detail?: string }[];
};
export type CheatsheetOptinNote = { title: string; body: string };
export type CheatsheetOptinProps = {
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
lead?: string;
/** Use "h2" when the piece is not the page's first screen. */
headingLevel?: "h1" | "h2";
/** Name printed on the sheet. */
sheetTitle?: string;
sheetMeta?: string;
/** Small flag on the sheet header, e.g. "Free PDF". */
sheetFlag?: string;
sections?: CheatsheetOptinSection[];
/** How many checks stay readable; the rest fade out. */
visibleItems?: number;
/** Line under the faded part. {count} is replaced by the number of hidden checks. */
moreLabel?: string;
/** Fascination notes set either side of the sheet. */
notes?: CheatsheetOptinNote[];
fields?: CheatsheetOptinField[];
buttonLabel?: string;
loadingLabel?: string;
privacy?: string;
copy?: {
required?: string;
invalidEmail?: string;
/** {title} is replaced by the sheet title. */
previewLabel?: string;
formLabel?: string;
};
/** Receives the validated, trimmed values. The builder wires what happens next. */
onSubmit?: (values: Record<string, string>) => void | Promise<void>;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
const DEFAULT_SECTIONS: CheatsheetOptinSection[] = [
{
title: "Before you hit publish",
items: [
{ title: "Click every button yourself", detail: "Each one opens the right page on phone and desktop." },
{ title: "Send yourself a test lead", detail: "Fill in the form and make sure the email arrives." },
{ title: "Read your headline out loud", detail: "If it needs a second read, rewrite it." },
],
},
{
title: "Your thank-you page",
items: [
{ title: "Say what happens next", detail: "One clear next step, not five." },
{ title: "Check the download link", detail: "It opens before you send any traffic." },
],
},
{
title: "Your first follow-ups",
items: [
{ title: "Write the welcome email", detail: "Deliver the gift and set expectations." },
{ title: "Schedule the next two emails", detail: "So new leads hear from you this week." },
{ title: "Test the unsubscribe link", detail: "Keep your list clean from day one." },
],
},
];
const DEFAULT_NOTES: CheatsheetOptinNote[] = [
{ title: "The test most launches skip", body: "Why you should become your own first lead before anyone else opts in." },
{ title: "The read-aloud headline check", body: "A quick test that tells you whether your promise lands on the first read." },
{ title: "The thank-you page fix", body: "What to say right after they opt in, so they take the next step." },
{ title: "The follow-up you need first", body: "Which email to have ready before your funnel goes live." },
];
const DEFAULT_FIELDS: CheatsheetOptinField[] = [
{ name: "email", label: "Your best email", type: "email", autoComplete: "email" },
];
const DEFAULT_COPY = {
required: "Fill this in so we can send your checklist.",
invalidEmail: "Check your email address, like you@example.com.",
previewLabel: "Preview of the {title}",
formLabel: "Get the checklist",
};
export function CheatsheetOptin(props: CheatsheetOptinProps) {
const {
headline = "Launch your first funnel with nothing left to chance",
highlight = "nothing left to chance",
lead = "Work down this one-page checklist before you hit publish and catch the broken links, lost leads and missing follow-ups before your visitors do.",
headingLevel = "h1",
sheetTitle = "Launch Checklist",
sheetMeta = "One page \u00b7 Print it and check it off",
sheetFlag = "Free PDF",
sections = DEFAULT_SECTIONS,
visibleItems = 3,
moreLabel = "{count} more checks waiting on the full sheet",
notes = DEFAULT_NOTES,
fields = DEFAULT_FIELDS,
buttonLabel = "Send Me The Checklist",
loadingLabel = "Sending\u2026",
privacy = "Free PDF. We respect your inbox. Unsubscribe anytime.",
onSubmit,
state = "default",
className,
} = props;
const copy = { ...DEFAULT_COPY, ...props.copy };
const uid = React.useId();
const disabled = state === "disabled";
const [values, setValues] = React.useState<Record<string, string>>(() => seedValues(fields, state === "error"));
const [errors, setErrors] = React.useState<Record<string, string>>(() =>
state === "error" ? validateAll(fields, seedValues(fields, true), copy) : {},
);
const [busy, setBusy] = React.useState(false);
const mounted = React.useRef(true);
React.useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
React.useEffect(() => {
const next = seedValues(fields, state === "error");
setValues(next);
setErrors(state === "error" ? validateAll(fields, next, copy) : {});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [state]);
const { shown, hidden, remaining } = splitSheet(sections, visibleItems);
const emailField = fields.find((f) => f.type === "email");
const ticked = !!emailField && isEmail((values[emailField.name] || "").trim());
const half = Math.ceil(notes.length / 2);
const leftNotes = notes.slice(0, half);
const rightNotes = notes.slice(half);
const Heading = headingLevel === "h2" ? "h2" : "h1";
function update(field: CheatsheetOptinField, value: string) {
setValues((v) => ({ ...v, [field.name]: value }));
if (errors[field.name]) {
const msg = checkField(field, value, copy);
setErrors((e) => withError(e, field.name, msg));
}
}
function blur(field: CheatsheetOptinField) {
const value = values[field.name] || "";
if (!value.trim()) return;
setErrors((e) => withError(e, field.name, checkField(field, value, copy)));
}
async function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (disabled || busy) return;
const next = validateAll(fields, values, copy);
setErrors(next);
const firstBad = fields.find((f) => next[f.name]);
if (firstBad) {
event.currentTarget.querySelector<HTMLInputElement>(`[name="${firstBad.name}"]`)?.focus();
return;
}
if (!onSubmit) return;
const clean: Record<string, string> = {};
fields.forEach((f) => {
clean[f.name] = (values[f.name] || "").trim();
});
setBusy(true);
try {
await onSubmit(clean);
} finally {
if (mounted.current) setBusy(false);
}
}
const btnClass = ["cso-btn", state === "hover" ? "is-hover" : "", state === "active" ? "is-active" : ""]
.filter(Boolean)
.join(" ");
return (
<div className={["cf-cheatsheet-optin", className].filter(Boolean).join(" ")}>
<style>{CSS}</style>
<div className="cso-head">
<Heading className="cso-title">{withMark(headline, highlight)}</Heading>
{lead ? <p className="cso-lead">{lead}</p> : null}
</div>
<div className="cso-stage">
{leftNotes.length ? (
<ul className="cso-notes cso-notes--left">
{leftNotes.map((n) => (
<li key={n.title}>
<p className="cso-note-title">{n.title}</p>
<p className="cso-note-body">{n.body}</p>
</li>
))}
</ul>
) : null}
<figure className="cso-sheet" aria-label={copy.previewLabel.replace("{title}", sheetTitle)}>
<div className="cso-tilt">
<div className="cso-paper">
<div className="cso-paper-head">
<div>
<p className="cso-paper-title">{sheetTitle}</p>
{sheetMeta ? <p className="cso-paper-meta">{sheetMeta}</p> : null}
</div>
{sheetFlag ? <span className="cso-flag">{sheetFlag}</span> : null}
</div>
<div className="cso-paper-body">
<SheetEntries entries={shown} ticked={ticked} />
{hidden.length ? (
<div className="cso-faded" aria-hidden="true">
<SheetEntries entries={hidden} ticked={false} />
</div>
) : null}
{remaining > 0 && moreLabel ? (
<p className="cso-more">
<Lock className="cso-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{moreLabel.replace("{count}", String(remaining))}
</p>
) : null}
</div>
</div>
</div>
</figure>
{rightNotes.length ? (
<ul className="cso-notes cso-notes--right">
{rightNotes.map((n) => (
<li key={n.title}>
<p className="cso-note-title">{n.title}</p>
<p className="cso-note-body">{n.body}</p>
</li>
))}
</ul>
) : null}
</div>
<form className="cso-form" noValidate onSubmit={handleSubmit} aria-label={copy.formLabel}>
<div className="cso-row" style={{ "--cso-cols": String(fields.length) } as React.CSSProperties}>
{fields.map((f) => {
const id = `${uid}-${f.name}`;
const errId = `${id}-error`;
const err = errors[f.name];
return (
<div className="cso-field" key={f.name}>
<label className="cso-label" htmlFor={id}>
{f.label}
</label>
<input
id={id}
name={f.name}
type={f.type || "text"}
className="cso-input"
placeholder={f.placeholder || placeholderFor(f)}
autoComplete={f.autoComplete}
inputMode={f.type === "email" ? "email" : undefined}
required={f.required !== false}
disabled={disabled}
value={values[f.name] ?? ""}
onChange={(e) => update(f, e.target.value)}
onBlur={() => blur(f)}
aria-invalid={err ? true : undefined}
aria-describedby={err ? errId : undefined}
/>
{err ? (
<p className="cso-error" id={errId}>
<AlertCircle className="cso-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{err}
</p>
) : null}
</div>
);
})}
<div className="cso-go">
<button
type="submit"
className={btnClass}
disabled={disabled}
aria-disabled={busy || undefined}
data-busy={busy || undefined}
>
{busy ? (
<>
<Loader2 className="cso-spin" size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{loadingLabel}</span>
</>
) : (
<span>{buttonLabel}</span>
)}
</button>
</div>
</div>
{privacy ? (
<p className="cso-privacy">
<Lock className="cso-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{privacy}
</p>
) : null}
</form>
</div>
);
}
export default CheatsheetOptin;
type Entry =
| { kind: "head"; text: string; key: string }
| { kind: "item"; title: string; detail?: string; key: string; first: boolean };
function SheetEntries({ entries, ticked }: { entries: Entry[]; ticked: boolean }) {
return (
<>
{entries.map((e) =>
e.kind === "head" ? (
<p key={e.key} className="cso-sub">
{e.text}
</p>
) : (
<div key={e.key} className="cso-item">
<span className={e.first && ticked ? "cso-box is-on" : "cso-box"} aria-hidden="true">
{e.first && ticked ? <Check size={14} strokeWidth={3} /> : null}
</span>
<span>
<span className="cso-item-title">{e.title}</span>
{e.detail ? <span className="cso-item-detail">{e.detail}</span> : null}
</span>
</div>
),
)}
</>
);
}
function splitSheet(sections: CheatsheetOptinSection[], visible: number) {
const shown: Entry[] = [];
const hidden: Entry[] = [];
let count = 0;
let total = 0;
sections.forEach((s, si) => {
(count >= visible ? hidden : shown).push({ kind: "head", text: s.title, key: `h${si}` });
s.items.forEach((it, ii) => {
total += 1;
const toShown = count < visible;
(toShown ? shown : hidden).push({ kind: "item", title: it.title, detail: it.detail, key: `i${si}-${ii}`, first: total === 1 });
if (toShown) count += 1;
});
});
return { shown, hidden, remaining: total - count };
}
function withMark(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const i = text.indexOf(phrase);
if (i < 0) return text;
return (
<>
{text.slice(0, i)}
<span className="cso-mark">{phrase}</span>
{text.slice(i + phrase.length)}
</>
);
}
function isEmail(v: string) {
const at = v.lastIndexOf("@");
if (at < 1 || v.includes(" ")) return false;
const domain = v.slice(at + 1);
const dot = domain.lastIndexOf(".");
return dot > 0 && dot < domain.length - 2;
}
function checkField(f: CheatsheetOptinField, value: string, copy: typeof DEFAULT_COPY) {
const v = value.trim();
if (!v) return f.required === false ? "" : copy.required;
if (f.type === "email" && !isEmail(v)) return copy.invalidEmail;
return "";
}
function validateAll(fields: CheatsheetOptinField[], values: Record<string, string>, copy: typeof DEFAULT_COPY) {
const out: Record<string, string> = {};
fields.forEach((f) => {
const msg = checkField(f, values[f.name] || "", copy);
if (msg) out[f.name] = msg;
});
return out;
}
function withError(errors: Record<string, string>, name: string, msg: string) {
const next = { ...errors };
if (msg) next[name] = msg;
else delete next[name];
return next;
}
function seedValues(fields: CheatsheetOptinField[], showError: boolean) {
const out: Record<string, string> = {};
fields.forEach((f) => {
out[f.name] = showError && f.type === "email" ? "jane@example" : "";
});
return out;
}
function placeholderFor(f: CheatsheetOptinField) {
const n = f.name.toLowerCase();
if (f.type === "email" || n.includes("email")) return "you@example.com";
if (f.type === "tel" || n.includes("phone")) return "(555) 123-4567";
if (n.includes("first")) return "Jane";
if (n.includes("name")) return "Jane Smith";
return "Type your answer here";
}
const CSS = `
.cf-cheatsheet-optin{--cso-subhead:var(--subhead-ink,var(--accent));--cso-shadow:var(--shadow,oklch(0.22 0.03 260));--cso-ease:cubic-bezier(.2,.7,.2,1);box-sizing:border-box;width:100%;max-width:1120px;margin-inline:auto;color:var(--ink);font-family:var(--font-body);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5}
.cf-cheatsheet-optin *,.cf-cheatsheet-optin *::before,.cf-cheatsheet-optin *::after{box-sizing:border-box}
.cf-cheatsheet-optin :where(h1,h2,p,ul,figure){margin:0;padding:0}
.cf-cheatsheet-optin .cso-head{max-width:58rem;margin-inline:auto;text-align:center;animation:cso-rise .45s var(--cso-ease) both}
.cf-cheatsheet-optin .cso-title{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;color:var(--ink);text-wrap:balance}
.cf-cheatsheet-optin .cso-mark{background-image:linear-gradient(color-mix(in oklch,var(--marker,#fae37c) 88%,transparent),color-mix(in oklch,var(--marker,#fae37c) 88%,transparent));background-repeat:no-repeat;background-size:100% .42em;background-position:0 88%;padding-inline:.06em;margin-inline:-.06em;border-radius:.12em .3em .18em .26em;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.cf-cheatsheet-optin .cso-lead{max-width:44rem;margin:16px auto 0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-cheatsheet-optin .cso-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,27rem) minmax(0,1fr);grid-template-areas:"left sheet right";column-gap:clamp(32px,4vw,56px);align-items:start;margin-top:clamp(24px,3.4vw,40px);overflow-x:clip}
.cf-cheatsheet-optin .cso-notes{display:grid;align-content:start;gap:32px;width:100%;max-width:18rem;padding-top:76px;list-style:none;text-align:left;animation:cso-rise .45s var(--cso-ease) .14s both}
.cf-cheatsheet-optin .cso-notes--left{grid-area:left;justify-self:end}
.cf-cheatsheet-optin .cso-notes--right{grid-area:right;justify-self:start;animation-delay:.21s}
.cf-cheatsheet-optin .cso-note-title{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--cso-subhead);text-wrap:balance}
.cf-cheatsheet-optin .cso-note-body{margin-top:8px;max-width:34ch;color:var(--ink);text-wrap:pretty}
.cf-cheatsheet-optin .cso-sheet{grid-area:sheet;position:relative;isolation:isolate;padding:12px 8px 32px;animation:cso-rise .45s var(--cso-ease) .07s both}
.cf-cheatsheet-optin .cso-sheet::after{content:"";position:absolute;left:12%;right:12%;bottom:12px;height:24px;z-index:-1;background:radial-gradient(closest-side,oklch(from var(--cso-shadow) l c h / .28),oklch(from var(--cso-shadow) l c h / 0));pointer-events:none}
.cf-cheatsheet-optin .cso-tilt{transform:rotate(-2deg);transform-origin:50% 40%;backface-visibility:hidden;transition:transform .35s var(--cso-ease)}
.cf-cheatsheet-optin .cso-paper{position:relative;overflow:hidden;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / .12));border-radius:min(var(--card-radius,var(--radius,14px)),10px);box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / .22),0 12px 24px -8px oklch(0.22 0.03 260 / .32)))}
.cf-cheatsheet-optin .cso-paper-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px clamp(20px,3vw,28px);background:var(--band);color:var(--band-ink)}
.cf-cheatsheet-optin .cso-paper-title{font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--band-ink);text-wrap:balance}
.cf-cheatsheet-optin .cso-paper-meta{margin-top:4px;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--band-ink)}
.cf-cheatsheet-optin .cso-flag{flex:none;display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));font-size:.875rem;line-height:1.2;font-weight:800;white-space:nowrap}
.cf-cheatsheet-optin .cso-paper-body{padding:4px clamp(20px,3vw,28px) clamp(20px,3vw,24px)}
.cf-cheatsheet-optin .cso-sub{margin:20px 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.25;color:var(--cso-subhead);text-wrap:balance}
.cf-cheatsheet-optin .cso-item{display:grid;grid-template-columns:20px minmax(0,1fr);gap:12px;align-items:start;padding-block:6px}
.cf-cheatsheet-optin .cso-box{display:grid;place-items:center;width:20px;height:20px;margin-top:2px;border:2px solid oklch(from var(--ink) l c h / .4);border-radius:5px;background:var(--card);transition:background-color .2s ease,border-color .2s ease}
.cf-cheatsheet-optin .cso-box.is-on{background:var(--success);border-color:var(--success);color:var(--cso-tick-ink,#fff);animation:cso-pop .3s var(--cso-ease) both}
.cf-cheatsheet-optin .cso-item-title{display:block;font-weight:700;line-height:1.3;color:var(--ink);text-wrap:pretty}
.cf-cheatsheet-optin .cso-item-detail{display:block;margin-top:2px;font-size:.9375rem;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-cheatsheet-optin .cso-faded{max-height:116px;overflow:hidden;-webkit-mask-image:linear-gradient(oklch(from var(--ink) l c h / .55),oklch(from var(--ink) l c h / 0) 92%);mask-image:linear-gradient(oklch(from var(--ink) l c h / .55),oklch(from var(--ink) l c h / 0) 92%);filter:blur(1.2px);user-select:none;pointer-events:none}
.cf-cheatsheet-optin .cso-more{margin-top:4px;padding:12px 16px;border-radius:10px;background:color-mix(in oklch,var(--ink) 5%,var(--card));text-align:center;font-size:.9375rem;line-height:1.4;font-weight:700;color:var(--ink);text-wrap:pretty}
.cf-cheatsheet-optin .cso-more .cso-ico{color:var(--accent)}
.cf-cheatsheet-optin .cso-ico{display:inline-block;vertical-align:-.15em;margin-inline-end:.4em}
.cf-cheatsheet-optin .cso-form{max-width:52rem;margin:clamp(24px,3vw,32px) auto 0;animation:cso-rise .45s var(--cso-ease) .28s both}
.cf-cheatsheet-optin .cso-row{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
.cf-cheatsheet-optin .cso-label{display:block;margin-bottom:8px;font-size:1.0625rem;line-height:20px;font-weight:700;color:var(--label-ink,var(--ink))}
.cf-cheatsheet-optin .cso-input{display:block;width:100%;min-height:56px;padding:0 16px;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:1.0625rem;font-weight:500;line-height:1.3;box-shadow:inset 0 1px 2px oklch(from var(--cso-shadow) l c h / .08);transition:border-color .16s ease,box-shadow .16s ease;appearance:none}
.cf-cheatsheet-optin .cso-input::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-cheatsheet-optin .cso-input:hover:not(:disabled){border-color:color-mix(in oklch,var(--ink) 40%,transparent)}
.cf-cheatsheet-optin .cso-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)}
.cf-cheatsheet-optin .cso-input[aria-invalid="true"]{border-color:var(--danger)}
.cf-cheatsheet-optin .cso-input[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-cheatsheet-optin .cso-input:disabled{background:color-mix(in oklch,var(--ink) 5%,var(--field));cursor:not-allowed}
.cf-cheatsheet-optin .cso-error{margin-top:8px;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-cheatsheet-optin .cso-btn{--cso-b:var(--button-bg,var(--cta));--cso-b2:var(--button-bg-2,var(--cta-2));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(--cso-b) calc(l + .04) c h),oklch(from var(--cso-b2) 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;white-space:nowrap;text-shadow:var(--button-text-shadow,none);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--cso-b) calc(l + .14) c h / .7),inset 0 -3px 0 oklch(from var(--cso-b) calc(l - .16) c h),0 1px 2px oklch(from var(--cso-shadow) l c h / .3),0 8px 16px -6px oklch(from var(--cso-shadow) l c h / .45));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-cheatsheet-optin .cso-btn:hover:not(:disabled),.cf-cheatsheet-optin .cso-btn.is-hover:not(:disabled){background:linear-gradient(oklch(from var(--cso-b) calc(l - .01) c h),oklch(from var(--cso-b2) calc(l - .07) c h));transform:translateY(-1px);box-shadow:inset 0 1px 0 oklch(from var(--cso-b) calc(l + .12) c h / .6),inset 0 -3px 0 oklch(from var(--cso-b) calc(l - .18) c h),0 2px 3px oklch(from var(--cso-shadow) l c h / .32),0 12px 20px -6px oklch(from var(--cso-shadow) l c h / .5)}
.cf-cheatsheet-optin .cso-btn:active:not(:disabled),.cf-cheatsheet-optin .cso-btn.is-active:not(:disabled){background:linear-gradient(oklch(from var(--cso-b) calc(l - .06) c h),oklch(from var(--cso-b2) calc(l - .08) c h));transform:translateY(1px);box-shadow:inset 0 2px 4px oklch(from var(--cso-b) calc(l - .22) c h / .55),inset 0 -2px 0 oklch(from var(--cso-b) calc(l - .16) c h),0 1px 1px oklch(from var(--cso-shadow) l c h / .3)}
.cf-cheatsheet-optin .cso-btn:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .6);outline-offset:3px}
.cf-cheatsheet-optin .cso-btn:disabled{background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));box-shadow:none;text-shadow:none;cursor:not-allowed;transform:none}
.cf-cheatsheet-optin .cso-btn[data-busy]{cursor:progress}
.cf-cheatsheet-optin .cso-spin{animation:cso-spin .8s linear infinite}
.cf-cheatsheet-optin .cso-privacy{margin-top:16px;text-align:center;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
@media (min-width:760px){
.cf-cheatsheet-optin .cso-row{grid-template-columns:repeat(var(--cso-cols,1),minmax(0,1fr)) auto;align-items:start}
.cf-cheatsheet-optin .cso-go{padding-top:28px}
}
@media (max-width:980px){
.cf-cheatsheet-optin .cso-stage{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"sheet sheet" "left right";row-gap:24px}
.cf-cheatsheet-optin .cso-sheet{justify-self:center;width:min(100%,27rem)}
.cf-cheatsheet-optin .cso-notes{gap:24px;padding-top:0;max-width:none;justify-self:stretch}
}
@media (max-width:600px){
.cf-cheatsheet-optin .cso-stage{grid-template-columns:minmax(0,1fr);grid-template-areas:"sheet" "left" "right";row-gap:20px}
.cf-cheatsheet-optin .cso-notes{gap:20px}
.cf-cheatsheet-optin .cso-sheet{padding:12px 10px 28px}
.cf-cheatsheet-optin .cso-tilt{transform:rotate(-1.5deg)}
.cf-cheatsheet-optin .cso-btn{white-space:normal;text-wrap:balance;padding:12px 24px}
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
.cf-cheatsheet-optin .cso-sheet:hover .cso-tilt{transform:rotate(-0.75deg) translateY(-4px)}
}
@keyframes cso-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cso-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@keyframes cso-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
.cf-cheatsheet-optin .cso-head,.cf-cheatsheet-optin .cso-sheet,.cf-cheatsheet-optin .cso-notes,.cf-cheatsheet-optin .cso-form,.cf-cheatsheet-optin .cso-box.is-on,.cf-cheatsheet-optin .cso-spin{animation:none}
.cf-cheatsheet-optin .cso-tilt,.cf-cheatsheet-optin .cso-btn,.cf-cheatsheet-optin .cso-input,.cf-cheatsheet-optin .cso-box{transition:none}
.cf-cheatsheet-optin .cso-btn:hover:not(:disabled),.cf-cheatsheet-optin .cso-btn.is-hover:not(:disabled),.cf-cheatsheet-optin .cso-btn:active:not(:disabled),.cf-cheatsheet-optin .cso-btn.is-active:not(:disabled){transform:none}
}
`;
pieces/hero/cheatsheet-optin/specimen.tsx 16 lines
import defaults from "../../studio-defaults.json";
import { CheatsheetOptin, type CheatsheetOptinProps } from "../cheatsheet-optin";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function CheatsheetOptinSpecimen({ state }: { state?: CheatsheetOptinProps["state"] }) {
const sample = defaults.sample;
return (
<CheatsheetOptin
state={state}
sheetTitle={sample.items[2].name}
fields={sample.fields}
privacy={`Free PDF. ${sample.registration.privacy}`}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalCheatsheetOptin |
string |
|
highlight OptionalCheatsheetOptin |
string |
|
lead OptionalCheatsheetOptin |
string |
|
headingLevel OptionalCheatsheetOptin |
"h1" | "h2" |
|
sheetTitle OptionalCheatsheetOptin |
string |
|
sheetMeta OptionalCheatsheetOptin |
string |
|
sheetFlag OptionalCheatsheetOptin |
string |
|
sections OptionalCheatsheetOptin |
CheatsheetOptinSection[] |
|
visibleItems OptionalCheatsheetOptin |
number |
|
moreLabel OptionalCheatsheetOptin |
string |
|
notes OptionalCheatsheetOptin |
CheatsheetOptinNote[] |
|
fields OptionalCheatsheetOptin |
CheatsheetOptinField[] |
|
buttonLabel OptionalCheatsheetOptin |
string |
|
loadingLabel OptionalCheatsheetOptin |
string |
|
privacy OptionalCheatsheetOptin |
string |
|
copy OptionalCheatsheetOptin |
{
required?: string;
invalidEmail?: string;
/** {title} is replaced by the sheet title. */
previewLabel?: string;
formLabel?: string;
} |
|
onSubmit OptionalCheatsheetOptin |
(values: Record<string, string>) => void | Promise<void> |
|
state OptionalCheatsheetOptin |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalCheatsheetOptin |
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- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB