Application Form 1
Qualifies applicants with two short questions and passes their checked answers to your submit handler.
Use it in a prompt
Use kit/application-form 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/kit/application-form.tsx. - Import it and pass your copy and images (Props tab):
import { ApplicationForm } from "@/components/funneldna/kit/application-form"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/kit/application-form/component.tsx 261 lines
// pages: application
// Qualifies applicants with two short questions and passes their checked answers to your submit handler.
import { useEffect, useId, useRef, useState } from "react";
import type { FormEvent, ReactNode } from "react";
import { kitText } from "./core";
import { AlertCircle, Check, PencilLine } from "lucide-react";
export type ApplicationFormProps = {
title?: ReactNode;
question?: string;
options?: { label: string; text?: string; key?: string }[];
detailQuestion?: string;
submitLabel?: string;
/** Deprecated: ignored. The builder wires what happens after the action. */
confirmation?: ReactNode;
/** "success" is accepted for older callers and renders as "default". */
state?: "default" | "error" | "success";
eyebrow?: string;
intro?: string;
questionHint?: string;
detailHint?: string;
detailPlaceholder?: string;
nextLabel?: string;
/** Three progress labels, in situation, goal and confirmation order. */
steps?: { label: string; hint: string }[];
/** Receives the selected situation and trimmed goal after both answers validate. */
onSubmit?: (values: { situation: string; goal: string }) => void;
/** Question template replaces {number} and {total} as plain text. */
copy?: Partial<typeof APPLICATION_FORM_COPY>;
className?: string;
};
export function ApplicationForm({
title = "Tell us where your funnel is", question = "Where are you with your funnel?",
options = APPLICATION_FORM_OPTIONS,
detailQuestion = "What are you offering, and which part of your funnel do you want to work through?",
submitLabel = "Send My Application",
state = "default", eyebrow = "Application", intro = "Two short questions, then you’re done.",
questionHint = "Pick the one that fits best.", detailHint = "A sentence or two is plenty.",
detailPlaceholder, nextLabel = "Next: Your Goal", steps = APPLICATION_FORM_STEPS,
onSubmit, copy: copyOverrides, className,
}: ApplicationFormProps) {
const copy = { ...APPLICATION_FORM_COPY, ...copyOverrides };
const focusFrame = useRef(0);
useEffect(() => () => cancelAnimationFrame(focusFrame.current), []);
function focus(target: string) {
cancelAnimationFrame(focusFrame.current);
focusFrame.current = requestAnimationFrame(() => document.getElementById(target)?.focus());
}
const id = useId();
const [step, setStep] = useState(0);
const [choice, setChoice] = useState<number | null>(null);
const [detail, setDetail] = useState("");
const [error, setError] = useState(state === "error" ? copy.choiceError : "");
useEffect(() => {
setStep(0);
setChoice(null);
setDetail("");
setError(state === "error" ? copy.choiceError : "");
}, [state]);
function move(next: number) {
setError("");
setStep(next);
focus(`${id}-step-${next}`);
}
function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault();
event.stopPropagation();
if (step === 0) {
if (choice === null) { setError(copy.choiceError); document.getElementById(`${id}-choice-0`)?.focus(); return; }
move(1);
return;
}
if (!detail.trim()) { setError(copy.detailError); document.getElementById(`${id}-detail`)?.focus(); return; }
setError("");
onSubmit?.({ situation: options[choice!].label, goal: detail.trim() });
}
if (!options.length) return null;
const current = step;
const picked = choice !== null ? options[choice] : null;
const hint = step === 0 ? questionHint : detailHint;
const described = [hint ? `${id}-help` : "", error ? `${id}-error` : ""].filter(Boolean).join(" ") || undefined;
return (
<form noValidate aria-labelledby={`${id}-title`} onSubmit={submit} className={["cf-application-form", className].filter(Boolean).join(" ")}>
<style>{AF_CSS}</style>
<div className="af-rail">
<div className="af-head">
{eyebrow && <p className="af-eyebrow">{kitText(eyebrow)}</p>}
<h2 id={`${id}-title`} className="af-title">{title}</h2>
{intro && <p className="af-note">{kitText(intro)}</p>}
</div>
<ol aria-label={copy.progressLabel} className="af-steps">
{steps.map((s, i) => {
const st = i < current ? "done" : i === current ? "active" : "todo";
return (
<li key={s.label} data-s={st} aria-current={i === current ? "step" : undefined} className="af-st">
<span aria-hidden className="af-node">{st === "done" ? <Check size={16} strokeWidth={3} /> : i + 1}</span>
<span className="af-st-text">
<span className="af-st-label">{s.label}</span>
<span aria-hidden className="af-st-hint">{s.hint}</span>
</span>
<span className="af-sr">{st === "done" ? copy.doneStatus : i === current ? copy.currentStatus : ""}</span>
</li>
);
})}
</ol>
</div>
<div className="af-panel">
<>
<div key={step} className="af-body af-in">
{step === 1 && picked && (
<div className="af-recap">
<span aria-hidden className="af-recap-ic"><Check size={15} strokeWidth={3} /></span>
<span className="af-recap-t"><span>{copy.situationLabel}</span><strong>{kitText(picked.label)}</strong></span>
<button type="button" className="af-change" onClick={() => move(0)}><PencilLine aria-hidden size={16} strokeWidth={2.5} />{copy.changeLabel}<span className="af-sr">{copy.changeSuffix}</span></button>
</div>
)}
<p className="af-kicker"><span aria-hidden className="af-meter"><i data-on="" /><i data-on={step === 1 ? "" : undefined} /></span>{copy.questionTemplate.replaceAll("{number}", String(step + 1)).replaceAll("{total}", "2")}</p>
<fieldset className="af-fs">
<legend id={`${id}-step-${step}`} tabIndex={-1} className="af-q">{step === 0 ? question : detailQuestion}</legend>
{hint && <p id={`${id}-help`} className="af-help">{kitText(hint)}</p>}
{step === 0 ? (
<div className="af-opts">
{options.map((option, i) => {
const on = choice === i;
return (
<label key={i} htmlFor={`${id}-choice-${i}`} data-on={on ? "" : undefined} data-err={error && !on ? "" : undefined} className="af-opt">
<input id={`${id}-choice-${i}`} type="radio" name={`${id}-situation`} value={i} checked={on} aria-invalid={error ? true : undefined} aria-describedby={described} onChange={() => { setChoice(i); setError(""); }} className="af-sr" />
<span aria-hidden className="af-key"><span className="af-k-letter">{option.key ?? String.fromCharCode(65 + i)}</span><Check className="af-k-check" size={18} strokeWidth={3} /></span>
<span className="af-opt-t"><strong>{kitText(option.label)}</strong>{option.text && <span>{kitText(option.text)}</span>}</span>
<span aria-hidden className="af-radio"><Check size={14} strokeWidth={3.5} /></span>
</label>
);
})}
</div>
) : (
<textarea id={`${id}-detail`} name="goal" rows={5} value={detail} placeholder={detailPlaceholder} aria-labelledby={`${id}-step-1`} aria-invalid={error ? true : undefined} aria-describedby={described} onChange={(event) => { setDetail(event.target.value); if (error) setError(""); }} className="af-ta" />
)}
{error && <p id={`${id}-error`} role="alert" className="af-err"><AlertCircle aria-hidden size={20} strokeWidth={2.5} />{error}</p>}
</fieldset>
</div>
<div className="af-actions">
{step > 0 && <button type="button" onClick={() => move(0)} className="af-back"><span>{copy.backLabel}</span></button>}
<button type="submit" className="af-cta"><span>{step === 0 ? kitText(nextLabel) : kitText(submitLabel)}</span></button>
</div>
</>
</div>
</form>
);
}
export default ApplicationForm;
const APPLICATION_FORM_STEPS = [
{ label: "Situation", hint: "Where you are now" },
{ label: "Goal", hint: "What you want to work on" },
{ label: "Done", hint: "Application sent" },
];
const APPLICATION_FORM_OPTIONS = [
{ label: "Just getting started", text: "I'm still shaping my offer." },
{ label: "Planning my pages", text: "I know my offer and need the page plan." },
{ label: "Ready to review my draft", text: "I have a page draft to work through." },
];
const APPLICATION_FORM_COPY = {
choiceError: "Pick one to continue.", detailError: "Add a few words about your goal.",
progressLabel: "Application progress", doneStatus: " (done)", currentStatus: " (current step)",
completeTitle: "Application complete", situationLabel: "Your situation", goalLabel: "Your goal",
changeLabel: "Change", changeSuffix: " your situation", backLabel: "Back",
questionTemplate: "Question {number} of {total}",
};
// Shadows and action shading follow the theme palette.
const AF_CSS = `
.cf-application-form{--af-surface:var(--card);--af-ink:var(--ink,#101828);--af-muted:var(--muted);--af-band:var(--band,#0f2747);--af-band-ink:var(--band-ink,#fff);--af-accent:var(--accent,#0f5fc2);--af-cta-top:var(--button-bg,var(--cta));--af-cta-bot:var(--button-bg-2,var(--cta-2));--af-edge:var(--button-bg-2,var(--cta-2));--af-cta-ink:var(--cta-ink,#fff);--af-ok:var(--success);--af-err:var(--danger);--af-line:oklch(from var(--ink) l c h / 0.18);--af-r:var(--radius,14px);position:relative;display:grid;width:100%;max-width:940px;margin-inline:auto;overflow:hidden;text-align:left;color:var(--af-ink);font-family:var(--font-body,inherit);background:var(--af-surface);border:1px solid oklch(from var(--af-band) l c h / 0.16);border-radius:var(--card-radius,calc(var(--af-r) + 6px));box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));}
.cf-application-form *,.cf-application-form *::before,.cf-application-form *::after{box-sizing:border-box}
@media (min-width:768px){.cf-application-form{grid-template-columns:300px minmax(0,1fr)}}
:where(.cf-application-form) .af-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;accent-color:var(--field-focus,var(--accent));}
.cf-application-form [tabindex='-1']:focus{outline:none}
:where(.cf-application-form) .af-rail{position:relative;isolation:isolate;display:flex;flex-direction:column;gap:24px;padding:24px 22px;background:var(--af-band);color:var(--af-band-ink)}
:where(.cf-application-form) .af-rail::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:none;background-size:18px 18px;-webkit-mask-image:linear-gradient(160deg,var(--ink) 0%,transparent 70%);mask-image:linear-gradient(160deg,var(--ink) 0%,transparent 70%)}
@media (min-width:640px){:where(.cf-application-form) .af-rail{padding:32px}}
@media (min-width:768px){:where(.cf-application-form) .af-rail{gap:40px;padding:44px 32px}}
:where(.cf-application-form) .af-head{display:flex;flex-direction:column;align-items:flex-start}
:where(.cf-application-form) .af-eyebrow{display:inline-flex;align-items:center;margin:0 0 14px;padding:6px 12px;border-radius:999px;border:1px solid oklch(from var(--af-band-ink) l c h / 0.22);background:var(--band);font-size:14px;font-weight:700;line-height:1.2;letter-spacing:.02em;color:var(--af-band-ink)}
:where(.cf-application-form) .af-title{margin:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.75rem,6.4vw,2.25rem);line-height:1.08;letter-spacing:var(--display-tracking,-.02em);text-wrap:balance;color:var(--af-band-ink);text-transform:var(--display-case,none)}
@media (min-width:768px){:where(.cf-application-form) .af-title{font-size:2.125rem}}
:where(.cf-application-form) .af-note{display:none;margin:14px 0 0;font-size:16px;line-height:1.55;color:var(--band-ink)}
@media (min-width:768px){:where(.cf-application-form) .af-note{display:block}}
:where(.cf-application-form) .af-steps{display:flex;margin:0;padding:0;list-style:none}
:where(.cf-application-form) .af-st{position:relative;display:flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:center;gap:10px;text-align:center}
:where(.cf-application-form) .af-st:not(:last-child)::after{content:'';position:absolute;top:15px;left:calc(50% + 24px);right:calc(-50% + 24px);height:2px;border-radius:2px;background:linear-gradient(var(--af-band-ink),var(--af-band-ink)) 0 0/0% 100% no-repeat,oklch(from var(--af-band-ink) l c h / 0.22)}
:where(.cf-application-form) .af-st[data-s=done]::after{background-size:100% 100%,auto}
:where(.cf-application-form) .af-node{position:relative;display:grid;flex:none;place-items:center;width:32px;height:32px;border-radius:999px;border:2px solid oklch(from var(--af-band-ink) l c h / 0.42);color:var(--band-ink);font-size:14px;font-weight:800;line-height:1}
:where(.cf-application-form) .af-st[data-s=active] .af-node{border-color:var(--af-band-ink);background:var(--af-band-ink);color:var(--af-band);box-shadow:0 0 0 5px oklch(from var(--af-band-ink) l c h / 0.16)}
:where(.cf-application-form) .af-st[data-s=done] .af-node{border-color:var(--success);background:var(--success-soft);color:var(--success)}
:where(.cf-application-form) .af-st-text{display:flex;min-width:0;flex-direction:column;gap:4px}
:where(.cf-application-form) .af-st-label{font-size:14px;font-weight:700;line-height:1.2;color:var(--band-ink)}
:where(.cf-application-form) .af-st[data-s=active] .af-st-label,:where(.cf-application-form) .af-st[data-s=done] .af-st-label{color:var(--af-band-ink)}
:where(.cf-application-form) .af-st-hint{display:none;font-size:14px;line-height:1.4;color:var(--band-ink)}
@media (min-width:768px){:where(.cf-application-form) .af-steps{flex-direction:column}:where(.cf-application-form) .af-st{flex:none;flex-direction:row;align-items:flex-start;gap:14px;padding-bottom:30px;text-align:left}:where(.cf-application-form) .af-st:last-child{padding-bottom:0}:where(.cf-application-form) .af-st:not(:last-child)::after{top:40px;bottom:8px;left:15px;right:auto;width:2px;height:auto;background-size:100% 0%,auto}:where(.cf-application-form) .af-st[data-s=done]::after{background-size:100% 100%,auto}:where(.cf-application-form) .af-st-text{padding-top:6px}:where(.cf-application-form) .af-st-label{font-size:16px}:where(.cf-application-form) .af-st-hint{display:block}}
:where(.cf-application-form) .af-panel{display:flex;min-width:0;flex-direction:column;gap:28px;padding:26px 22px 24px}
@media (min-width:640px){:where(.cf-application-form) .af-panel{padding:36px}}
@media (min-width:768px){:where(.cf-application-form) .af-panel{min-height:580px;padding:44px 44px 40px}}
:where(.cf-application-form) .af-body{min-width:0}
:where(.cf-application-form) .af-kicker{display:flex;align-items:center;gap:10px;margin:0 0 12px;font-size:14px;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase;color:var(--ink);}
:where(.cf-application-form) .af-meter{display:inline-flex;gap:4px}
:where(.cf-application-form) .af-meter i{display:block;width:22px;height:4px;border-radius:4px;background:oklch(from var(--accent-fill,var(--af-accent)) l c h / 0.2)}
:where(.cf-application-form) .af-meter i[data-on]{background:var(--accent-fill,var(--af-accent))}
:where(.cf-application-form) .af-fs{min-width:0;margin:0;padding:0;border:0}
:where(.cf-application-form) .af-q{float:left;width:100%;margin:0;padding:0;font-family:var(--font-display,inherit);font-weight:var(--display-weight,800);font-size:clamp(1.375rem,4.2vw,1.75rem);line-height:1.2;letter-spacing:var(--display-tracking,-.012em);text-wrap:balance;color:var(--label-ink,var(--ink));text-transform:var(--display-case,none)}
:where(.cf-application-form) .af-help{clear:both;margin:0;padding-top:10px;font-size:16px;line-height:1.5;color:var(--af-muted)}
:where(.cf-application-form) .af-opts{clear:both;display:flex;flex-direction:column;gap:12px;padding-top:20px}
:where(.cf-application-form) .af-opt{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:14px;min-height:68px;padding:14px 16px;border:1.5px solid var(--af-line);border-radius:var(--card-radius,var(--af-r));background:var(--af-surface);box-shadow:none;cursor:pointer;border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));}
@media (min-width:640px){:where(.cf-application-form) .af-opt{grid-template-columns:auto minmax(0,1fr) auto;gap:16px;padding:16px 18px 16px 16px}}
:where(.cf-application-form) .af-opt:hover{border-color:var(--card-border,oklch(from var(--ink) l c h / 0.36));box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-application-form) .af-opt:has(:focus-visible){outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
:where(.cf-application-form) .af-opt[data-err]{border-color:var(--af-err);background:var(--danger-soft)}
:where(.cf-application-form) .af-opt[data-on]{border-color:var(--success);background:var(--success-soft);box-shadow:var(--card-shadow, var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-application-form) .af-key{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:color-mix(in oklch,var(--af-band) 8%,var(--af-surface));box-shadow:inset 0 0 0 1px oklch(from var(--af-band) l c h / 0.12);color:var(--af-ink);font-size:15px;font-weight:800;line-height:1}
:where(.cf-application-form) .af-opt[data-on] .af-key{background:var(--success-soft);box-shadow:var(--shadow-sm, 0 1px 1px oklch(0.22 0.03 260 / 0.18), 0 1px 3px oklch(0.22 0.03 260 / 0.14));color:var(--success);}
:where(.cf-application-form) .af-k-check{display:none}
:where(.cf-application-form) .af-opt[data-on] .af-k-letter{display:none}
:where(.cf-application-form) .af-opt[data-on] .af-k-check{display:block}
@media (min-width:640px){:where(.cf-application-form) .af-opt[data-on] .af-k-letter{display:inline}:where(.cf-application-form) .af-opt[data-on] .af-k-check{display:none}}
:where(.cf-application-form) .af-opt-t{display:flex;min-width:0;flex-direction:column;gap:3px}
:where(.cf-application-form) .af-opt-t strong{font-size:18px;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink));}
:where(.cf-application-form) .af-opt-t span{font-size:16px;line-height:1.45;color:var(--af-muted)}
:where(.cf-application-form) .af-radio{display:none;place-items:center;width:24px;height:24px;border-radius:999px;border:2px solid oklch(from var(--af-ink) l c h / 0.28);background:var(--field);color:transparent;border-color:var(--field-border,oklch(from var(--ink) l c h / 0.22));}
@media (min-width:640px){:where(.cf-application-form) .af-radio{display:grid}}
:where(.cf-application-form) .af-opt[data-on] .af-radio{border-color:var(--success);background:var(--success-soft);color:var(--success);}
:where(.cf-application-form) .af-err{display:flex;align-items:center;gap:8px;margin:14px 0 0;font-size:16px;font-weight:700;line-height:1.35;color:var(--af-err)}
:where(.cf-application-form) .af-recap{display:flex;align-items:center;gap:12px;margin:0 0 24px;padding:10px 8px 10px 12px;border-radius:var(--card-radius,var(--af-r));background:color-mix(in oklch,var(--af-band) 5%,var(--af-surface));border:1px solid oklch(from var(--af-band) l c h / 0.12);border-color:var(--card-border,oklch(from var(--ink) l c h / 0.12));}
:where(.cf-application-form) .af-recap-ic{display:grid;flex:none;place-items:center;width:28px;height:28px;border-radius:999px;background:var(--success-soft);color:var(--success)}
:where(.cf-application-form) .af-recap-t{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}
:where(.cf-application-form) .af-recap-t span{font-size:14px;line-height:1.3;color:var(--af-muted)}
:where(.cf-application-form) .af-recap-t strong{font-size:16px;font-weight:700;line-height:1.3;color:var(--af-ink);overflow-wrap:anywhere}
:where(.cf-application-form) .af-change{display:inline-flex;flex:none;align-items:center;gap:6px;min-height:40px;padding:0 12px;border:0;border-radius:var(--button-radius,var(--radius,14px));background:var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260)));color:var(--button-2-ink, var(--secondary-ink, var(--ink)));font:inherit;font-size:15px;font-weight:var(--button-weight,800);line-height:1;cursor:pointer;border-color:var(--button-2-border, transparent);font-family:var(--button-font,var(--font-display));text-transform:var(--button-case,none);box-shadow:var(--button-2-shadow, var(--shadow-sm));}
:where(.cf-application-form) .af-change:hover{background:oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260))) calc(l - 0.03) c h);border-color:var(--button-2-border, transparent);box-shadow:var(--button-2-shadow, var(--shadow-sm));}
:where(.cf-application-form) .af-change:focus-visible{outline:3px solid var(--af-accent);outline-offset:2px}
:where(.cf-application-form) .af-ta{clear:both;display:block;width:100%;min-height:150px;margin-top:20px;padding:16px 18px;resize:vertical;border:1.5px solid var(--af-line);border-radius:var(--field-radius,var(--radius,14px));background:var(--field,#ffffff);color:var(--field-ink,#101828);font:inherit;font-size:18px;line-height:1.55;box-shadow:inset 0 1px 3px oklch(from var(--surface) min(0.25,calc(l - 0.12)) c h / .07);border-color:var(--field-border,oklch(from var(--ink) l c h / 0.22));}
:where(.cf-application-form) .af-ta::placeholder{color:color-mix(in oklch, var(--field-ink) 65%, var(--field));opacity:1}
:where(.cf-application-form) .af-ta:hover{border-color:var(--field-border,oklch(from var(--ink) l c h / 0.36));}
:where(.cf-application-form) .af-ta:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:inset 0 1px 3px oklch(from var(--surface) min(0.25,calc(l - 0.12)) c h / .07),0 0 0 4px oklch(from var(--field-focus,var(--accent)) l c h / 0.18);}
:where(.cf-application-form) .af-ta[aria-invalid=true]{border-color:var(--af-err)}
:where(.cf-application-form) .af-ta[aria-invalid=true]:focus{box-shadow:inset 0 1px 3px oklch(from var(--field) calc(l - 0.12) c h / 0.07),0 0 0 4px var(--danger-soft)}
:where(.cf-application-form) .af-actions{display:flex;flex-direction:column-reverse;gap:12px;margin-top:auto}
@media (min-width:640px){:where(.cf-application-form) .af-actions{flex-direction:row;align-items:stretch;gap:14px}}
:where(.cf-application-form) .af-cta{position:relative;display:inline-flex;flex:1 1 auto;align-items:center;justify-content:center;width:100%;min-height:62px;padding:16px 48px;border:1px solid var(--af-edge);border-radius:var(--button-radius,var(--af-r));background:linear-gradient(180deg,oklch(from var(--button-bg,var(--cta)) l c h),oklch(from var(--button-bg,var(--cta)) calc(l - 0.05) c h));color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow, 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.2) c h / 0.75));font:inherit;font-size:18px;font-weight:var(--button-weight,800);line-height:1.15;text-wrap:balance;cursor:pointer;box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));border-color:var(--button-bg-2,var(--cta-2));font-family:var(--button-font,var(--font-display));text-transform:var(--button-case,none);}
:where(.cf-application-form) .af-cta>span{position:relative}
:where(.cf-application-form) .af-cta:hover{background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.06) c h);box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-application-form) .af-cta:active{background:oklch(from var(--button-bg,var(--cta)) calc(l - 0.10) c h);color:contrast-color(oklch(from var(--button-bg,var(--cta)) calc(l - 0.10) c h));box-shadow:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg, var(--cta)) calc(l + 0.12) c h / 0.5),inset 0 -3px 0 oklch(from var(--button-bg, var(--cta)) calc(l - 0.16) c h),var(--shadow-md, 0 1px 2px oklch(0.22 0.03 260 / 0.22), 0 4px 10px -2px oklch(0.22 0.03 260 / 0.2)));}
:where(.cf-application-form) .af-cta:focus-visible{outline:3px solid var(--af-ink);outline-offset:4px}
@media (min-width:640px){:where(.cf-application-form) .af-cta{width:auto;min-height:64px;padding-inline:56px;font-size:19px}}
:where(.cf-application-form) .af-back{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:58px;padding:0 22px;border:1.5px solid var(--af-line);border-radius:var(--button-radius,var(--radius,14px));background:var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260)));color:var(--button-2-ink, var(--secondary-ink, var(--ink)));font:inherit;font-size:17px;font-weight:var(--button-weight,800);line-height:1.15;text-wrap:balance;cursor:pointer;box-shadow:var(--button-2-shadow, var(--shadow-sm));border-color:var(--button-2-border, transparent);font-family:var(--button-font,var(--font-display));text-transform:var(--button-case,none);}
:where(.cf-application-form) .af-back:hover{border-color:var(--button-2-border, transparent);background:oklch(from var(--button-2-bg, var(--secondary, oklch(0.93 0.01 260))) calc(l - 0.03) c h);box-shadow:var(--button-2-shadow, var(--shadow-sm));}
:where(.cf-application-form) .af-back:active{box-shadow:var(--button-2-shadow, var(--shadow-sm));}
:where(.cf-application-form) .af-back:focus-visible{outline:3px solid var(--af-ink);outline-offset:4px}
@media (min-width:640px){:where(.cf-application-form) .af-back{width:auto;min-height:64px;padding:0 26px}}
@media (prefers-reduced-motion:no-preference){:where(.cf-application-form) .af-node,:where(.cf-application-form) .af-st-label{transition:background-color .3s,border-color .3s,color .3s,box-shadow .3s}:where(.cf-application-form) .af-st::after{transition:background-size .55s cubic-bezier(.6,0,.2,1)}:where(.cf-application-form) .af-opt{transition:border-color .18s,background-color .18s,box-shadow .18s,transform .18s}:where(.cf-application-form) .af-opt:hover{transform:translateY(-1px)}:where(.cf-application-form) .af-opt:active{transform:none}:where(.cf-application-form) .af-key,:where(.cf-application-form) .af-radio{transition:background-color .18s,border-color .18s,color .18s}:where(.cf-application-form) .af-ta{transition:border-color .18s,box-shadow .18s}:where(.cf-application-form) .af-cta{transition:transform .15s,box-shadow .15s,filter .15s}:where(.cf-application-form) .af-cta:hover{transform:translateY(-1px)}:where(.cf-application-form) .af-cta:active{transform:translateY(3px)}:where(.cf-application-form) .af-back{transition:transform .15s,box-shadow .15s,border-color .15s,background-color .15s}:where(.cf-application-form) .af-back:active{transform:translateY(2px)}:where(.cf-application-form) .af-in{animation:af-in .38s cubic-bezier(.2,.8,.2,1) both}:where(.cf-application-form) .af-st[data-s=active] .af-node::after{content:'';position:absolute;inset:-7px;border-radius:inherit;border:2px solid var(--af-band-ink);opacity:0;animation:af-pulse 2.2s ease-out 3}}
@keyframes af-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes af-pulse{0%{opacity:.5;transform:scale(.85)}70%,100%{opacity:0;transform:scale(1.35)}}`;
pieces/kit/application-form/specimen.tsx 17 lines
// Specimen for application-form.tsx. Fictional Funnel Starter Workshop; no proof supplied or shown.
import { ApplicationForm } from "../application-form";
import defaults from "../../studio-defaults.json";
import { Section } from "../core";
export const states = ["default", "error"];
export default function Page({ state = "default" }: { state?: string }) {
const s = state === "error" ? state : "default";
return <>
<Section tone="open"><ApplicationForm state={s} eyebrow={defaults.sample.registration.name} title="Tell us where your funnel is" intro="Two short questions, then your free workshop is ready to watch." question="Where are you with your funnel?" options={[
{ label: "Just getting started", text: "I'm still shaping my offer." },
{ label: "Planning my pages", text: "I know my offer and need the page plan." },
{ label: "Ready to review my draft", text: "I have a page draft to work through." },
]} detailQuestion="What are you offering, and which part of your funnel do you want to work through?" detailPlaceholder="Example: A workbook for new coaches. I want to plan my opt-in page." submitLabel="Send My Application" /></Section>
</>;
}
| Name | Type | Details |
|---|---|---|
title OptionalApplicationForm |
ReactNode |
Default "Tell us where your funnel is"
|
question OptionalApplicationForm |
string |
Default "Where are you with your funnel?"
|
options OptionalApplicationForm |
{ label: string; text?: string; key?: string }[] |
Default APPLICATION_FORM_OPTIONS
|
detailQuestion OptionalApplicationForm |
string |
Default "What are you offering, and which part of your funnel do you want to work through?"
|
submitLabel OptionalApplicationForm |
string |
Default "Send My Application"
|
confirmation OptionalApplicationForm |
ReactNode |
|
state OptionalApplicationForm |
"default" | "error" | "success" |
Default "default"
|
eyebrow OptionalApplicationForm |
string |
Default "Application"
|
intro OptionalApplicationForm |
string |
Default "Two short questions, then you’re done."
|
questionHint OptionalApplicationForm |
string |
Default "Pick the one that fits best."
|
detailHint OptionalApplicationForm |
string |
Default "A sentence or two is plenty."
|
detailPlaceholder OptionalApplicationForm |
string |
|
nextLabel OptionalApplicationForm |
string |
Default "Next: Your Goal"
|
steps OptionalApplicationForm |
{ label: string; hint: string }[] |
Default APPLICATION_FORM_STEPS
|
onSubmit OptionalApplicationForm |
(values: { situation: string; goal: string }) => void |
|
copy OptionalApplicationForm |
Partial<typeof APPLICATION_FORM_COPY> |
|
className OptionalApplicationForm |
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.
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
-
c5c36baf6b897f22.svg image/svg+xml · 236 Bytes
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB