Quiz Start 7
Starts a quiz: the 60-second promise, what the visitor gets clear on, and question 1 already open on a path that ends at the start button.
Use it in a prompt
Use forms/quiz-start-7 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/quiz-start-7.tsx. - Import it and pass your copy and images (Props tab):
import { QuizStart7 } from "@/components/funneldna/forms/quiz-start-7"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quiz-start-7/component.tsx 735 lines
// layout: path-to-action
// Starts a quiz: the 60-second promise, what the visitor gets clear on, and question 1 already open on a path that ends at the start button.
"use client"
import { useEffect, useId, useRef, useState, type CSSProperties, type FormEvent, type ReactNode } from "react"
import { AlertCircle, Check, Flag, Loader2, Lock } from "lucide-react"
export type QuizStart7Choice = {
value: string
label: string
/** item-n slot image shown beside the answer (layout media only, never proof). */
image?: string
/** Alt text for the answer image; empty when it is decorative. */
imageAlt?: string
}
/** Preview states this piece implements. */
export type QuizStart7State = "default" | "hover" | "active" | "disabled" | "error"
/** Generated labels. Named placeholders in braces are replaced as text. */
export type QuizStart7Copy = {
/** Placeholder: {count} */
stepLabel: string
/** Placeholders: {remaining}, {unit} */
nextStop: string
/** Placeholder: {count}. Path node covering questions 2 to the last. */
rangeLabel: string
/** Placeholders: {count}, {unit}, {durationValue}, {durationUnit} */
ctaSublabel: string
questionSingular: string
questionPlural: string
/** Accessible name of the step path. */
pathLabel: string
}
export type QuizStart7Props = {
/** Templated labels; placeholders are replaced as text. */
copy?: Partial<QuizStart7Copy>
headline?: string
/** One continuous phrase inside the headline that gets the marker stroke. */
highlight?: string
subheadline?: string
/** The real number of questions in the quiz. Drives the labels, the stat and the progress pips. */
questionCount?: number
/** Duration number shown in the stat and the button sublabel. */
durationValue?: string
/** Duration unit shown in the stat and the button sublabel. */
durationUnit?: string
findOutTitle?: string
/** What the visitor gets clear on (three short lines reads best). */
findOut?: ReactNode[]
/** The first question, shown open so starting feels instant. */
question?: string
choices?: QuizStart7Choice[]
ctaLabel?: string
/** Overrides copy.ctaSublabel. */
ctaSublabel?: string
/** Button text while a promise returned by onSubmit is pending. */
loadingLabel?: string
/** Shown when the visitor starts without picking an answer. */
errorText?: string
disabled?: boolean
/** Note under the button while the quiz is disabled. */
disabledText?: string
state?: QuizStart7State
/** Validated first answer. A returned promise shows the loading label. */
onSubmit?: (answer: string) => void | Promise<void>
/** Called with the answer after onSubmit settles (e.g. go to question 2). */
onAction?: (answer: string) => void
className?: string
}
export function QuizStart7({
copy: copyOverrides,
headline = "Take the 60-second quiz",
highlight = "60-second quiz",
subheadline = "Find your next step toward building your first funnel.",
questionCount = 5,
durationValue = "60",
durationUnit = "seconds",
findOutTitle = "You’ll get clear on",
findOut = DEFAULT_FIND_OUT,
question = "What do you need help with first?",
choices = DEFAULT_CHOICES,
ctaLabel = "Start My Quiz",
ctaSublabel,
loadingLabel = "Starting your quiz…",
errorText = "Pick an answer above to start your quiz.",
disabled = false,
disabledText = "This quiz isn’t open right now.",
state = "default",
onSubmit,
onAction,
className = "",
}: QuizStart7Props) {
const copy: QuizStart7Copy = { ...DEFAULT_COPY, ...copyOverrides }
const uid = useId().split(":").join("")
const titleId = `${uid}-title`
const errId = `${uid}-err`
const offId = `${uid}-off`
const count = Number.isFinite(questionCount) ? Math.max(1, Math.round(questionCount)) : 5
const remaining = count - 1
const unit = count === 1 ? copy.questionSingular : copy.questionPlural
const remainingUnit = remaining === 1 ? copy.questionSingular : copy.questionPlural
const firstChoice = choices[0]?.value ?? ""
const [answer, setAnswer] = useState(state === "active" ? firstChoice : "")
const [invalid, setInvalid] = useState(state === "error")
const [loading, setLoading] = useState(false)
const radios = useRef<(HTMLInputElement | null)[]>([])
const mounted = useRef(true)
useEffect(() => {
setAnswer(state === "active" ? firstChoice : "")
setInvalid(state === "error")
setLoading(false)
}, [state, firstChoice])
useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const isDisabled = disabled || state === "disabled"
const picked = choices.find((choice) => choice.value === answer)
const subLine = ctaSublabel ?? fill(copy.ctaSublabel, { count, unit, durationValue, durationUnit })
const btnClass = `qs7-btn${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-press" : ""}`
async function submit(event: FormEvent<HTMLFormElement>) {
event.preventDefault()
if (isDisabled || loading) return
if (!picked) {
setInvalid(true)
radios.current[0]?.focus()
return
}
setInvalid(false)
try {
const result = onSubmit?.(answer)
if (result && typeof (result as Promise<void>).then === "function") {
setLoading(true)
await result
}
onAction?.(answer)
} catch {
// No failure UI here; the caller reports errors.
} finally {
if (mounted.current) setLoading(false)
}
}
return (
<form
className={`cf-quiz-start-7 ${className}`.trim()}
onSubmit={submit}
noValidate
aria-labelledby={titleId}
aria-busy={loading || undefined}
data-answered={picked ? "true" : undefined}
>
<style>{CSS}</style>
<div className="qs7-grid">
<header className="qs7-head">
<h2 id={titleId} className="qs7-title">
{renderHeadline(headline, highlight)}
</h2>
{subheadline ? <p className="qs7-sub">{subheadline}</p> : null}
</header>
<ol className="qs7-path" aria-label={copy.pathLabel}>
<li className={`qs7-stop is-now${picked ? " is-done" : ""}`} style={delay(0)}>
<span className="qs7-node" aria-hidden="true">
{picked ? <Check /> : "1"}
</span>
<fieldset className={`qs7-q${invalid ? " is-invalid" : ""}`} disabled={isDisabled}>
<legend className="qs7-legend">
<span className="qs7-step">{fill(copy.stepLabel, { count })}</span>
<h3 className="qs7-question">{question}</h3>
</legend>
<div className="qs7-choices">
{choices.map((choice, index) => {
const on = answer === choice.value
return (
<label key={choice.value} className={`qs7-choice${on ? " is-on" : ""}${choice.image ? " has-thumb" : ""}`}>
<input
ref={(node) => {
radios.current[index] = node
}}
className="qs7-sr"
type="radio"
name={`${uid}-answer`}
value={choice.value}
checked={on}
aria-describedby={invalid ? errId : undefined}
onChange={() => {
setAnswer(choice.value)
setInvalid(false)
}}
/>
{choice.image ? (
<img className="qs7-thumb" src={choice.image} alt={choice.imageAlt ?? ""} width={56} height={56} loading="lazy" decoding="async" />
) : null}
<span className="qs7-label">{choice.label}</span>
<span className="qs7-dot" aria-hidden="true">
<Check />
</span>
</label>
)
})}
</div>
{invalid ? (
<p id={errId} className="qs7-error" role="alert">
<AlertCircle aria-hidden="true" />
<span>{errorText}</span>
</p>
) : null}
</fieldset>
</li>
{remaining > 0 ? (
<li className="qs7-stop is-next" style={delay(1)}>
<span className={`qs7-node${remaining > 1 ? " is-range" : ""}`} aria-hidden="true">
{remaining > 1 ? fill(copy.rangeLabel, { count }) : "2"}
</span>
<div className="qs7-next">
<p className="qs7-next-text">{fill(copy.nextStop, { remaining, unit: remainingUnit })}</p>
<span className="qs7-pips" aria-hidden="true">
{Array.from({ length: Math.min(count, MAX_PIPS) }, (_, i) => (
<span key={i} className={`qs7-pip${i === 0 && picked ? " is-on" : ""}`} />
))}
</span>
</div>
</li>
) : null}
<li className="qs7-stop is-go" style={delay(2)}>
<span className="qs7-node" aria-hidden="true">
<Flag />
</span>
<div className="qs7-go">
<button type="submit" className={btnClass} disabled={isDisabled} aria-describedby={isDisabled ? offId : undefined}>
<span className="qs7-btn-main">
{loading ? <Loader2 className="qs7-spin" aria-hidden="true" /> : null}
{loading ? loadingLabel : ctaLabel}
</span>
<span className="qs7-btn-sub">{subLine}</span>
</button>
{isDisabled ? (
<p id={offId} className="qs7-closed">
<Lock aria-hidden="true" />
<span>{disabledText}</span>
</p>
) : null}
</div>
</li>
</ol>
<div className="qs7-block">
<div className="qs7-stats">
<p className="qs7-stat">
<span className="qs7-num">{count}</span>
<span className="qs7-unit">{unit}</span>
</p>
<p className="qs7-stat">
<span className="qs7-num">{durationValue}</span>
<span className="qs7-unit">{durationUnit}</span>
</p>
</div>
{findOut.length ? (
<>
<p className="qs7-block-title">{findOutTitle}</p>
<ul className="qs7-find">
{findOut.map((line, index) => (
<li key={index}>{line}</li>
))}
</ul>
</>
) : null}
</div>
</div>
</form>
)
}
export default QuizStart7
const DEFAULT_COPY: QuizStart7Copy = {
stepLabel: "Question 1 of {count}",
nextStop: "Then {remaining} more one-tap {unit}",
rangeLabel: "2–{count}",
ctaSublabel: "{count} {unit} · about {durationValue} {durationUnit}",
questionSingular: "question",
questionPlural: "questions",
pathLabel: "Your quiz, step by step",
}
const DEFAULT_CHOICES: QuizStart7Choice[] = [
{ value: "planning", label: "Planning my funnel" },
{ value: "copy", label: "Writing my page copy" },
{ value: "launch", label: "Getting ready to launch" },
]
const DEFAULT_FIND_OUT: ReactNode[] = ["Your offer.", "Your copy.", "Your launch plan."]
/** Progress pips stop growing past this many questions. */
const MAX_PIPS = 12
/** Staggered entrance index for a path stop (read by the scoped CSS as --d). */
function delay(index: number): CSSProperties {
return { "--d": index } as CSSProperties
}
/** Replaces named {placeholders} in a copy template with text. */
function fill(template: string, values: Record<string, string | number>) {
return Object.entries(values).reduce((out, [key, value]) => out.split("{" + key + "}").join(String(value)), template)
}
/** Wraps the first occurrence of the highlight phrase in the marker stroke. */
function renderHeadline(headline: string, highlight?: string): ReactNode {
if (!highlight) return headline
const at = headline.indexOf(highlight)
if (at < 0) return headline
return (
<>
{headline.slice(0, at)}
<span className="qs7-mark">{highlight}</span>
{headline.slice(at + highlight.length)}
</>
)
}
/*
* Theme notes: every colour reads the contract tokens. Hex appears only as the last var() fallback.
* The marker default (#fae37c) is the documented yellow highlighter exception. Shadows are built
* on --shadow (dark, band-tinted) through the scoped --qs7-sh; no shadow colour uses a light token.
* The answer radios are visually hidden; their native accent-color and the tile focus ring read --field-focus.
* The reduced-motion block keeps `!important`: the transitions it cancels are declared on two-class
* selectors (.cf-quiz-start-7 .qs7-choice, .qs7-btn, .qs7-dot, .qs7-pip, stop ::after) that outrank
* the universal `.cf-quiz-start-7 *` reset, so dropping it would let them run under reduced motion.
*/
const CSS = `
.cf-quiz-start-7 {
--qs7-m: 2.5rem;
--qs7-gap: 1rem;
--qs7-btn: 4.5rem;
--qs7-rail: oklch(from var(--ink, #101828) l c h / 0.2);
--qs7-mark: var(--marker, #fae37c);
--qs7-r: var(--radius, 14px);
--qs7-sh: var(--shadow, oklch(0.22 0.03 256));
container-type: inline-size;
position: relative;
box-sizing: border-box;
width: 100%;
max-width: 72rem;
margin-inline: auto;
background: var(--card, #ffffff);
color: var(--ink, #101828);
border: 1px solid var(--card-border, color-mix(in oklch, var(--ink, #101828) 12%, transparent));
border-radius: var(--card-radius, var(--qs7-r));
box-shadow: var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--qs7-sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--qs7-sh) l c h / 0.32)));
font-family: var(--font-body, system-ui, sans-serif);
font-size: 1rem;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
.cf-quiz-start-7 *, .cf-quiz-start-7 *::before, .cf-quiz-start-7 *::after { box-sizing: border-box; }
.cf-quiz-start-7 :where(h2, h3, p, ol, ul, li, fieldset, legend) { margin: 0; padding: 0; }
.cf-quiz-start-7 :where(ol, ul) { list-style: none; }
.cf-quiz-start-7 fieldset { border: 0; min-inline-size: 0; }
.cf-quiz-start-7 legend { display: block; width: 100%; float: none; }
.cf-quiz-start-7 button { font: inherit; }
.cf-quiz-start-7 .qs7-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; accent-color: var(--field-focus, var(--accent, #2563eb)); }
.cf-quiz-start-7 .qs7-grid {
display: grid;
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "head" "path" "block";
gap: 2rem;
padding: clamp(1.25rem, 5cqi, 3.25rem);
}
.cf-quiz-start-7 .qs7-head { grid-area: head; min-width: 0; }
.cf-quiz-start-7 .qs7-path { grid-area: path; min-width: 0; }
.cf-quiz-start-7 .qs7-block { grid-area: block; min-width: 0; }
.cf-quiz-start-7 .qs7-title {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.025em);
font-size: clamp(2.125rem, 8.4cqi, 3.25rem);
line-height: 1.03;
color: var(--ink, #101828);
text-wrap: balance;
}
.cf-quiz-start-7 .qs7-mark {
background-image: linear-gradient(oklch(from var(--qs7-mark) l c h / 0.85), oklch(from var(--qs7-mark) l c h / 0.85));
background-repeat: no-repeat;
background-size: 100% 0.52em;
background-position: 0 88%;
padding-inline: 0.08em;
margin-inline: -0.04em;
border-radius: 0.18em 0.08em 0.22em 0.1em;
-webkit-box-decoration-break: clone;
box-decoration-break: clone;
}
.cf-quiz-start-7 .qs7-sub {
margin-top: 1.125rem;
max-width: 36ch;
font-size: clamp(1.125rem, 2.2cqi, 1.375rem);
font-weight: 500;
line-height: 1.4;
color: var(--muted, #475467);
text-wrap: pretty;
}
.cf-quiz-start-7 .qs7-block {
position: relative;
overflow: hidden;
padding: clamp(1.25rem, 3.4cqi, 2rem);
border-radius: calc(var(--card-radius, var(--qs7-r)) * 0.75);
background: var(--band, #1b2a4a);
color: var(--band-ink, #ffffff);
box-shadow: inset 0 1px 0 oklch(from var(--band-ink, #ffffff) l c h / 0.12);
}
.cf-quiz-start-7 .qs7-stats { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.cf-quiz-start-7 .qs7-stat { display: block; }
.cf-quiz-start-7 .qs7-num {
display: block;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: clamp(2.75rem, 6cqi, 3.75rem);
line-height: 1;
letter-spacing: -0.03em;
font-variant-numeric: tabular-nums;
}
.cf-quiz-start-7 .qs7-unit { display: block; margin-top: 0.75rem; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.cf-quiz-start-7 .qs7-block-title { margin-top: 1.75rem; margin-bottom: 0.5rem; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.cf-quiz-start-7 .qs7-find li {
padding-block: 0.625rem;
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: clamp(1.375rem, 3cqi, 1.75rem);
line-height: 1.2;
letter-spacing: -0.01em;
text-wrap: balance;
}
.cf-quiz-start-7 .qs7-find li + li { border-top: 1px solid oklch(from var(--band-ink, #ffffff) l c h / 0.2); }
.cf-quiz-start-7 .qs7-find li:last-child { padding-bottom: 0; }
.cf-quiz-start-7 .qs7-stop {
position: relative;
display: grid;
grid-template-columns: var(--qs7-m) minmax(0, 1fr);
column-gap: var(--qs7-gap);
align-items: start;
padding-bottom: 1.5rem;
}
.cf-quiz-start-7 .qs7-stop:last-child { padding-bottom: 0; }
.cf-quiz-start-7 .qs7-stop:not(:last-child)::before,
.cf-quiz-start-7 .qs7-stop:not(:last-child)::after {
content: "";
position: absolute;
left: calc(var(--qs7-m) / 2 - 1px);
top: calc(var(--qs7-m) + 6px);
bottom: 6px;
width: 2px;
border-radius: 2px;
}
.cf-quiz-start-7 .qs7-stop:not(:last-child)::before { background: repeating-linear-gradient(to bottom, var(--qs7-rail) 0 6px, transparent 6px 12px); }
.cf-quiz-start-7 .qs7-stop:not(:last-child)::after {
background: var(--accent-fill, var(--accent, #2563eb));
transform: scaleY(0);
transform-origin: top;
transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cf-quiz-start-7 .qs7-stop:nth-last-child(2)::before,
.cf-quiz-start-7 .qs7-stop:nth-last-child(2)::after { bottom: calc(6px - (var(--qs7-btn) - var(--qs7-m)) / 2); }
.cf-quiz-start-7[data-answered] .qs7-stop.is-now::after { transform: scaleY(1); }
.cf-quiz-start-7 .qs7-node {
position: relative;
z-index: 1;
display: grid;
place-items: center;
width: var(--qs7-m);
height: var(--qs7-m);
border-radius: 999px;
background: color-mix(in oklch, var(--ink, #101828) 6%, var(--card, #ffffff));
color: var(--ink, #101828);
box-shadow: inset 0 0 0 1px oklch(from var(--ink, #101828) l c h / 0.14);
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
font-size: 1rem;
line-height: 1;
font-variant-numeric: tabular-nums;
}
.cf-quiz-start-7 .qs7-node.is-range { font-size: 0.8125rem; letter-spacing: -0.02em; }
.cf-quiz-start-7 .qs7-node svg { width: 1.125rem; height: 1.125rem; stroke-width: 2.5; }
.cf-quiz-start-7 .is-now .qs7-node {
background: var(--accent-fill, var(--accent, #2563eb));
color: var(--accent-fill-ink, var(--card, #ffffff));
box-shadow: 0 0 0 5px oklch(from var(--accent-fill, var(--accent, #2563eb)) l c h / 0.16);
}
.cf-quiz-start-7 .is-now .qs7-node svg { stroke-width: 3; }
.cf-quiz-start-7 .is-go .qs7-node {
margin-top: calc((var(--qs7-btn) - var(--qs7-m)) / 2);
background: var(--band, #1b2a4a);
color: var(--band-ink, #ffffff);
box-shadow: none;
}
.cf-quiz-start-7 .qs7-step {
display: block;
padding-top: 0.55rem;
margin-bottom: 0.75rem;
font-size: 1rem;
font-weight: 700;
line-height: 1.3;
color: var(--accent, #2563eb);
}
.cf-quiz-start-7 .qs7-question {
font-family: var(--font-display, inherit);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
font-size: clamp(1.5rem, 3.2cqi, 2rem);
line-height: 1.12;
letter-spacing: -0.015em;
color: var(--ink, #101828);
text-wrap: balance;
}
.cf-quiz-start-7 .qs7-choices { display: grid; gap: 0.625rem; margin-top: 1.125rem; }
.cf-quiz-start-7 .qs7-choice {
position: relative;
display: flex;
align-items: center;
gap: 0.875rem;
min-height: 4rem;
padding: 0.625rem 0.875rem 0.625rem 1rem;
border-radius: calc(var(--qs7-r) * 0.8);
background: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff));
box-shadow: inset 0 0 0 1px oklch(from var(--ink, #101828) l c h / 0.12);
color: var(--ink, #101828);
cursor: pointer;
transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.cf-quiz-start-7 .qs7-choice.has-thumb { padding-left: 0.625rem; }
.cf-quiz-start-7 .qs7-choice:hover {
background: color-mix(in oklch, var(--ink, #101828) 7%, var(--card, #ffffff));
box-shadow: inset 0 0 0 1px oklch(from var(--ink, #101828) l c h / 0.32);
}
.cf-quiz-start-7 .qs7-choice.is-on {
background: color-mix(in oklch, var(--accent, #2563eb) 10%, var(--card, #ffffff));
box-shadow: inset 0 0 0 2px var(--accent, #2563eb), var(--shadow-sm, 0 1px 1px oklch(from var(--qs7-sh) l c h / 0.18), 0 1px 3px oklch(from var(--qs7-sh) l c h / 0.14));
transform: translateY(-1px);
}
.cf-quiz-start-7 .qs7-choice:has(input:focus-visible) { outline: 3px solid var(--field-focus, var(--accent, #2563eb)); outline-offset: 2px; }
.cf-quiz-start-7 .qs7-q.is-invalid .qs7-choice { box-shadow: inset 0 0 0 1px var(--danger, #b42318); }
.cf-quiz-start-7 .qs7-q:disabled .qs7-choice { cursor: not-allowed; transform: none; }
.cf-quiz-start-7 .qs7-q:disabled .qs7-choice:hover { background: color-mix(in oklch, var(--ink, #101828) 4%, var(--card, #ffffff)); box-shadow: inset 0 0 0 1px oklch(from var(--ink, #101828) l c h / 0.12); }
.cf-quiz-start-7 .qs7-thumb {
flex: none;
width: 3rem;
height: 3rem;
object-fit: cover;
object-position: center;
border-radius: calc(var(--qs7-r) * 0.5);
}
.cf-quiz-start-7 .qs7-label { flex: 1; min-width: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.25; text-wrap: pretty; }
.cf-quiz-start-7 .qs7-dot {
flex: none;
display: grid;
place-items: center;
width: 1.5rem;
height: 1.5rem;
border-radius: 999px;
color: transparent;
box-shadow: inset 0 0 0 2px oklch(from var(--ink, #101828) l c h / 0.4);
transition: background-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.cf-quiz-start-7 .qs7-dot svg { width: 0.875rem; height: 0.875rem; stroke-width: 3.25; }
.cf-quiz-start-7 .qs7-choice.is-on .qs7-dot { background: var(--accent, #2563eb); color: var(--card, #ffffff); box-shadow: none; }
.cf-quiz-start-7 .qs7-error {
display: flex;
align-items: flex-start;
gap: 0.5rem;
margin-top: 0.75rem;
padding: 0.625rem 0.875rem;
border-radius: calc(var(--qs7-r) * 0.6);
background: var(--danger-soft, oklch(0.93 0.024 27));
color: var(--danger, #b42318);
font-size: 1rem;
font-weight: 600;
line-height: 1.35;
text-wrap: pretty;
}
.cf-quiz-start-7 .qs7-error svg { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.1em; }
.cf-quiz-start-7 .qs7-next { padding-top: 0.55rem; }
.cf-quiz-start-7 .qs7-next-text { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; color: var(--ink, #101828); text-wrap: pretty; }
.cf-quiz-start-7 .qs7-pips { display: flex; gap: 0.375rem; margin-top: 0.75rem; }
.cf-quiz-start-7 .qs7-pip {
flex: 1;
max-width: 2.75rem;
height: 0.375rem;
border-radius: 999px;
background: color-mix(in oklch, var(--ink, #101828) 14%, var(--card, #ffffff));
transition: background-color 0.3s ease;
}
.cf-quiz-start-7 .qs7-pip.is-on { background: var(--accent-fill, var(--accent, #2563eb)); }
.cf-quiz-start-7 .qs7-go { min-width: 0; }
.cf-quiz-start-7 .qs7-btn {
--qs7-b: var(--button-bg, var(--cta, #d92d20));
--qs7-b2: var(--button-bg-2, var(--cta-2, #b42318));
appearance: none;
border: 0;
width: 100%;
min-height: var(--qs7-btn);
padding: 0.75rem 1.25rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.2rem;
text-align: center;
border-radius: var(--button-radius, var(--qs7-r));
background: linear-gradient(180deg, oklch(from var(--qs7-b) calc(l + 0.04) c h), oklch(from var(--qs7-b2) l c h));
color: var(--button-ink, var(--cta-ink, #ffffff));
font-family: var(--button-font, var(--font-display, inherit));
text-transform: var(--button-case, none);
text-shadow: var(--button-text-shadow, none);
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--qs7-b) calc(l + 0.14) c h / 0.7), inset 0 -3px 0 oklch(from var(--qs7-b2) calc(l - 0.1) c h), var(--shadow-md, 0 1px 2px oklch(from var(--qs7-sh) l c h / 0.22), 0 4px 10px -2px oklch(from var(--qs7-sh) l c h / 0.2)));
cursor: pointer;
transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.cf-quiz-start-7 .qs7-btn:not(:disabled):hover,
.cf-quiz-start-7 .qs7-btn.is-hover:not(:disabled) {
background: linear-gradient(180deg, oklch(from var(--qs7-b) calc(l - 0.01) c h), oklch(from var(--qs7-b2) calc(l - 0.05) c h));
box-shadow: var(--button-shadow, inset 0 1px 0 oklch(from var(--qs7-b) calc(l + 0.12) c h / 0.6), inset 0 -3px 0 oklch(from var(--qs7-b2) calc(l - 0.14) c h), var(--shadow-lg, 0 2px 4px oklch(from var(--qs7-sh) l c h / 0.22), 0 12px 24px -8px oklch(from var(--qs7-sh) l c h / 0.32)));
transform: translateY(-1px);
}
.cf-quiz-start-7 .qs7-btn:not(:disabled):active,
.cf-quiz-start-7 .qs7-btn.is-press:not(:disabled) {
background: linear-gradient(180deg, oklch(from var(--qs7-b) calc(l - 0.05) c h), oklch(from var(--qs7-b2) calc(l - 0.08) c h));
box-shadow: inset 0 1px 0 oklch(from var(--qs7-b) calc(l + 0.06) c h / 0.5), inset 0 -1px 0 oklch(from var(--qs7-b2) calc(l - 0.14) c h), var(--shadow-sm, 0 1px 1px oklch(from var(--qs7-sh) l c h / 0.18), 0 1px 3px oklch(from var(--qs7-sh) l c h / 0.14));
transform: translateY(1px);
}
.cf-quiz-start-7 .qs7-btn:focus-visible { outline: 3px solid var(--field-focus, var(--accent, #2563eb)); outline-offset: 3px; }
.cf-quiz-start-7 .qs7-btn:disabled {
background: var(--button-2-bg, var(--secondary, #e9edf3));
color: var(--button-2-ink, var(--secondary-ink, #101828));
text-shadow: none;
box-shadow: var(--button-2-shadow, var(--shadow-sm));
cursor: not-allowed;
transform: none;
}
.cf-quiz-start-7 .qs7-btn-main {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
font-weight: var(--button-weight, 800);
font-size: clamp(1.25rem, 2.6cqi, 1.5rem);
line-height: 1.15;
letter-spacing: -0.01em;
}
.cf-quiz-start-7 .qs7-btn-sub {
font-family: var(--font-body, inherit);
font-weight: 600;
font-size: 0.9375rem;
line-height: 1.25;
text-transform: none;
text-wrap: pretty;
}
.cf-quiz-start-7 .qs7-spin { width: 1.25rem; height: 1.25rem; flex: none; }
.cf-quiz-start-7 .qs7-closed {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
margin-top: 0.75rem;
font-size: 1rem;
font-weight: 500;
color: var(--muted, #475467);
text-align: center;
text-wrap: pretty;
}
.cf-quiz-start-7 .qs7-closed svg { flex: none; width: 1rem; height: 1rem; }
@container (min-width: 46rem) {
.cf-quiz-start-7 .qs7-grid {
grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
grid-template-rows: auto 1fr;
grid-template-areas: "head path" "block path";
column-gap: clamp(2rem, 5cqi, 4rem);
row-gap: 2rem;
align-items: start;
}
.cf-quiz-start-7 .qs7-title { font-size: clamp(2.125rem, 4.7cqi, 3.5rem); }
}
@container (max-width: 32rem) {
.cf-quiz-start-7 .qs7-grid { gap: 1.75rem; }
.cf-quiz-start-7 .qs7-path { --qs7-m: 2.125rem; --qs7-gap: 0.75rem; --qs7-btn: 4.25rem; }
.cf-quiz-start-7 .qs7-step { padding-top: 0.4rem; }
.cf-quiz-start-7 .qs7-next { padding-top: 0.4rem; }
.cf-quiz-start-7 .qs7-choice { min-height: 3.5rem; gap: 0.75rem; padding-right: 0.75rem; }
.cf-quiz-start-7 .qs7-thumb { width: 2.5rem; height: 2.5rem; }
.cf-quiz-start-7 .qs7-label { font-size: 1rem; }
.cf-quiz-start-7 .qs7-btn { padding-inline: 0.875rem; }
.cf-quiz-start-7 .qs7-btn-main { font-size: 1.25rem; }
.cf-quiz-start-7 .qs7-stats { gap: 1rem 2rem; }
}
@keyframes qs7-in { from { opacity: 0.82; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes qs7-draw { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes qs7-sweep { from { background-size: 0 0.52em; } to { background-size: 100% 0.52em; } }
@keyframes qs7-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
.cf-quiz-start-7 .qs7-stop { animation: qs7-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--d, 0) * 90ms); }
.cf-quiz-start-7 .qs7-stop:not(:last-child)::before { transform-origin: top; animation: qs7-draw 0.6s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.cf-quiz-start-7 .qs7-mark { animation: qs7-sweep 0.7s 0.15s cubic-bezier(0.3, 0.7, 0.2, 1) both; }
.cf-quiz-start-7 .qs7-spin { animation: qs7-spin 0.9s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
.cf-quiz-start-7 *, .cf-quiz-start-7 *::before, .cf-quiz-start-7 *::after { animation: none !important; transition: none !important; }
.cf-quiz-start-7 .qs7-choice.is-on,
.cf-quiz-start-7 .qs7-btn:not(:disabled):hover,
.cf-quiz-start-7 .qs7-btn.is-hover:not(:disabled),
.cf-quiz-start-7 .qs7-btn:not(:disabled):active,
.cf-quiz-start-7 .qs7-btn.is-press:not(:disabled) { transform: none; }
}
`
pieces/forms/quiz-start-7/specimen.tsx 28 lines
import defaults from "../../studio-defaults.json"
import { slot } from "../../slots"
import { QuizStart7, type QuizStart7State } from "../quiz-start-7"
export const states = ["default", "hover", "active", "disabled", "error"]
export default function QuizStart7Specimen({ state = "default" }: { state?: QuizStart7State }) {
const items = defaults.sample.items
return (
<QuizStart7
state={state}
headline="Take the 60-second quiz"
highlight="60-second quiz"
subheadline="Find your next step toward building your first funnel."
questionCount={5}
durationValue="60"
durationUnit="seconds"
findOut={["Your offer.", "Your copy.", "Your launch plan."]}
question="What do you need help with first?"
choices={[
{ value: "planning", label: "Planning my funnel", image: slot("item-1", items[0].image), imageAlt: "" },
{ value: "copy", label: "Writing my page copy", image: slot("item-2", items[1].image), imageAlt: "" },
{ value: "launch", label: "Getting ready to launch", image: slot("item-3", items[2].image), imageAlt: "" },
]}
ctaLabel="Start My Quiz"
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalQuizStart7 |
Partial<QuizStart7Copy> |
|
headline OptionalQuizStart7 |
string |
Default "Take the 60-second quiz"
|
highlight OptionalQuizStart7 |
string |
Default "60-second quiz"
|
subheadline OptionalQuizStart7 |
string |
Default "Find your next step toward building your first funnel."
|
questionCount OptionalQuizStart7 |
number |
Default 5
|
durationValue OptionalQuizStart7 |
string |
Default "60"
|
durationUnit OptionalQuizStart7 |
string |
Default "seconds"
|
findOutTitle OptionalQuizStart7 |
string |
Default "You’ll get clear on"
|
findOut OptionalQuizStart7 |
ReactNode[] |
Default DEFAULT_FIND_OUT
|
question OptionalQuizStart7 |
string |
Default "What do you need help with first?"
|
choices OptionalQuizStart7 |
QuizStart7Choice[] |
Default DEFAULT_CHOICES
|
ctaLabel OptionalQuizStart7 |
string |
Default "Start My Quiz"
|
ctaSublabel OptionalQuizStart7 |
string |
|
loadingLabel OptionalQuizStart7 |
string |
Default "Starting your quiz…"
|
errorText OptionalQuizStart7 |
string |
Default "Pick an answer above to start your quiz."
|
disabled OptionalQuizStart7 |
boolean |
Default false
|
disabledText OptionalQuizStart7 |
string |
Default "This quiz isn’t open right now."
|
state OptionalQuizStart7 |
QuizStart7State |
Default "default"
|
onSubmit OptionalQuizStart7 |
(answer: string) => void | Promise<void> |
|
onAction OptionalQuizStart7 |
(answer: string) => void |
|
className OptionalQuizStart7 |
string |
Default ""
|
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--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-focus- 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.
item-1- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-2- One image per offer item (item-1, item-2…), shown in stacks and lists.
item-3- One image per offer item (item-1, item-2…), shown in stacks and lists.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB