Testimonial Submit 1
Testimonial story builder: three Epiphany Bridge prompts (before, the turn, now) on an oversized number rail with a live
Use it in a prompt
Use forms/testimonial-submit 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/testimonial-submit.tsx. - Import it and pass your copy and images (Props tab):
import { TestimonialSubmit } from "@/components/funneldna/forms/testimonial-submit"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/testimonial-submit/component.tsx 918 lines
// layout: number-rail
// Testimonial story builder: three Epiphany Bridge prompts (before, the turn, now) on an oversized number rail with a live
// preview card, so customer stories come back specific, signed and permissioned. Every customer gets the same form.
import React, { useEffect, useId, useRef, useState } from "react";
import { AlertCircle, Check, ChevronDown, ImagePlus, Loader2, Lock, Quote, User, X } from "lucide-react";
export type TestimonialPrompt = {
/** Key for this answer in the submitted values. */
id: string;
/** Short chapter name shown on the preview chips. */
chapter: string;
title: string;
hint?: string;
placeholder?: string;
/** Soft word-count range; guidance only, never blocks submit. */
minWords?: number;
maxWords?: number;
/** Inline error when this answer is empty. */
error?: string;
};
export type TestimonialSubmitValues = {
answers: { id: string; prompt: string; text: string }[];
/** The answers joined in story order, exactly as the preview shows them. */
story: string;
firstName: string;
/** The chosen photo; it stays on the device until onSubmit hands it over. */
photo: File | null;
consent: boolean;
};
export type TestimonialSubmitCopy = {
signTitle: string;
signHint: string;
nameLabel: string;
namePlaceholder: string;
photoLabel: string;
photoAdd: string;
photoChange: string;
photoRemove: string;
photoAlt: string;
consentLabel: React.ReactNode;
/** The question the button answers. */
question: React.ReactNode;
button: string;
buttonBusy: string;
reassurance: string;
ps: React.ReactNode;
previewTitle: string;
previewEmpty: string;
previewShow: string;
previewHide: string;
namePending: string;
/** Word-count templates; placeholders {count}, {min}, {max}. */
aimEmpty: string;
words: string;
wordsOne: string;
aim: string;
good: string;
long: string;
/** Screen-reader suffix on a written chapter chip. */
chapterWritten: string;
errorAnswer: string;
errorName: string;
errorConsent: string;
summary: string;
};
export type TestimonialSubmitProps = {
headline?: React.ReactNode;
lead?: React.ReactNode;
/** The guided prompts, in story order. */
prompts?: TestimonialPrompt[];
/** Line under the name on the preview card, e.g. "Steady Strength member". */
memberLabel?: string;
/** scene slot: photo set offset behind the preview card. */
sceneImage?: string;
sceneAlt?: string;
/** Prefill answers (by prompt id) and first name. */
defaultValues?: { answers?: Record<string, string>; firstName?: string };
copy?: Partial<TestimonialSubmitCopy>;
/** Receives validated values; return a promise to show the sending state. */
onSubmit?: (values: TestimonialSubmitValues) => void | Promise<unknown>;
state?: "default" | "error" | "disabled";
className?: string;
};
const DEFAULT_HEADLINE = (
<>
Your story could be the reason someone <span className="ts-em">finally starts</span>
</>
);
const DEFAULT_LEAD =
"Answer three short questions in the order it happened. Watch them come together into one story, and read it exactly as others will before you send it.";
const DEFAULT_PROMPTS: TestimonialPrompt[] = [
{
id: "before",
chapter: "Before",
title: "Where were you before you started?",
hint: "Name the week, the habit or the number that was wearing you down.",
placeholder: "I'd tried three programs that year and quit every one by week two.",
minWords: 20,
maxWords: 70,
},
{
id: "turn",
chapter: "The turn",
title: "What was the moment it clicked?",
hint: "One specific day or moment when you knew this was different.",
placeholder: "Week three, the plan finally fit around my mornings and I didn't skip once.",
minWords: 20,
maxWords: 70,
},
{
id: "now",
chapter: "Now",
title: "Where are you now?",
hint: "What can you do today that you couldn't then? Be concrete.",
placeholder: "Now I show up three times a week without having to think about it.",
minWords: 20,
maxWords: 70,
},
];
const DEFAULT_COPY: TestimonialSubmitCopy = {
signTitle: "Put your name to it",
signHint: "First name only. A photo makes it feel real, and it’s optional.",
nameLabel: "First name",
namePlaceholder: "Dana",
photoLabel: "Photo (optional)",
photoAdd: "Add a photo",
photoChange: "Change photo",
photoRemove: "Remove photo",
photoAlt: "Your photo",
consentLabel:
"Yes, you may publish my story, first name and photo on your website and emails. I can ask for it to be taken down at any time.",
question: "Ready to share how it went?",
button: "Yes, share my story",
buttonBusy: "Sending your story…",
reassurance: "Your photo stays on this device until you send.",
ps: (
<>
<strong>P.S.</strong> Every customer gets this same short form, and nothing is offered for a review. Tell it
straight, hard weeks included. That is what helps the next person start.
</>
),
previewTitle: "Read it the way the next person will",
previewEmpty: "Your story appears here as you write.",
previewShow: "See how it reads",
previewHide: "Hide the preview",
namePending: "Your first name",
aimEmpty: "Aim for {min}–{max} words",
words: "{count} words",
wordsOne: "1 word",
aim: "aim for {min}–{max}",
good: "specific enough",
long: "plenty here, trim if you can",
chapterWritten: "written",
errorAnswer: "Write a sentence or two here so your story makes sense.",
errorName: "Add your first name so readers know who is talking.",
errorConsent: "Tick the box so we have your permission to share it.",
summary: "Finish the highlighted parts above to send your story.",
};
export function TestimonialSubmit(props: TestimonialSubmitProps) {
const {
headline = DEFAULT_HEADLINE,
lead = DEFAULT_LEAD,
prompts = DEFAULT_PROMPTS,
memberLabel = "Member",
sceneImage,
sceneAlt = "",
defaultValues,
copy: copyProp,
onSubmit,
state = "default",
className,
} = props;
const copy: TestimonialSubmitCopy = { ...DEFAULT_COPY, ...copyProp };
const uid = "ts" + useId().replace(/[^a-zA-Z0-9]/g, "");
const [answers, setAnswers] = useState<Record<string, string>>(() => ({ ...(defaultValues?.answers ?? {}) }));
const [firstName, setFirstName] = useState(defaultValues?.firstName ?? "");
const [photo, setPhoto] = useState<File | null>(null);
const [photoUrl, setPhotoUrl] = useState<string | null>(null);
const [consent, setConsent] = useState(false);
const [attempted, setAttempted] = useState(false);
const [focused, setFocused] = useState<number | null>(null);
const [open, setOpen] = useState(false);
const [busy, setBusy] = useState(false);
const fieldRefs = useRef<(HTMLTextAreaElement | null)[]>([]);
const nameRef = useRef<HTMLInputElement>(null);
const consentRef = useRef<HTMLInputElement>(null);
const fileRef = useRef<HTMLInputElement>(null);
const mounted = useRef(true);
useEffect(() => {
mounted.current = true;
return () => {
mounted.current = false;
};
}, []);
useEffect(() => {
if (!photo) {
setPhotoUrl(null);
return;
}
const url = URL.createObjectURL(photo);
setPhotoUrl(url);
return () => URL.revokeObjectURL(url);
}, [photo]);
const locked = state === "disabled";
const showErrors = attempted || state === "error";
const answerMissing = prompts.map((p) => !(answers[p.id] ?? "").trim());
const nameMissing = !firstName.trim();
const hasErrors = answerMissing.some(Boolean) || nameMissing || !consent;
const written = prompts
.map((p, i) => ({ p, i, text: (answers[p.id] ?? "").trim() }))
.filter((s) => s.text);
const signIndex = prompts.length;
const initial = firstName.trim().charAt(0).toUpperCase();
const handlePhoto = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files && e.target.files[0] ? e.target.files[0] : null;
if (file && !file.type.startsWith("image/")) return;
setPhoto(file);
};
const removePhoto = () => {
setPhoto(null);
if (fileRef.current) fileRef.current.value = "";
};
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
if (locked || busy) return;
setAttempted(true);
const firstBad = answerMissing.indexOf(true);
if (firstBad >= 0) {
fieldRefs.current[firstBad]?.focus();
return;
}
if (nameMissing) {
nameRef.current?.focus();
return;
}
if (!consent) {
consentRef.current?.focus();
return;
}
const list = prompts.map((p) => ({ id: p.id, prompt: p.title, text: (answers[p.id] ?? "").trim() }));
const result: unknown = onSubmit?.({
answers: list,
story: list.map((a) => a.text).join(" "),
firstName: firstName.trim(),
photo,
consent: true,
});
if (result instanceof Promise) {
setBusy(true);
const done = () => {
if (mounted.current) setBusy(false);
};
result.then(done, done);
}
};
return (
<section
className={["cf-testimonial-submit", className].filter(Boolean).join(" ")}
aria-labelledby={`${uid}-h`}
>
<style>{CSS}</style>
<div className="ts-wrap">
<header className="ts-head">
<h2 className="ts-h2" id={`${uid}-h`}>
{headline}
</h2>
{lead ? <p className="ts-lead">{lead}</p> : null}
</header>
<form className="ts-form" noValidate onSubmit={handleSubmit} aria-labelledby={`${uid}-h`}>
<fieldset className="ts-fieldset" disabled={locked}>
<div className="ts-grid">
<div className="ts-steps">
{prompts.map((p, i) => {
const text = answers[p.id] ?? "";
const count = countWords(text);
const line = countLine(count, p.minWords ?? 20, p.maxWords ?? 70, copy);
const err = showErrors && answerMissing[i];
const id = `${uid}-a${i}`;
const describedBy = [p.hint ? `${id}-hint` : "", err ? `${id}-err` : "", `${id}-count`]
.filter(Boolean)
.join(" ");
return (
<div
className="ts-step"
key={p.id}
data-state={focused === i ? "active" : count ? "done" : "idle"}
data-filled={count ? "true" : "false"}
style={{ animationDelay: `${Math.min(i * 0.07, 0.28)}s` }}
>
<div className="ts-rail" aria-hidden="true">
<span className="ts-num">{pad(i + 1)}</span>
<span className="ts-line">
<span className="ts-line-fill" />
</span>
</div>
<div className="ts-step-body">
<h3 className="ts-step-title">
<label htmlFor={id}>{p.title}</label>
</h3>
{p.hint ? (
<p className="ts-hint" id={`${id}-hint`}>
{p.hint}
</p>
) : null}
<textarea
id={id}
ref={(el) => {
fieldRefs.current[i] = el;
}}
className="ts-field ts-area"
name={p.id}
rows={4}
value={text}
placeholder={p.placeholder ?? "Write a few honest sentences in your own words."}
aria-required="true"
aria-invalid={err ? "true" : undefined}
aria-describedby={describedBy}
onChange={(e) => {
const v = e.target.value;
setAnswers((a) => ({ ...a, [p.id]: v }));
}}
onFocus={() => setFocused(i)}
onBlur={() => setFocused((f) => (f === i ? null : f))}
/>
<div className="ts-meta">
{err ? (
<p className="ts-error" id={`${id}-err`}>
<AlertCircle className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{p.error ?? copy.errorAnswer}
</p>
) : null}
<p className="ts-count" id={`${id}-count`} data-tone={line.tone}>
{line.tone === "good" ? (
<Check className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
) : null}
{line.text}
</p>
</div>
</div>
</div>
);
})}
<div
className="ts-step ts-step-sign"
data-state={focused === signIndex ? "active" : nameMissing ? "idle" : "done"}
style={{ animationDelay: `${Math.min(signIndex * 0.07, 0.28)}s` }}
>
<div className="ts-rail" aria-hidden="true">
<span className="ts-num">{pad(signIndex + 1)}</span>
</div>
<div className="ts-step-body">
<h3 className="ts-step-title">{copy.signTitle}</h3>
<p className="ts-hint">{copy.signHint}</p>
<div className="ts-sign">
<div className="ts-sign-name">
<label className="ts-label" htmlFor={`${uid}-name`}>
{copy.nameLabel}
</label>
<input
id={`${uid}-name`}
ref={nameRef}
className="ts-field ts-input"
type="text"
name="firstName"
autoComplete="given-name"
placeholder={copy.namePlaceholder}
value={firstName}
aria-required="true"
aria-invalid={showErrors && nameMissing ? "true" : undefined}
aria-describedby={showErrors && nameMissing ? `${uid}-name-err` : undefined}
onChange={(e) => setFirstName(e.target.value)}
onFocus={() => setFocused(signIndex)}
onBlur={() => setFocused((f) => (f === signIndex ? null : f))}
/>
{showErrors && nameMissing ? (
<p className="ts-error ts-error-below" id={`${uid}-name-err`}>
<AlertCircle className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.errorName}
</p>
) : null}
</div>
<div className="ts-sign-photo">
<span className="ts-label" id={`${uid}-ph`}>
{copy.photoLabel}
</span>
<div className="ts-photo">
{photoUrl ? <img className="ts-thumb" src={photoUrl} alt={copy.photoAlt} /> : null}
<label className="ts-btn2">
<input
ref={fileRef}
className="ts-file"
type="file"
accept="image/*"
aria-describedby={`${uid}-ph`}
onChange={handlePhoto}
/>
<ImagePlus size={20} strokeWidth={2.5} aria-hidden="true" />
<span>{photo ? copy.photoChange : copy.photoAdd}</span>
</label>
{photo ? (
<button
type="button"
className="ts-btn2 ts-icon-btn"
aria-label={copy.photoRemove}
onClick={removePhoto}
>
<X size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
) : null}
</div>
</div>
</div>
</div>
</div>
</div>
<aside className="ts-preview" data-open={open ? "true" : "false"} aria-label={copy.previewTitle}>
<button
type="button"
className="ts-btn2 ts-toggle"
aria-expanded={open}
aria-controls={`${uid}-pv`}
onClick={() => setOpen((o) => !o)}
>
<span>{open ? copy.previewHide : copy.previewShow}</span>
<ChevronDown className="ts-chev" size={20} strokeWidth={2.5} aria-hidden="true" />
</button>
<div className="ts-preview-body" id={`${uid}-pv`}>
<h3 className="ts-preview-title">{copy.previewTitle}</h3>
<div className="ts-stage" data-scene={sceneImage ? "true" : "false"}>
{sceneImage ? (
<img className="ts-scene" src={sceneImage} alt={sceneAlt} loading="lazy" decoding="async" />
) : null}
<figure className="ts-card">
<Quote className="ts-qmark" size={32} strokeWidth={2.5} aria-hidden="true" />
{written.length ? (
<blockquote className="ts-quote" tabIndex={0}>
<p>
{written.map((s, n) => (
<React.Fragment key={s.p.id}>
{n > 0 ? " " : null}
<span className="ts-seg" data-active={focused === s.i ? "true" : "false"}>
{s.text}
</span>
</React.Fragment>
))}
</p>
</blockquote>
) : (
<div className="ts-empty">
<p>{copy.previewEmpty}</p>
<span className="ts-bars" aria-hidden="true">
<span />
<span />
<span />
</span>
</div>
)}
<ul className="ts-chips">
{prompts.map((p, i) => {
const done = !answerMissing[i];
return (
<li
key={p.id}
className="ts-chip"
data-done={done ? "true" : "false"}
data-active={focused === i ? "true" : "false"}
>
{done ? <Check size={16} strokeWidth={2.5} aria-hidden="true" /> : null}
{p.chapter}
{done ? <span className="ts-sr"> ({copy.chapterWritten})</span> : null}
</li>
);
})}
</ul>
<figcaption className="ts-author">
<span className="ts-avatar" data-kind={photoUrl ? "photo" : "initial"}>
{photoUrl ? (
<img src={photoUrl} alt={firstName.trim() || copy.photoAlt} />
) : initial ? (
<span aria-hidden="true">{initial}</span>
) : (
<User size={20} strokeWidth={2.5} aria-hidden="true" />
)}
</span>
<span className="ts-who">
<span className="ts-name" data-pending={nameMissing ? "true" : "false"}>
{firstName.trim() || copy.namePending}
</span>
<span className="ts-role">{memberLabel}</span>
</span>
</figcaption>
</figure>
</div>
</div>
</aside>
<div className="ts-close">
<div className="ts-consent" data-invalid={showErrors && !consent ? "true" : "false"}>
<label className="ts-consent-label">
<input
ref={consentRef}
className="ts-check"
type="checkbox"
name="consent"
checked={consent}
aria-required="true"
aria-invalid={showErrors && !consent ? "true" : undefined}
aria-describedby={showErrors && !consent ? `${uid}-consent-err` : undefined}
onChange={(e) => setConsent(e.target.checked)}
/>
<span className="ts-box" aria-hidden="true">
<Check size={16} strokeWidth={3} />
</span>
<span className="ts-consent-text">{copy.consentLabel}</span>
</label>
{showErrors && !consent ? (
<p className="ts-error ts-consent-err" id={`${uid}-consent-err`}>
<AlertCircle className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.errorConsent}
</p>
) : null}
</div>
<p className="ts-question">{copy.question}</p>
{showErrors && hasErrors ? (
<p className="ts-error ts-summary" role="alert">
<AlertCircle className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.summary}
</p>
) : null}
<button
type="submit"
className="ts-submit"
disabled={locked || busy}
data-busy={busy ? "true" : undefined}
aria-busy={busy || undefined}
>
{busy ? <Loader2 className="ts-spin" size={20} strokeWidth={2.5} aria-hidden="true" /> : null}
<span>{busy ? copy.buttonBusy : copy.button}</span>
</button>
<p className="ts-reassure">
<Lock className="ts-ico" size={16} strokeWidth={2.5} aria-hidden="true" />
{copy.reassurance}
</p>
{copy.ps ? <p className="ts-ps">{copy.ps}</p> : null}
</div>
</div>
</fieldset>
</form>
</div>
</section>
);
}
export default TestimonialSubmit;
function pad(n: number) {
return n < 10 ? "0" + n : String(n);
}
function countWords(text: string) {
const t = text.trim();
return t ? t.split(/\s+/).length : 0;
}
function fill(template: string, vars: Record<string, string | number>) {
return template.replace(/\{(\w+)\}/g, (match, key: string) => (key in vars ? String(vars[key]) : match));
}
function countLine(words: number, min: number, max: number, copy: TestimonialSubmitCopy) {
if (!words) return { tone: "idle", text: fill(copy.aimEmpty, { min, max }) };
const w = words === 1 ? copy.wordsOne : fill(copy.words, { count: words });
if (words < min) return { tone: "short", text: `${w} · ${fill(copy.aim, { min, max })}` };
if (words > max) return { tone: "long", text: `${w} · ${copy.long}` };
return { tone: "good", text: `${w} · ${copy.good}` };
}
const CSS = `
.cf-testimonial-submit{
--ts-rail:clamp(52px,7vw,96px);
--ts-gap:clamp(12px,2.2vw,28px);
--ts-num:clamp(2.5rem,4.2vw,3.75rem);
--ts-shadow:var(--shadow,oklch(0.22 0.03 260));
position:relative;
background:var(--surface);
color:var(--ink);
font-family:var(--font-body);
padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);
overflow-x:clip;
}
.cf-testimonial-submit *,.cf-testimonial-submit *::before,.cf-testimonial-submit *::after{box-sizing:border-box}
.cf-testimonial-submit .ts-wrap{max-width:1120px;margin:0 auto}
.cf-testimonial-submit .ts-head{max-width:46rem;margin:0 0 clamp(40px,5vw,64px)}
.cf-testimonial-submit .ts-h2{
margin:0 0 16px;
font-family:var(--font-display);
font-weight:var(--display-weight,800);
text-transform:var(--display-case,none);
letter-spacing:var(--display-tracking,-0.025em);
font-size:clamp(2rem,3.6vw,3.25rem);
line-height:1.06;
color:var(--ink);
text-wrap:balance;
}
.cf-testimonial-submit .ts-em{color:var(--accent)}
.cf-testimonial-submit .ts-lead{
margin:0;max-width:60ch;
font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;
color:var(--muted);text-wrap:pretty;
}
.cf-testimonial-submit .ts-form{margin:0}
.cf-testimonial-submit .ts-fieldset{border:0;margin:0;padding:0;min-width:0}
.cf-testimonial-submit .ts-grid{
display:grid;
grid-template-columns:minmax(0,1fr) minmax(320px,420px);
grid-template-areas:"steps preview" "close preview";
column-gap:clamp(32px,5vw,72px);
align-items:start;
}
.cf-testimonial-submit .ts-steps{grid-area:steps;min-width:0}
.cf-testimonial-submit .ts-close{grid-area:close;min-width:0;padding-left:calc(var(--ts-rail) + var(--ts-gap))}
.cf-testimonial-submit .ts-preview{grid-area:preview;min-width:0;position:sticky;top:24px}
.cf-testimonial-submit .ts-step{
display:grid;grid-template-columns:var(--ts-rail) minmax(0,1fr);column-gap:var(--ts-gap);
padding-bottom:40px;
animation:ts-rise .45s cubic-bezier(.2,.7,.2,1) both;
}
.cf-testimonial-submit .ts-rail{position:relative;display:flex;justify-content:center}
.cf-testimonial-submit .ts-num{
font-family:var(--font-display);font-weight:var(--display-weight,800);
font-size:var(--ts-num);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;
color:var(--muted);transition:color .16s ease;
}
.cf-testimonial-submit .ts-step[data-state=active] .ts-num,
.cf-testimonial-submit .ts-step[data-state=done] .ts-num{color:var(--accent)}
.cf-testimonial-submit .ts-line{
position:absolute;left:50%;top:calc(var(--ts-num) + 12px);bottom:12px;width:2px;
transform:translateX(-50%);border-radius:2px;overflow:hidden;
background:oklch(from var(--ink) l c h / .14);
}
.cf-testimonial-submit .ts-line-fill{
position:absolute;inset:0;background:var(--accent-fill,var(--accent));
transform-origin:top;transform:scaleY(0);transition:transform .45s cubic-bezier(.2,.7,.2,1);
}
.cf-testimonial-submit .ts-step[data-filled=true] .ts-line-fill{transform:scaleY(1)}
.cf-testimonial-submit .ts-step-body{min-width:0}
.cf-testimonial-submit .ts-step-title{
margin:4px 0 8px;
font-family:var(--font-display);font-weight:800;
font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;
color:var(--ink);text-wrap:balance;
}
.cf-testimonial-submit .ts-step-title label{cursor:pointer}
.cf-testimonial-submit .ts-hint{
margin:0 0 16px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;
color:var(--muted);text-wrap:pretty;
}
.cf-testimonial-submit .ts-field{
display:block;width:100%;margin:0;
font-family:var(--font-body);font-size:1.0625rem;line-height:1.5;
color:var(--field-ink);background:var(--field);
border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));
border-radius:var(--field-radius,var(--radius,12px));
transition:border-color .16s ease,box-shadow .16s ease;
}
.cf-testimonial-submit .ts-area{min-height:132px;padding:14px 16px;resize:vertical}
.cf-testimonial-submit .ts-input{height:56px;padding:0 16px}
.cf-testimonial-submit .ts-field::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-testimonial-submit .ts-field:hover:not(:focus):not(:disabled){border-color:color-mix(in oklch,var(--ink) 38%,transparent)}
.cf-testimonial-submit .ts-field:focus{outline:none}
.cf-testimonial-submit .ts-field:focus-visible{
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-testimonial-submit .ts-field[aria-invalid=true]{border-color:var(--danger)}
.cf-testimonial-submit .ts-field[aria-invalid=true]:focus-visible{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / .3)}
.cf-testimonial-submit .ts-field:disabled{
cursor:not-allowed;background:color-mix(in oklch,var(--field-ink) 5%,var(--field));
}
.cf-testimonial-submit .ts-meta{
display:flex;flex-wrap:wrap;justify-content:space-between;align-items:flex-start;
gap:4px 16px;margin-top:8px;
}
.cf-testimonial-submit .ts-count{
margin:0 0 0 auto;font-size:.9375rem;line-height:1.4;font-weight:600;
color:var(--muted);font-variant-numeric:tabular-nums;
}
.cf-testimonial-submit .ts-count[data-tone=good]{color:var(--success)}
.cf-testimonial-submit .ts-error{
margin:0;font-size:.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty;
}
.cf-testimonial-submit .ts-error-below{margin-top:8px}
.cf-testimonial-submit .ts-ico{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em;flex:none}
.cf-testimonial-submit .ts-sign{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px 24px;align-items:start}
.cf-testimonial-submit .ts-label{
display:block;margin:0 0 8px;font-size:1.0625rem;line-height:1.3;font-weight:700;
color:var(--label-ink,var(--ink));
}
.cf-testimonial-submit .ts-photo{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.cf-testimonial-submit .ts-thumb{width:56px;height:56px;border-radius:50%;object-fit:cover;display:block;flex:none}
.cf-testimonial-submit .ts-btn2{
position:relative;display:inline-flex;align-items:center;justify-content:center;gap:8px;
min-height:56px;padding:0 20px;margin:0;
font-family:var(--button-font,var(--font-display));font-weight:var(--button-weight,800);
text-transform:var(--button-case,none);font-size:1.0625rem;line-height:1.15;white-space:nowrap;
color:var(--button-2-ink,var(--secondary-ink));background:var(--button-2-bg,var(--secondary));
border:1px solid var(--button-2-border,transparent);
border-radius:var(--button-radius,var(--radius,12px));
box-shadow:var(--button-2-shadow,var(--shadow-sm));
cursor:pointer;transition:background .16s ease,transform .16s ease;
}
.cf-testimonial-submit .ts-btn2:hover{background:oklch(from var(--button-2-bg,var(--secondary)) calc(l - 0.03) c h)}
.cf-testimonial-submit .ts-btn2:active{transform:translateY(1px)}
.cf-testimonial-submit .ts-btn2:focus-visible,
.cf-testimonial-submit .ts-btn2:focus-within{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .45);outline-offset:2px}
.cf-testimonial-submit .ts-btn2:has(.ts-file:not(:focus-visible)):not(:focus-visible){outline:none}
.cf-testimonial-submit .ts-fieldset:disabled .ts-btn2{cursor:not-allowed;opacity:.7}
.cf-testimonial-submit .ts-icon-btn{width:56px;padding:0}
.cf-testimonial-submit .ts-file{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0)}
.cf-testimonial-submit .ts-consent{
margin:0 0 32px;padding:16px 20px;border-radius:12px;
background:color-mix(in oklch,var(--ink) 4%,var(--surface));
border:1px solid transparent;transition:border-color .16s ease;
}
.cf-testimonial-submit .ts-consent[data-invalid=true]{border-color:var(--danger)}
.cf-testimonial-submit .ts-consent-label{
position:relative;display:grid;grid-template-columns:24px minmax(0,1fr);gap:14px;
align-items:start;cursor:pointer;
}
.cf-testimonial-submit .ts-check{position:absolute;top:1px;left:0;width:24px;height:24px;margin:0;opacity:0;cursor:pointer}
.cf-testimonial-submit .ts-box{
width:24px;height:24px;margin-top:1px;display:grid;place-items:center;
border-radius:6px;background:var(--field);color:transparent;
border:2px solid color-mix(in oklch,var(--ink) 45%,var(--surface));
transition:background .16s ease,border-color .16s ease;
}
.cf-testimonial-submit .ts-check:checked + .ts-box{
background:var(--accent-fill,var(--accent));border-color:var(--accent-fill,var(--accent));
color:var(--accent-fill-ink,var(--card));
}
.cf-testimonial-submit .ts-check:focus-visible + .ts-box{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .45);outline-offset:2px}
.cf-testimonial-submit .ts-consent[data-invalid=true] .ts-box{border-color:var(--danger)}
.cf-testimonial-submit .ts-check:disabled,.cf-testimonial-submit .ts-check:disabled ~ *{cursor:not-allowed}
.cf-testimonial-submit .ts-consent-text{font-size:1.0625rem;line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-testimonial-submit .ts-consent-err{margin:10px 0 0 38px}
.cf-testimonial-submit .ts-question{
margin:0 0 16px;font-family:var(--font-display);font-weight:var(--display-weight,800);
font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;
color:var(--ink);text-wrap:balance;
}
.cf-testimonial-submit .ts-summary{margin:0 0 12px}
.cf-testimonial-submit .ts-submit{
display:inline-flex;align-items:center;justify-content:center;gap:10px;
min-height:64px;min-width:min(100%,320px);padding:0 28px;margin:0;border:0;
border-radius:var(--button-radius,var(--radius,12px));
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;
color:var(--button-ink,var(--cta-ink));text-shadow:var(--button-text-shadow,none);
background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l + 0.04) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.02) c h));
box-shadow:var(--button-shadow,
inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.14) c h / .7),
inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--ts-shadow) l c h / .3),
0 8px 16px -6px oklch(from var(--ts-shadow) l c h / .45));
cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
}
.cf-testimonial-submit .ts-submit:not(:disabled):hover{
transform:translateY(-1px);
background:linear-gradient(oklch(from var(--button-bg,var(--cta)) calc(l - 0.01) c h),oklch(from var(--button-bg-2,var(--cta-2)) calc(l - 0.07) c h));
box-shadow:
inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.1) c h / .7),
inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h),
0 1px 2px oklch(from var(--ts-shadow) l c h / .32),
0 12px 20px -8px oklch(from var(--ts-shadow) l c h / .5);
}
.cf-testimonial-submit .ts-submit:not(:disabled):active{
transform:translateY(1px);
box-shadow:
inset 0 2px 3px oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h / .45),
inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--ts-shadow) l c h / .3);
}
.cf-testimonial-submit .ts-submit:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-testimonial-submit .ts-submit[data-busy]{cursor:progress}
.cf-testimonial-submit .ts-submit:disabled:not([data-busy]){
cursor:not-allowed;text-shadow:none;
color:var(--button-2-ink,var(--secondary-ink));background:var(--button-2-bg,var(--secondary));
box-shadow:var(--button-2-shadow,var(--shadow-sm));
}
.cf-testimonial-submit .ts-spin{animation:ts-spin .8s linear infinite}
.cf-testimonial-submit .ts-reassure{margin:12px 0 0;font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-testimonial-submit .ts-ps{margin:24px 0 0;max-width:60ch;font-size:1.0625rem;line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-testimonial-submit .ts-ps strong{font-weight:800}
.cf-testimonial-submit .ts-toggle{display:none}
.cf-testimonial-submit .ts-chev{transition:transform .16s ease}
.cf-testimonial-submit .ts-preview[data-open=true] .ts-chev{transform:rotate(180deg)}
.cf-testimonial-submit .ts-preview-title{
margin:4px 0 16px;font-family:var(--font-display);font-weight:800;
font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;
color:var(--ink);text-wrap:balance;
}
.cf-testimonial-submit .ts-stage{position:relative;padding:40px 0 0 40px}
.cf-testimonial-submit .ts-stage[data-scene=false]{padding:0}
.cf-testimonial-submit .ts-scene{
position:absolute;top:0;left:0;width:72%;height:68%;display:block;
object-fit:cover;object-position:center;border-radius:12px;
}
.cf-testimonial-submit .ts-card{
position:relative;margin:0;
padding:clamp(24px,3vw,32px);
background:var(--card);color:var(--ink);
border:1px solid color-mix(in oklch,var(--accent) 30%,var(--card));
border-radius:var(--card-radius,var(--radius,14px));
box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(from var(--ts-shadow) l c h / .22),0 12px 24px -8px oklch(from var(--ts-shadow) l c h / .32)));
}
.cf-testimonial-submit .ts-qmark{display:block;color:var(--accent);margin:0 0 12px}
.cf-testimonial-submit .ts-quote{margin:0;max-height:24rem;overflow:auto;border-radius:6px}
.cf-testimonial-submit .ts-quote:focus-visible{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / .45);outline-offset:4px}
.cf-testimonial-submit .ts-quote p{
margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.5;font-weight:500;
color:var(--ink);text-wrap:pretty;
}
.cf-testimonial-submit .ts-seg{
border-radius:4px;padding:1px 3px;margin:0 -3px;
-webkit-box-decoration-break:clone;box-decoration-break:clone;
transition:background-color .16s ease;
}
.cf-testimonial-submit .ts-seg[data-active=true]{background:color-mix(in oklch,var(--accent) 14%,var(--card))}
.cf-testimonial-submit .ts-empty p{
margin:0;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.5;font-weight:500;color:var(--muted);
}
.cf-testimonial-submit .ts-bars{display:block;margin-top:12px}
.cf-testimonial-submit .ts-bars span{
display:block;height:12px;margin-top:10px;border-radius:6px;
background:color-mix(in oklch,var(--ink) 7%,var(--card));
}
.cf-testimonial-submit .ts-bars span:nth-child(2){width:88%}
.cf-testimonial-submit .ts-bars span:nth-child(3){width:60%}
.cf-testimonial-submit .ts-chips{list-style:none;margin:20px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.cf-testimonial-submit .ts-chip{
display:inline-flex;align-items:center;gap:6px;min-height:30px;padding:4px 12px;
border-radius:999px;border:1px solid transparent;
font-size:.875rem;line-height:1.2;font-weight:800;color:var(--ink);
background:color-mix(in oklch,var(--ink) 6%,var(--card));
transition:background .16s ease,border-color .16s ease;
}
.cf-testimonial-submit .ts-chip svg{color:var(--success)}
.cf-testimonial-submit .ts-chip[data-active=true]{
background:color-mix(in oklch,var(--accent) 12%,var(--card));
border-color:color-mix(in oklch,var(--accent) 40%,var(--card));
}
.cf-testimonial-submit .ts-author{
display:flex;align-items:center;gap:14px;margin-top:24px;padding-top:20px;
border-top:1px solid oklch(from var(--ink) l c h / .12);
}
.cf-testimonial-submit .ts-avatar{
flex:none;width:48px;height:48px;border-radius:50%;overflow:hidden;
display:grid;place-items:center;
background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));
font-family:var(--font-display);font-weight:800;font-size:1.3125rem;line-height:1;
}
.cf-testimonial-submit .ts-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.cf-testimonial-submit .ts-who{display:flex;flex-direction:column;gap:2px;min-width:0}
.cf-testimonial-submit .ts-name{font-size:1.0625rem;line-height:1.3;font-weight:800;color:var(--ink);overflow-wrap:anywhere}
.cf-testimonial-submit .ts-name[data-pending=true]{color:var(--muted);font-weight:600}
.cf-testimonial-submit .ts-role{font-size:.9375rem;line-height:1.4;font-weight:500;color:var(--muted)}
.cf-testimonial-submit .ts-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:900px){
.cf-testimonial-submit .ts-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"steps" "preview" "close"}
.cf-testimonial-submit .ts-preview{position:static;margin:0 0 32px;padding-left:calc(var(--ts-rail) + var(--ts-gap))}
.cf-testimonial-submit .ts-toggle{display:flex;width:100%}
.cf-testimonial-submit .ts-preview[data-open=false] .ts-preview-body{display:none}
.cf-testimonial-submit .ts-preview-body{margin-top:16px}
.cf-testimonial-submit .ts-preview-title{display:none}
.cf-testimonial-submit .ts-stage{padding:0}
.cf-testimonial-submit .ts-scene{display:none}
.cf-testimonial-submit .ts-quote{max-height:none;overflow:visible}
}
@media (max-width:600px){
.cf-testimonial-submit .ts-sign{grid-template-columns:minmax(0,1fr)}
.cf-testimonial-submit .ts-submit{width:100%;min-width:0}
.cf-testimonial-submit .ts-consent{padding:16px}
}
@keyframes ts-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes ts-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){
.cf-testimonial-submit .ts-step,.cf-testimonial-submit .ts-spin{animation:none}
.cf-testimonial-submit *,.cf-testimonial-submit *::before,.cf-testimonial-submit *::after{transition:none !important}
.cf-testimonial-submit .ts-submit:not(:disabled):hover,.cf-testimonial-submit .ts-submit:not(:disabled):active,.cf-testimonial-submit .ts-btn2:active{transform:none}
}
`;
pieces/forms/testimonial-submit/specimen.tsx 70 lines
import __studioImage28357e02 from "../assets/0d85dc8928eb543c.webp";
import { TestimonialSubmit, type TestimonialPrompt } from "../testimonial-submit";
import { slot } from "../../slots";
export const states = ["default", "error", "disabled"];
const prompts: TestimonialPrompt[] = [
{
id: "before",
chapter: "Before",
title: "Where were you before Steady Strength?",
hint: "The ache, the habit or the moment that made you look for help.",
placeholder: "Getting up off the floor meant grabbing the couch, and I'd quit two gyms by February.",
minWords: 20,
maxWords: 70,
},
{
id: "turn",
chapter: "The turn",
title: "When did it click for you?",
hint: "One specific day, lift or moment you knew this was different.",
placeholder: "Week three, I carried the laundry basket upstairs without stopping to rest.",
minWords: 20,
maxWords: 70,
},
{
id: "now",
chapter: "Now",
title: "Where are you now?",
hint: "What can you do today that you couldn't before? Be concrete.",
placeholder: "I train three mornings a week, and my knees haven't flared up since spring.",
minWords: 20,
maxWords: 70,
},
];
const before =
"I'm 52 and my lower back ached every single morning. I'd paid for two gym memberships and stopped going to both by February.";
const turn =
"Week three, I lifted my granddaughter off the floor without bracing on the couch. That was the day I stopped doubting it.";
export default function TestimonialSubmitSpecimen({ state = "default" }: { state?: string }) {
const pieceState = state === "error" || state === "disabled" ? state : "default";
const answers = pieceState === "error" ? { before } : { before, turn };
return (
<TestimonialSubmit
key={pieceState}
state={pieceState}
prompts={prompts}
memberLabel="Steady Strength member"
sceneImage={slot(
"scene",
__studioImage28357e02
)}
sceneAlt=""
defaultValues={{ answers, firstName: pieceState === "error" ? "" : "Dana" }}
copy={{
consentLabel:
"Yes, Steady Strength may publish my story, first name and photo on its website and emails. I can ask for it to be taken down at any time.",
ps: (
<>
<strong>P.S.</strong> Every Steady Strength member gets this same short form, and nothing is offered for a
review. Tell it straight, hard weeks included. That is what helps the next person start.
</>
),
}}
onSubmit={() => undefined}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalTestimonialSubmit |
React.ReactNode |
|
lead OptionalTestimonialSubmit |
React.ReactNode |
|
prompts OptionalTestimonialSubmit |
TestimonialPrompt[] |
|
memberLabel OptionalTestimonialSubmit |
string |
|
sceneImage OptionalTestimonialSubmit |
string |
|
sceneAlt OptionalTestimonialSubmit |
string |
|
defaultValues OptionalTestimonialSubmit |
{ answers?: Record<string, string>; firstName?: string } |
|
copy OptionalTestimonialSubmit |
Partial<TestimonialSubmitCopy> |
|
onSubmit OptionalTestimonialSubmit |
(values: TestimonialSubmitValues) => void | Promise<unknown> |
|
state OptionalTestimonialSubmit |
"default" | "error" | "disabled" |
|
className OptionalTestimonialSubmit |
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-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
0d85dc8928eb543c.webp
image/webp · 128 KB