Quiz Start 8
Starts a quiz on a dark stage. Every question is a step rising to an accent-capped result, and question 1 is already open, so starting takes one tap.
Use it in a prompt
Use forms/quiz-start-8 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-8.tsx. - Import it and pass your copy and images (Props tab):
import { QuizStart8 } from "@/components/funneldna/forms/quiz-start-8"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/quiz-start-8/component.tsx 725 lines
// layout: price-staircase
// Starts a quiz on a dark stage. Every question is a step rising to an accent-capped result, and question 1 is already open, so starting takes one tap.
"use client"
import { useEffect, useId, useRef, useState, type CSSProperties, type FormEvent } from "react"
import { AlertCircle, Check, Loader2 } from "lucide-react"
export type QuizChoice = {
value: string
label: string
/** Optional short line under the answer. */
detail?: string
}
/** "hover" and "active" force the button's look. "active" also picks the first answer. */
export type QuizStart8State = "default" | "hover" | "active" | "disabled" | "error"
/** Generated labels. Templates take named placeholders that are replaced as text. */
export type QuizStart8Copy = {
/** Caps label above the open question. {count} is the real number of questions. */
questionLabel: string
/** Screen-reader summary of the staircase. {count} as above. */
stairsLabel: string
/** Button label when the quiz has more questions. {next} is 2. */
ctaNext: string
/** Button label for a one-question quiz. */
ctaFinal: string
/** Keycap letters shown on the answers, in order. */
keyLetters: string
}
export type QuizStart8Props = {
/** Templates accept {count} and {next} as text. */
copy?: Partial<QuizStart8Copy>
headline?: string
/** One continuous phrase inside the headline that gets the metallic accent finish. */
highlight?: string
subheadline?: string
/** The real number of questions. Drives the staircase and the question label. */
questionCount?: number
/** Heading on the result step at the top of the staircase. */
resultTitle?: string
/** What the visitor finds out. Three short lines is ideal. */
findOut?: string[]
/** The first question, open so starting feels instant. */
question?: string
/** One short instruction under the question. */
nudge?: string
choices?: QuizChoice[]
/** Overrides the computed "Take Me To Question 2" label. */
ctaLabel?: string
/** Button label while a returned onSubmit promise is pending. */
loadingLabel?: string
/** One short line under the button. */
reassurance?: string
/** Shown when the visitor submits without picking an answer. */
errorText?: string
disabled?: boolean
/** Replaces the reassurance line while the quiz is disabled. */
disabledText?: string
/** 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. to show question 2. */
onAction?: (answer: string) => void
state?: QuizStart8State
className?: string
}
export function QuizStart8({
copy: copyOverrides,
headline = "Take the 60-second quiz",
highlight = "60-second",
subheadline = "Find your next step toward your first funnel.",
questionCount = 5,
resultTitle = "Your next step",
findOut = DEFAULT_FIND_OUT,
question = "What do you need help with first?",
nudge = "Tap the answer that fits you best.",
choices = DEFAULT_CHOICES,
ctaLabel,
loadingLabel = "Opening your quiz…",
reassurance = "One tap per question · About 60 seconds",
errorText = "Pick an answer above to take your first step.",
disabled = false,
disabledText = "This quiz isn’t open right now.",
onSubmit,
onAction,
state = "default",
className = "",
}: QuizStart8Props) {
const copy: QuizStart8Copy = { ...DEFAULT_COPY, ...copyOverrides }
const uid = useId().replace(/:/g, "")
const count = Number.isFinite(questionCount) ? Math.max(1, Math.round(questionCount)) : 5
const firstChoice = choices[0]?.value ?? ""
const [answer, setAnswer] = useState(state === "active" ? firstChoice : "")
const [loading, setLoading] = useState(false)
const [invalid, setInvalid] = useState(state === "error")
const radios = useRef<(HTMLInputElement | null)[]>([])
const mounted = useRef(true)
useEffect(() => {
setAnswer(state === "active" ? firstChoice : "")
setLoading(false)
setInvalid(state === "error")
}, [state, firstChoice])
useEffect(() => {
mounted.current = true
return () => {
mounted.current = false
}
}, [])
const isDisabled = disabled || state === "disabled"
const picked = choices.some((choice) => choice.value === answer)
const shown = Math.min(count, 8)
const steps = Array.from({ length: shown }, (_, index) => (index === shown - 1 ? count : index + 1))
const [before, gilded, after] = splitHighlight(headline, highlight)
const buttonLabel = ctaLabel ?? (count > 1 ? fillTemplate(copy.ctaNext, { next: 2 }) : copy.ctaFinal)
const titleId = `${uid}-title`
const qId = `${uid}-question`
const errId = `${uid}-error`
const groupName = `${uid}-answer`
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 (isThenable(result)) {
setLoading(true)
await result
}
onAction?.(answer)
} catch {
// The caller reports failures; this piece only resets its button.
} finally {
if (mounted.current) setLoading(false)
}
}
const btnClass = `qs8-btn${state === "hover" ? " is-hover" : ""}${state === "active" ? " is-press" : ""}`
return (
<form
className={`cf-quiz-start-8 ${className}`.trim()}
onSubmit={submit}
noValidate
aria-labelledby={titleId}
aria-busy={loading || undefined}
>
<style>{CSS}</style>
<div className="qs8-stage" data-answered={picked ? "" : undefined}>
<div className="qs8-hero">
<h2 id={titleId} className="qs8-title">
{before}
{gilded && <span className="qs8-gild">{gilded}</span>}
{after}
</h2>
{subheadline && <p className="qs8-sub">{subheadline}</p>}
</div>
<div className="qs8-stairs" style={{ "--n": shown } as CSSProperties} data-dense={shown > 6 ? "" : undefined}>
<p className="qs8-sr">{fillTemplate(copy.stairsLabel, { count })}</p>
{steps.map((num, index) => (
<span
key={`${num}-${index}`}
aria-hidden="true"
className={`qs8-riser${index === 0 ? " is-here" : ""}`}
style={{ "--i": index + 1 } as CSSProperties}
>
<span className="qs8-riser-num">{index === 0 && picked ? <Check /> : num}</span>
</span>
))}
<div className="qs8-summit">
<div className="qs8-summit-body">
<p className="qs8-summit-title">{resultTitle}</p>
{findOut.length > 0 && (
<ul className="qs8-finds">
{findOut.map((item) => (
<li key={item}>
<Check aria-hidden="true" />
<span>{item}</span>
</li>
))}
</ul>
)}
</div>
</div>
</div>
<div className="qs8-ground" aria-hidden="true" />
<div className="qs8-ask">
<p className="qs8-label">{fillTemplate(copy.questionLabel, { count })}</p>
<h3 id={qId} className="qs8-question">
{question}
</h3>
{nudge && <p className="qs8-nudge">{nudge}</p>}
</div>
<div className="qs8-answer">
<fieldset
className="qs8-choices"
aria-labelledby={qId}
aria-describedby={invalid ? errId : undefined}
disabled={isDisabled}
>
{choices.map((choice, index) => {
const on = answer === choice.value
const letter = copy.keyLetters.charAt(index)
return (
<label
key={choice.value}
className={`qs8-choice${on ? " is-on" : ""}${invalid ? " is-invalid" : ""}`}
>
<input
ref={(element) => {
radios.current[index] = element
}}
className="qs8-input"
type="radio"
name={groupName}
value={choice.value}
checked={on}
aria-invalid={invalid || undefined}
onChange={() => {
setAnswer(choice.value)
setInvalid(false)
}}
/>
<span className="qs8-ring" aria-hidden="true" />
<span className="qs8-choice-text">
<span className="qs8-choice-label">{choice.label}</span>
{choice.detail && <span className="qs8-choice-detail">{choice.detail}</span>}
</span>
{letter && (
<span className="qs8-key" aria-hidden="true">
{letter}
</span>
)}
</label>
)
})}
</fieldset>
{invalid && (
<p id={errId} className="qs8-error" role="alert">
<AlertCircle aria-hidden="true" />
<span>{errorText}</span>
</p>
)}
<button type="submit" className={btnClass} disabled={isDisabled} aria-disabled={loading || undefined}>
{loading ? (
<>
<Loader2 className="qs8-spin" aria-hidden="true" />
<span className="qs8-btn-label">{loadingLabel}</span>
</>
) : (
<span className="qs8-btn-label">{buttonLabel}</span>
)}
</button>
<p className="qs8-reassure" role={isDisabled ? "status" : undefined}>
{isDisabled ? disabledText : reassurance}
</p>
</div>
</div>
</form>
)
}
export default QuizStart8
const DEFAULT_COPY: QuizStart8Copy = {
questionLabel: "Question 1 of {count}",
stairsLabel: "{count} questions, then your result",
ctaNext: "Take Me To Question {next}",
ctaFinal: "Show Me My Result",
keyLetters: "ABCDEFGH",
}
const DEFAULT_CHOICES: QuizChoice[] = [
{ value: "planning", label: "Planning my funnel" },
{ value: "copy", label: "Writing my page copy" },
{ value: "launch", label: "Getting ready to launch" },
]
const DEFAULT_FIND_OUT = ["Where your funnel plan stands", "What your page copy needs", "What to check before launch"]
/** Replaces each {name} placeholder in a copy template with its value, as text. */
function fillTemplate(template: string, values: Record<string, string | number>) {
let out = template
for (const key of Object.keys(values)) out = out.split(`{${key}}`).join(String(values[key]))
return out
}
function splitHighlight(headline: string, highlight?: string): [string, string, string] {
const index = highlight ? headline.indexOf(highlight) : -1
if (!highlight || index < 0) return [headline, "", ""]
return [headline.slice(0, index), highlight, headline.slice(index + highlight.length)]
}
function isThenable(value: unknown): value is Promise<void> {
return Boolean(value) && typeof (value as Promise<void>).then === "function"
}
/*
* Theme notes
* - The stage is a band: text uses --band-ink, never --ink.
* - The signature metal (--qs8-gold) is the theme accent pulled toward the band ink in oklab, so it always
* reads against the band (lighter on a dark band, deeper on a strong light band) and follows the brand hue.
* Override with the component-scoped --quiz-gold.
* - Text on the metal riser uses the band colour, which flips with the band.
* - The answer tiles are the piece's own radio fields on the band: they keep their band glass surface, and read
* the field role for their radius (--field-radius) and focus ring (--field-focus).
* - The invalid tile border is --danger with its lightness lifted (relative syntax, hue kept) so it reads on the
* dark band; the error message uses --danger on --danger-soft.
*/
const CSS = `
.cf-quiz-start-8 {
container: qs8 / inline-size;
--qs8-band: var(--band, oklch(0.273 0.067 256));
--qs8-ink: var(--band-ink, oklch(1 0 0));
--qs8-soft: color-mix(in oklch, var(--qs8-ink) 80%, var(--qs8-band));
--qs8-glass: color-mix(in oklch, var(--qs8-ink) 7%, var(--qs8-band));
--qs8-glass-hi: color-mix(in oklch, var(--qs8-ink) 12%, var(--qs8-band));
--qs8-line: oklch(from var(--qs8-ink) l c h / 0.16);
--qs8-gold: var(--quiz-gold, color-mix(in oklab, var(--accent, oklch(0.62 0.13 85)) 50%, var(--qs8-ink)));
--qs8-gold-ink: var(--qs8-band);
--qs8-metal: linear-gradient(180deg, oklch(from var(--qs8-gold) calc(l + 0.07) c h), var(--qs8-gold) 46%, oklch(from var(--qs8-gold) calc(l - 0.09) c h));
--qs8-focus: var(--quiz-focus, var(--field-focus, var(--qs8-gold)));
--qs8-danger: oklch(from var(--danger, oklch(0.5 0.17 27)) max(l, 0.72) c h);
--qs8-r: var(--card-radius, var(--radius, 0.75rem));
--qs8-field-r: var(--field-radius, var(--radius, 0.75rem));
--qs8-shadow: var(--shadow, oklch(0.22 0.03 256));
display: block;
margin: 0;
min-width: 0;
color: var(--qs8-ink);
font-family: var(--font-body);
}
.cf-quiz-start-8, .cf-quiz-start-8 *, .cf-quiz-start-8 *::before, .cf-quiz-start-8 *::after { box-sizing: border-box; }
.cf-quiz-start-8 :where(h2, h3, p, ul, fieldset) { margin: 0; }
.cf-quiz-start-8 .qs8-sr {
position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* stage */
.cf-quiz-start-8 .qs8-stage {
display: grid;
grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
grid-template-areas: "hero stairs" "ground ground" "ask answer";
column-gap: clamp(2rem, 4.5cqi, 3.5rem);
padding: clamp(1.25rem, 4.5cqi, 3.25rem);
border-radius: calc(var(--qs8-r) * 1.75);
border: 1px solid oklch(from var(--qs8-gold) l c h / 0.3);
background: var(--qs8-band);
color: var(--qs8-ink);
box-shadow:
inset 0 1px 0 oklch(from var(--qs8-ink) l c h / 0.1),
var(--card-shadow, var(--shadow-lg, 0 2px 4px oklch(from var(--qs8-shadow) l c h / 0.22), 0 12px 24px -8px oklch(from var(--qs8-shadow) l c h / 0.32)));
}
/* hero */
.cf-quiz-start-8 .qs8-hero { grid-area: hero; align-self: end; padding-bottom: clamp(1.5rem, 3cqi, 2.25rem); min-width: 0; }
.cf-quiz-start-8 .qs8-title {
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(2.75rem, 5cqi, 4.25rem);
line-height: 1.04;
text-wrap: balance;
color: var(--qs8-ink);
}
.cf-quiz-start-8 .qs8-gild { color: var(--qs8-gold); white-space: nowrap; }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
.cf-quiz-start-8 .qs8-gild {
background-image: linear-gradient(105deg,
oklch(from var(--qs8-gold) calc(l + 0.06) c h) 0%,
oklch(from var(--qs8-gold) calc(l - 0.05) c h) 38%,
oklch(from var(--qs8-gold) calc(l + 0.1) calc(c * 0.6) h) 50%,
oklch(from var(--qs8-gold) calc(l - 0.05) c h) 62%,
oklch(from var(--qs8-gold) calc(l + 0.04) c h) 100%);
background-size: 240% 100%;
background-position: 0% 50%;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
}
.cf-quiz-start-8 .qs8-sub {
margin-top: 1.25rem;
max-width: 34rem;
color: var(--qs8-soft);
font-size: clamp(1.125rem, 1.9cqi, 1.375rem);
font-weight: 500;
line-height: 1.45;
text-wrap: pretty;
}
/* staircase */
.cf-quiz-start-8 .qs8-stairs {
grid-area: stairs;
position: relative;
align-self: end;
display: grid;
grid-template-columns: repeat(var(--n), minmax(0, 1fr)) minmax(11.5rem, 2.6fr);
align-items: end;
column-gap: 0.375rem;
min-height: 13.5rem;
min-width: 0;
}
.cf-quiz-start-8 .qs8-riser {
height: calc(22% + 62% * var(--i) / var(--n));
min-height: 2.5rem;
display: flex;
justify-content: center;
border-radius: calc(var(--qs8-r) * 0.45) calc(var(--qs8-r) * 0.45) 0 0;
background: var(--qs8-glass);
box-shadow: inset 0 2px 0 oklch(from var(--qs8-ink) l c h / 0.2), inset 1px 0 0 oklch(from var(--qs8-ink) l c h / 0.06);
color: var(--qs8-soft);
transform-origin: 50% 100%;
}
.cf-quiz-start-8 .qs8-riser-num {
display: flex;
justify-content: center;
padding-top: 0.55rem;
font-family: var(--font-display);
font-weight: 800;
font-size: 0.875rem;
line-height: 1;
font-variant-numeric: tabular-nums;
}
.cf-quiz-start-8 .qs8-riser-num svg { width: 1rem; height: 1rem; stroke-width: 3; }
.cf-quiz-start-8 .qs8-riser.is-here {
background: color-mix(in oklab, var(--qs8-gold) 24%, var(--qs8-band));
box-shadow: inset 0 3px 0 var(--qs8-gold);
color: var(--qs8-ink);
}
.cf-quiz-start-8 .qs8-stage[data-answered] .qs8-riser.is-here {
background: var(--qs8-metal);
box-shadow: inset 0 1px 0 oklch(from var(--qs8-gold) calc(l + 0.12) calc(c * 0.5) h / 0.8);
color: var(--qs8-gold-ink);
}
.cf-quiz-start-8 .qs8-summit {
align-self: stretch;
display: flex;
flex-direction: column;
min-width: 0;
}
.cf-quiz-start-8 .qs8-summit-body {
flex: 1;
border-radius: calc(var(--qs8-r) * 0.6) calc(var(--qs8-r) * 0.6) 0 0;
padding: 0.95rem 1rem 1.1rem;
background: var(--qs8-glass-hi);
box-shadow: inset 1px 0 0 oklch(from var(--qs8-ink) l c h / 0.06), inset -1px 0 0 oklch(from var(--qs8-ink) l c h / 0.06);
}
.cf-quiz-start-8 .qs8-summit-title {
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
font-size: 1.1875rem;
line-height: 1.2;
text-wrap: balance;
color: var(--qs8-ink);
}
.cf-quiz-start-8 .qs8-finds { display: grid; gap: 0.55rem; margin-top: 0.75rem; padding: 0; list-style: none; }
.cf-quiz-start-8 .qs8-finds li {
display: flex;
align-items: flex-start;
gap: 0.5rem;
color: var(--qs8-ink);
font-size: 1rem;
line-height: 1.35;
text-wrap: pretty;
}
.cf-quiz-start-8 .qs8-finds svg { width: 1rem; height: 1rem; flex: none; margin-top: 0.18em; color: var(--qs8-gold); stroke-width: 3; }
.cf-quiz-start-8 .qs8-ground { grid-area: ground; height: 2px; background: oklch(from var(--qs8-ink) l c h / 0.18); }
/* the open question */
.cf-quiz-start-8 .qs8-ask { grid-area: ask; align-self: start; padding-top: clamp(1.5rem, 3cqi, 2.25rem); min-width: 0; }
.cf-quiz-start-8 .qs8-label {
margin-bottom: 0.875rem;
color: var(--qs8-gold);
font-family: var(--font-display);
font-weight: 800;
font-size: 0.875rem;
line-height: 1.2;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.cf-quiz-start-8 .qs8-question {
font-family: var(--font-display);
font-weight: var(--display-weight, 800);
text-transform: var(--display-case, none);
letter-spacing: var(--display-tracking, -0.015em);
font-size: clamp(1.625rem, 2.8cqi, 2.25rem);
line-height: 1.12;
text-wrap: balance;
color: var(--qs8-ink);
}
.cf-quiz-start-8 .qs8-nudge {
margin-top: 0.75rem;
color: var(--qs8-soft);
font-size: 1.0625rem;
line-height: 1.5;
text-wrap: pretty;
}
.cf-quiz-start-8 .qs8-answer { grid-area: answer; align-self: start; padding-top: clamp(1.5rem, 3cqi, 2.25rem); min-width: 0; }
.cf-quiz-start-8 .qs8-choices { display: grid; gap: 0.625rem; min-width: 0; padding: 0; border: 0; }
.cf-quiz-start-8 .qs8-choice {
position: relative;
display: flex;
align-items: center;
gap: 0.875rem;
min-height: 3.75rem;
padding: 0.875rem 1rem;
border: 1px solid var(--qs8-line);
border-radius: var(--qs8-field-r);
background: var(--qs8-glass);
box-shadow: inset 0 1px 0 oklch(from var(--qs8-ink) l c h / 0.08);
color: var(--qs8-ink);
cursor: pointer;
}
.cf-quiz-start-8 .qs8-input {
position: absolute;
inset: 0;
width: 1px;
height: 1px;
margin: 0;
opacity: 0;
pointer-events: none;
accent-color: var(--field-focus, var(--qs8-gold));
border-radius: var(--field-radius, var(--radius, 0.75rem));
}
.cf-quiz-start-8 .qs8-ring {
flex: none;
display: grid;
place-items: center;
width: 1.375rem;
height: 1.375rem;
border-radius: 50%;
border: 2px solid var(--qs8-soft);
}
.cf-quiz-start-8 .qs8-ring::after {
content: "";
width: 0.625rem;
height: 0.625rem;
border-radius: 50%;
background: var(--qs8-gold);
transform: scale(0);
}
.cf-quiz-start-8 .qs8-choice-text { flex: 1; min-width: 0; display: grid; gap: 0.2rem; }
.cf-quiz-start-8 .qs8-choice-label { font-size: 1.125rem; font-weight: 700; line-height: 1.25; text-wrap: pretty; }
.cf-quiz-start-8 .qs8-choice-detail { color: var(--qs8-soft); font-size: 0.9375rem; line-height: 1.4; text-wrap: pretty; }
.cf-quiz-start-8 .qs8-key {
flex: none;
display: grid;
place-items: center;
min-width: 1.875rem;
height: 1.875rem;
padding: 0 0.5rem;
border: 1px solid var(--qs8-line);
border-radius: calc(var(--qs8-field-r) * 0.5);
background: var(--qs8-band);
box-shadow: inset 0 -2px 0 oklch(from var(--qs8-ink) l c h / 0.1);
color: var(--qs8-soft);
font-family: var(--font-display);
font-weight: 800;
font-size: 0.875rem;
line-height: 1;
}
.cf-quiz-start-8 .qs8-choice.is-on {
border-color: var(--qs8-gold);
background: color-mix(in oklab, var(--qs8-gold) 13%, var(--qs8-band));
box-shadow:
inset 0 1px 0 oklch(from var(--qs8-gold) l c h / 0.25),
var(--shadow-md, 0 1px 2px oklch(from var(--qs8-shadow) l c h / 0.22), 0 4px 10px -2px oklch(from var(--qs8-shadow) l c h / 0.2));
transform: translateY(-1px);
}
.cf-quiz-start-8 .qs8-choice.is-on .qs8-ring { border-color: var(--qs8-gold); }
.cf-quiz-start-8 .qs8-choice.is-on .qs8-ring::after { transform: scale(1); }
.cf-quiz-start-8 .qs8-choice.is-on .qs8-key { border-color: oklch(from var(--qs8-gold) l c h / 0.6); color: var(--qs8-gold); }
.cf-quiz-start-8 .qs8-choice.is-invalid { border-color: var(--qs8-danger); }
.cf-quiz-start-8 .qs8-choice:has(.qs8-input:focus-visible) { outline: 3px solid var(--qs8-focus); outline-offset: 3px; }
.cf-quiz-start-8 .qs8-choices:disabled .qs8-choice { cursor: not-allowed; opacity: 0.55; }
@media (hover: hover) {
.cf-quiz-start-8 .qs8-choices:not(:disabled) .qs8-choice:not(.is-on):hover {
background: var(--qs8-glass-hi);
border-color: oklch(from var(--qs8-ink) l c h / 0.3);
transform: translateY(-1px);
}
}
.cf-quiz-start-8 .qs8-choices:not(:disabled) .qs8-choice:active { transform: translateY(1px); }
.cf-quiz-start-8 .qs8-error {
display: flex;
align-items: flex-start;
gap: 0.5rem;
margin-top: 0.875rem;
padding: 0.7rem 0.9rem;
border-radius: var(--qs8-r);
background: var(--danger-soft, oklch(0.93 0.024 27));
color: var(--danger, oklch(0.5 0.17 27));
font-size: 1rem;
font-weight: 700;
line-height: 1.4;
text-wrap: pretty;
}
.cf-quiz-start-8 .qs8-error svg { width: 1.125rem; height: 1.125rem; flex: none; margin-top: 0.1em; }
/* the action */
.cf-quiz-start-8 .qs8-btn {
--qs8-btn: var(--button-bg, var(--cta, oklch(0.576 0.209 29.5)));
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.625rem;
width: 100%;
min-height: 4.25rem;
margin-top: 1.25rem;
padding: 0.95rem 1.5rem;
border: 1px solid oklch(from var(--qs8-btn) calc(l - 0.14) c h);
border-radius: var(--button-radius, var(--radius, 0.75rem));
background: linear-gradient(180deg, oklch(from var(--qs8-btn) calc(l + 0.05) c h), var(--button-bg-2, var(--cta-2, oklch(from var(--qs8-btn) calc(l - 0.07) c h))));
color: var(--button-ink, var(--cta-ink, oklch(1 0 0)));
font-family: var(--button-font, var(--font-display));
font-weight: var(--button-weight, 800);
text-transform: var(--button-case, none);
font-size: clamp(1.25rem, 2.3cqi, 1.5rem);
line-height: 1.15;
letter-spacing: -0.005em;
text-align: center;
text-shadow: var(--button-text-shadow, none);
box-shadow: var(--button-shadow,
inset 0 1px 0 oklch(from var(--qs8-btn) calc(l + 0.14) c h / 0.7),
inset 0 -3px 0 oklch(from var(--qs8-btn) calc(l - 0.16) c h),
0 1px 2px oklch(from var(--qs8-shadow) calc(l - 0.08) c h / 0.6),
0 8px 16px -6px oklch(from var(--qs8-shadow) calc(l - 0.08) c h / 0.7));
cursor: pointer;
}
.cf-quiz-start-8 .qs8-btn-label { text-wrap: balance; }
.cf-quiz-start-8 .qs8-btn:hover:not(:disabled),
.cf-quiz-start-8 .qs8-btn.is-hover:not(:disabled) {
background: linear-gradient(180deg, oklch(from var(--qs8-btn) calc(l - 0.01) c h), oklch(from var(--qs8-btn) calc(l - 0.12) c h));
transform: translateY(-2px);
}
.cf-quiz-start-8 .qs8-btn:active:not(:disabled),
.cf-quiz-start-8 .qs8-btn.is-press:not(:disabled) {
background: oklch(from var(--qs8-btn) calc(l - 0.1) c h);
transform: translateY(1px);
box-shadow: inset 0 2px 3px oklch(from var(--qs8-btn) calc(l - 0.24) c h / 0.6), 0 1px 1px oklch(from var(--qs8-shadow) calc(l - 0.08) c h / 0.5);
}
.cf-quiz-start-8 .qs8-btn:focus-visible { outline: 3px solid var(--qs8-focus); outline-offset: 3px; }
.cf-quiz-start-8 .qs8-btn[aria-disabled="true"] { cursor: progress; }
.cf-quiz-start-8 .qs8-btn:disabled {
border-color: var(--qs8-line);
background: color-mix(in oklch, var(--qs8-ink) 16%, var(--qs8-band));
color: var(--qs8-soft);
text-shadow: none;
box-shadow: none;
cursor: not-allowed;
}
.cf-quiz-start-8 .qs8-btn svg { width: 1.375rem; height: 1.375rem; flex: none; }
.cf-quiz-start-8 .qs8-reassure {
margin-top: 0.875rem;
color: var(--qs8-soft);
font-size: 0.9375rem;
line-height: 1.4;
text-align: center;
text-wrap: pretty;
}
/* narrow containers */
@container qs8 (max-width: 820px) {
.cf-quiz-start-8 .qs8-stage {
grid-template-columns: minmax(0, 1fr);
grid-template-areas: "hero" "stairs" "ground" "ask" "answer";
}
.cf-quiz-start-8 .qs8-hero { padding-bottom: 0; }
.cf-quiz-start-8 .qs8-title { font-size: clamp(2.125rem, 9.5cqi, 3.25rem); }
.cf-quiz-start-8 .qs8-sub { margin-top: 1rem; }
.cf-quiz-start-8 .qs8-stairs {
margin-top: 1.75rem;
min-height: 12rem;
column-gap: 0.25rem;
grid-template-columns: repeat(var(--n), minmax(0, 1fr)) minmax(9.5rem, 1.6fr);
}
.cf-quiz-start-8 .qs8-stairs[data-dense] .qs8-riser:not(.is-here) .qs8-riser-num { display: none; }
.cf-quiz-start-8 .qs8-summit-body { padding: 0.8rem 0.75rem 0.9rem; }
.cf-quiz-start-8 .qs8-summit-title { font-size: 1.0625rem; }
.cf-quiz-start-8 .qs8-finds li { font-size: 0.9375rem; }
.cf-quiz-start-8 .qs8-answer { padding-top: 1.25rem; }
.cf-quiz-start-8 .qs8-choice { padding: 0.8rem 0.875rem; gap: 0.75rem; }
.cf-quiz-start-8 .qs8-choice-label { font-size: 1.0625rem; }
}
/* motion */
@keyframes qs8-rise { from { transform: scaleY(0.3); } to { transform: none; } }
@keyframes qs8-sheen { from { background-position: 100% 50%; } to { background-position: 0% 50%; } }
@keyframes qs8-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
.cf-quiz-start-8 .qs8-riser {
animation: qs8-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
animation-delay: calc(var(--i) * 70ms);
transition: background-color 0.25s ease, color 0.25s ease;
}
.cf-quiz-start-8 .qs8-gild { animation: qs8-sheen 1.8s ease-out 0.35s both; }
.cf-quiz-start-8 .qs8-spin { animation: qs8-spin 0.9s linear infinite; }
.cf-quiz-start-8 .qs8-choice { transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease; }
.cf-quiz-start-8 .qs8-ring::after { transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1.4); }
.cf-quiz-start-8 .qs8-btn { transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease; }
}
`
pieces/forms/quiz-start-8/specimen.tsx 31 lines
import QuizStart8, { type QuizChoice, type QuizStart8State } from "../quiz-start-8"
import defaults from "../../studio-defaults.json"
export const states: QuizStart8State[] = ["default", "hover", "active", "disabled", "error"]
const ANSWERS: QuizChoice[] = [
{ value: "planning", label: "Planning my funnel" },
{ value: "copy", label: "Writing my page copy" },
{ value: "launch", label: "Getting ready to launch" },
]
export default function QuizStart8Specimen({ state = "default" }: { state?: QuizStart8State }) {
const items = defaults.sample.items
const choices: QuizChoice[] = ANSWERS.map((answer, index) => ({ ...answer, detail: items[index]?.detail }))
return (
<QuizStart8
state={state}
headline="Take the 60-second quiz"
highlight="60-second"
subheadline="Find your next step toward building your first funnel."
questionCount={5}
resultTitle="Your next step"
findOut={["Which part to fix first", "What your page copy needs", "Your launch-day checklist"]}
question="What do you need help with first?"
nudge="Tap the answer that fits you best."
choices={choices}
reassurance="One tap per question · About 60 seconds"
/>
)
}
| Name | Type | Details |
|---|---|---|
copy OptionalQuizStart8 |
Partial<QuizStart8Copy> |
|
headline OptionalQuizStart8 |
string |
Default "Take the 60-second quiz"
|
highlight OptionalQuizStart8 |
string |
Default "60-second"
|
subheadline OptionalQuizStart8 |
string |
Default "Find your next step toward your first funnel."
|
questionCount OptionalQuizStart8 |
number |
Default 5
|
resultTitle OptionalQuizStart8 |
string |
Default "Your next step"
|
findOut OptionalQuizStart8 |
string[] |
Default DEFAULT_FIND_OUT
|
question OptionalQuizStart8 |
string |
Default "What do you need help with first?"
|
nudge OptionalQuizStart8 |
string |
Default "Tap the answer that fits you best."
|
choices OptionalQuizStart8 |
QuizChoice[] |
Default DEFAULT_CHOICES
|
ctaLabel OptionalQuizStart8 |
string |
|
loadingLabel OptionalQuizStart8 |
string |
Default "Opening your quiz…"
|
reassurance OptionalQuizStart8 |
string |
Default "One tap per question · About 60 seconds"
|
errorText OptionalQuizStart8 |
string |
Default "Pick an answer above to take your first step."
|
disabled OptionalQuizStart8 |
boolean |
Default false
|
disabledText OptionalQuizStart8 |
string |
Default "This quiz isn’t open right now."
|
onSubmit OptionalQuizStart8 |
(answer: string) => void | Promise<void> |
|
onAction OptionalQuizStart8 |
(answer: string) => void |
|
state OptionalQuizStart8 |
QuizStart8State |
Default "default"
|
className OptionalQuizStart8 |
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.
--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--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
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB