Instant Demo 2
Build-your-demo opt-in: two chip questions trim and re-order the demo into the visitor's own path on one raised
Use it in a prompt
Use hero/instant-demo-2 from the FunnelDNA library. Follow the skill and theme contract. Ask me for the copy, images, and brand details you need; do not invent proof.
Paste into Claude or ChatGPT with FunnelDNA connected (MCP setup), or alongside the skill.
Use it in code
- Save
component.tsx(Code tab) ascomponents/funneldna/hero/instant-demo-2.tsx. - Import it and pass your copy and images (Props tab):
import { InstantDemo2 } from "@/components/funneldna/hero/instant-demo-2"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/hero/instant-demo-2/component.tsx 634 lines
// layout: clipboard-checklist
// Build-your-demo opt-in: two chip questions trim and re-order the demo into the visitor's own path on one raised
// sheet, the runtime recounts live, and the email gate starts the watch through onSubmit (reason-why personalisation).
import React, { useEffect, useId, useMemo, useRef, useState } from "react";
import { AlertCircle, Check, Lock, Scissors, Target } from "lucide-react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import { FX_HOST, Pattern, Spot } from "../fx/fx";
import checklist from "../fx/spots/checklist";
export type InstantDemo2Option = {
id: string;
label: string;
/** How the reason line names this answer, e.g. "a practice manager". */
phrase?: string;
};
export type InstantDemo2Question = {
id: string;
/** Short name shown in the stepper, e.g. "Your role". */
step: string;
/** The question itself, e.g. "What's your role?". */
label: string;
options: InstantDemo2Option[];
};
export type InstantDemo2Chapter = {
title: string;
detail?: string;
/** Runtime of this chapter in seconds. */
seconds: number;
/** Option ids this chapter is for. Per question, a chapter that lists none of that question's options suits every answer. */
only?: string[];
/** Option ids for which this chapter moves to the front of the path. */
leadFor?: string[];
};
export type InstantDemo2Lead = { lead: string; text: string };
export type InstantDemo2Logo = { src: string; alt: string };
export type InstantDemo2Values = {
email: string;
answers: Record<string, string | null>;
/** The chapters in the visitor's path, in play order. */
chapters: InstantDemo2Chapter[];
/** Total runtime of the path in seconds. */
seconds: number;
};
export type InstantDemo2Props = {
headline?: string;
/** Phrase inside the headline that gets the marker stroke. */
highlight?: string;
/** Short paragraphs under the headline, each opening with a bold lead-in. */
leads?: InstantDemo2Lead[];
questions?: InstantDemo2Question[];
chapters?: InstantDemo2Chapter[];
/** Answers selected on first render, keyed by question id. */
defaultAnswers?: Record<string, string>;
stepsLabel?: string;
stepEmpty?: string;
/** Card title once anything is answered. Placeholder: {minutes}. */
pathTitle?: string;
/** Card title before any answer. Placeholder: {minutes}. */
fullTitle?: string;
/** Reason-why line. Placeholder: {who} (the first chosen answer's phrase, set in bold). */
reasonLine?: string;
reasonEmpty?: string;
unitLabel?: string;
/** Announced to screen readers when the path changes. Placeholders: {count}, {time}. */
liveLine?: string;
pathLabel?: string;
/** Tag on chapters moved to the front for this visitor. */
leadTag?: string;
/** Placeholder: {time}. */
skippedOne?: string;
/** Placeholders: {count}, {time}. */
skippedMany?: string;
askLead?: string;
askText?: string;
emailLabel?: string;
emailPlaceholder?: string;
buttonLabel?: string;
/** One short line under the button. */
reassurance?: string;
requiredMessage?: string;
invalidMessage?: string;
/** Customer logos; the row only shows when some are supplied. */
logos?: InstantDemo2Logo[];
logosLabel?: string;
/** Clay illustration beside the runtime (an fx Spot asset). */
spotImage?: string;
/** Called with the validated email, answers and path. The piece never sends data itself. */
onSubmit?: (values: InstantDemo2Values) => void;
/** Called whenever an answer changes. */
onAnswer?: (answers: Record<string, string | null>) => void;
state?: "default" | "hover" | "active" | "disabled" | "error";
className?: string;
};
export function InstantDemo2(props: InstantDemo2Props) {
const {
headline = "Watch only the parts of the demo you'll actually use",
highlight = "you'll actually use",
leads = DEFAULT_LEADS,
questions = DEFAULT_QUESTIONS,
chapters = DEFAULT_CHAPTERS,
defaultAnswers,
stepsLabel = "Your answers so far",
stepEmpty = "Not chosen yet",
pathTitle = "Your {minutes}-minute path",
fullTitle = "The full {minutes}-minute demo",
reasonLine = "Only the parts that matter to {who}.",
reasonEmpty = "Answer two quick questions and we'll cut it to fit you.",
unitLabel = "min",
liveLine = "Your path: {count} chapters, {time} total.",
pathLabel = "Chapters in your path",
leadTag = "Starts here for you",
skippedOne = "1 chapter cut for you · {time} saved",
skippedMany = "{count} chapters cut for you · {time} saved",
askLead = "Ready?",
askText = "Enter your work email, then click the button below to start watching.",
emailLabel = "Work email",
emailPlaceholder = "you@company.com",
buttonLabel = "Watch My Path",
reassurance = "We respect your inbox. Unsubscribe anytime.",
requiredMessage = "Enter your work email so we can start your path.",
invalidMessage = "That email looks incomplete. Try something like you@company.com.",
logos = [],
logosLabel = "Teams already watching",
spotImage = checklist,
onSubmit,
onAnswer,
state = "default",
className,
} = props;
const uid = useId();
const headId = `${uid}-head`;
const pathId = `${uid}-path`;
const formId = `${uid}-form`;
const emailId = `${uid}-email`;
const errId = `${uid}-err`;
const noteId = `${uid}-note`;
const reduce = !!useReducedMotion();
const inputRef = useRef<HTMLInputElement>(null);
const [answers, setAnswers] = useState<Record<string, string | null>>(() => {
const init: Record<string, string | null> = {};
for (const q of questions) {
const want = defaultAnswers ? defaultAnswers[q.id] : undefined;
init[q.id] = want && q.options.some((o) => o.id === want) ? want : null;
}
return init;
});
const [email, setEmail] = useState("");
const [error, setError] = useState<string | null>(null);
const disabled = state === "disabled";
const shownError = state === "error" ? invalidMessage : error;
const plan = useMemo(() => buildPath(questions, chapters, answers), [questions, chapters, answers]);
const shown = useCount(plan.seconds, reduce);
const minutes = Math.max(1, Math.round(plan.seconds / 60));
const title = fill(plan.chosen.length ? pathTitle : fullTitle, { minutes: String(minutes) });
const reason = plan.who ? withBold(reasonLine, "{who}", plan.who) : reasonEmpty;
const live = fill(liveLine, { count: String(plan.items.length), time: fmt(plan.seconds) });
const cutLine =
plan.cut === 1
? fill(skippedOne, { time: fmt(plan.saved) })
: fill(skippedMany, { count: String(plan.cut), time: fmt(plan.saved) });
function choose(questionId: string, optionId: string) {
if (disabled) return;
const next = { ...answers, [questionId]: optionId };
setAnswers(next);
onAnswer?.(next);
}
function submit(e: React.FormEvent<HTMLFormElement>) {
e.preventDefault();
if (disabled) return;
const value = email.trim();
if (!value) {
setError(requiredMessage);
inputRef.current?.focus();
return;
}
if (!EMAIL_RE.test(value)) {
setError(invalidMessage);
inputRef.current?.focus();
return;
}
setError(null);
onSubmit?.({ email: value, answers, chapters: plan.items.map((k) => k.chapter), seconds: plan.seconds });
}
const cta =
"cf-instant-demo-2__cta" + (state === "hover" ? " is-hover" : "") + (state === "active" ? " is-active" : "");
const describedBy = [shownError ? errId : "", reassurance ? noteId : ""].filter(Boolean).join(" ") || undefined;
return (
<section className={"cf-instant-demo-2" + (className ? " " + className : "")} aria-labelledby={headId}>
<style>{CSS}</style>
<div className="cf-instant-demo-2__fx" aria-hidden="true" style={{ ...FX_HOST, position: "absolute", inset: 0, zIndex: 0 }}>
<Pattern name="grid" fade="edges" />
</div>
<div className="cf-instant-demo-2__inner">
<div className="cf-instant-demo-2__grid">
<div className="cf-instant-demo-2__ask">
<h1 id={headId} className="cf-instant-demo-2__h cf-instant-demo-2__rise">
{renderHeadline(headline, highlight)}
</h1>
{leads.length ? (
<div className="cf-instant-demo-2__leads cf-instant-demo-2__rise" style={{ animationDelay: ".07s" }}>
{leads.map((l, i) => (
<p key={i}>
<strong>{l.lead}</strong> {l.text}
</p>
))}
</div>
) : null}
<ol
className="cf-instant-demo-2__steps"
aria-label={stepsLabel}
style={{ gridTemplateColumns: `repeat(${Math.max(1, questions.length)}, minmax(0, 1fr))` }}
>
{questions.map((q, i) => {
const pick = q.options.find((o) => o.id === answers[q.id]);
return (
<li key={q.id} className={"cf-instant-demo-2__step" + (pick ? " is-done" : "")}>
<span className="cf-instant-demo-2__stepnum" aria-hidden="true">
{i + 1}
</span>
<span className="cf-instant-demo-2__steptext">
<span className="cf-instant-demo-2__stepname">{q.step}</span>
<span className="cf-instant-demo-2__stepval">{pick ? pick.label : stepEmpty}</span>
</span>
<span className="cf-instant-demo-2__bar" aria-hidden="true">
<span />
</span>
</li>
);
})}
</ol>
{questions.map((q) => (
<fieldset key={q.id} className="cf-instant-demo-2__q" disabled={disabled}>
<legend className="cf-instant-demo-2__legend">{q.label}</legend>
<div className="cf-instant-demo-2__chips">
{q.options.map((o) => {
const on = answers[q.id] === o.id;
return (
<label key={o.id} className={"cf-instant-demo-2__chip" + (on ? " is-on" : "")}>
<input
type="radio"
name={`${uid}-${q.id}`}
value={o.id}
checked={on}
onChange={() => choose(q.id, o.id)}
/>
<span className="cf-instant-demo-2__chipface">
{on ? <Check size={18} strokeWidth={2.5} aria-hidden="true" /> : null}
{o.label}
</span>
</label>
);
})}
</div>
</fieldset>
))}
</div>
<div className="cf-instant-demo-2__card cf-instant-demo-2__rise" style={{ animationDelay: ".14s" }}>
<div className="cf-instant-demo-2__meter">
<div>
<p className="cf-instant-demo-2__num">
<span aria-hidden="true">{fmt(shown)}</span>
<span className="cf-instant-demo-2__unit" aria-hidden="true">
{unitLabel}
</span>
</p>
<h2 id={pathId} className="cf-instant-demo-2__title">
{title}
</h2>
<p className="cf-instant-demo-2__why">{reason}</p>
</div>
{spotImage ? (
<div className="cf-instant-demo-2__spot" aria-hidden="true">
<Spot src={spotImage} size={64} />
</div>
) : null}
<p className="cf-instant-demo-2__sr" aria-live="polite">
{live}
</p>
</div>
<ol className="cf-instant-demo-2__path" aria-label={pathLabel}>
<AnimatePresence initial={false} mode="popLayout">
{plan.items.map((k) => (
<motion.li
key={k.index}
layout={reduce ? false : "position"}
initial={reduce ? false : { opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, transition: { duration: reduce ? 0 : 0.18 } }}
transition={{ duration: reduce ? 0 : 0.45, ease: EASE }}
className="cf-instant-demo-2__row"
>
<span className="cf-instant-demo-2__tick" aria-hidden="true">
<Check size={14} strokeWidth={3} />
</span>
<span className="cf-instant-demo-2__rowtext">
<span className="cf-instant-demo-2__rowtitle">{k.chapter.title}</span>
{k.chapter.detail ? <span className="cf-instant-demo-2__rowdetail">{k.chapter.detail}</span> : null}
{k.lead && leadTag ? (
<span className="cf-instant-demo-2__tag">
<Target size={16} strokeWidth={2.5} aria-hidden="true" />
{leadTag}
</span>
) : null}
</span>
<span className="cf-instant-demo-2__rowtime">{fmt(k.chapter.seconds)}</span>
</motion.li>
))}
</AnimatePresence>
</ol>
{plan.cut > 0 ? (
<p className="cf-instant-demo-2__cut">
<Scissors size={16} strokeWidth={2.5} aria-hidden="true" />
{cutLine}
</p>
) : null}
<form id={formId} className="cf-instant-demo-2__form" noValidate onSubmit={submit}>
<p className="cf-instant-demo-2__instr">
<strong>{askLead}</strong> {askText}
</p>
<label htmlFor={emailId} className="cf-instant-demo-2__label">
{emailLabel}
</label>
<input
ref={inputRef}
id={emailId}
className="cf-instant-demo-2__field"
type="email"
name="email"
inputMode="email"
autoComplete="email"
placeholder={emailPlaceholder}
value={email}
disabled={disabled}
aria-invalid={shownError ? true : undefined}
aria-describedby={describedBy}
onChange={(e) => {
setEmail(e.target.value);
if (error) setError(null);
}}
/>
{shownError ? (
<p id={errId} className="cf-instant-demo-2__err" role="alert">
<AlertCircle size={16} strokeWidth={2.5} aria-hidden="true" />
{shownError}
</p>
) : null}
<button type="submit" className={cta} disabled={disabled}>
{buttonLabel}
</button>
{reassurance ? (
<p id={noteId} className="cf-instant-demo-2__note">
<Lock size={16} strokeWidth={2.5} aria-hidden="true" />
{reassurance}
</p>
) : null}
</form>
</div>
</div>
{logos.length ? (
<div className="cf-instant-demo-2__logos">
{logosLabel ? <p className="cf-instant-demo-2__logoslabel">{logosLabel}</p> : null}
<ul className="cf-instant-demo-2__logorow">
{logos.map((l, i) => (
<li key={i}>
<img src={l.src} alt={l.alt} loading="lazy" />
</li>
))}
</ul>
</div>
) : null}
</div>
</section>
);
}
export default InstantDemo2;
const DEFAULT_LEADS: InstantDemo2Lead[] = [
{ lead: "Two taps.", text: "Tell us your role and the size of your team." },
{ lead: "Your own cut.", text: "We drop the chapters that don't apply to you and put yours first." },
];
const DEFAULT_QUESTIONS: InstantDemo2Question[] = [
{
id: "role",
step: "Your role",
label: "What's your role?",
options: [
{ id: "manager", label: "Manager", phrase: "a manager" },
{ id: "owner", label: "Owner", phrase: "an owner" },
{ id: "team", label: "Team member", phrase: "a team member" },
],
},
{
id: "size",
step: "Team size",
label: "How big is your team?",
options: [
{ id: "size-1", label: "1–10" },
{ id: "size-11", label: "11–50" },
{ id: "size-51", label: "51+" },
],
},
];
const DEFAULT_CHAPTERS: InstantDemo2Chapter[] = [
{ title: "See the finished result", detail: "What you'll have running by the end.", seconds: 60 },
{ title: "Set it up for your team", detail: "Every setting, shown on screen.", seconds: 110, only: ["manager", "owner"], leadFor: ["manager"] },
{ title: "A normal day, start to finish", detail: "How your team uses it each morning.", seconds: 90, leadFor: ["team"] },
{ title: "The reports owners check weekly", detail: "The numbers that show it's working.", seconds: 70, only: ["owner"], leadFor: ["owner"] },
{ title: "Roll it out across locations", detail: "Share settings and staff between sites.", seconds: 80, only: ["size-51"] },
{ title: "Your first week", detail: "What to do once it's live.", seconds: 50 },
];
const EASE = [0.2, 0.7, 0.2, 1] as const;
const EMAIL_RE = /^[^ @]+@[^ @]+[.][^ @]{2,}$/;
type PathItem = { chapter: InstantDemo2Chapter; index: number; lead: boolean };
function buildPath(
questions: InstantDemo2Question[],
chapters: InstantDemo2Chapter[],
answers: Record<string, string | null>
) {
const chosen: string[] = [];
let who: string | undefined;
for (const q of questions) {
const pick = answers[q.id];
const opt = pick ? q.options.find((o) => o.id === pick) : undefined;
if (opt) {
chosen.push(opt.id);
if (!who && opt.phrase) who = opt.phrase;
}
}
const full = chapters.reduce((sum, c) => sum + c.seconds, 0);
const kept: PathItem[] = chapters
.map((chapter, index) => ({
chapter,
index,
lead: !!chapter.leadFor && chapter.leadFor.some((id) => chosen.includes(id)),
}))
.filter(({ chapter }) =>
questions.every((q) => {
const pick = answers[q.id];
if (!pick || !chapter.only || !chapter.only.length) return true;
const own = chapter.only.filter((id) => q.options.some((o) => o.id === id));
return own.length === 0 || own.includes(pick);
})
);
const items = [...kept.filter((k) => k.lead), ...kept.filter((k) => !k.lead)];
const seconds = items.reduce((sum, k) => sum + k.chapter.seconds, 0);
return { items, seconds, full, saved: full - seconds, cut: chapters.length - items.length, chosen, who };
}
/** Shows the real total first; recounts from the previous total only when motion is allowed. */
function useCount(target: number, reduce: boolean) {
const [value, setValue] = useState(target);
const current = useRef(target);
useEffect(() => {
const from = current.current;
if (reduce || from === target || typeof requestAnimationFrame === "undefined") {
current.current = target;
setValue(target);
return;
}
let raf = 0;
const t0 = performance.now();
const duration = 520;
const tick = (now: number) => {
const p = Math.min(1, (now - t0) / duration);
const eased = 1 - Math.pow(1 - p, 3);
const v = Math.round(from + (target - from) * eased);
current.current = v;
setValue(v);
if (p < 1) raf = requestAnimationFrame(tick);
};
raf = requestAnimationFrame(tick);
return () => cancelAnimationFrame(raf);
}, [target, reduce]);
return value;
}
function fmt(total: number) {
const s = Math.max(0, Math.round(total));
const m = Math.floor(s / 60);
const r = s % 60;
return m + ":" + (r < 10 ? "0" : "") + r;
}
function fill(template: string, vars: Record<string, string>) {
let out = template;
for (const key of Object.keys(vars)) out = out.split("{" + key + "}").join(vars[key]);
return out;
}
function withBold(template: string, token: string, value: string): React.ReactNode {
const parts = template.split(token);
return parts.map((part, i) => (
<React.Fragment key={i}>
{part}
{i < parts.length - 1 ? <strong>{value}</strong> : null}
</React.Fragment>
));
}
function renderHeadline(text: string, mark?: string): React.ReactNode {
if (!mark) return text;
const at = text.indexOf(mark);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<span className="cf-instant-demo-2__mark">{mark}</span>
{text.slice(at + mark.length)}
</>
);
}
const CSS = `
.cf-instant-demo-2{--g:clamp(16px,5vw,48px);--id2-marker:var(--marker,#fae37c);position:relative;isolation:isolate;background:var(--band);color:var(--band-ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) var(--g) clamp(64px,8.5vw,120px)}
.cf-instant-demo-2 *,.cf-instant-demo-2 *::before,.cf-instant-demo-2 *::after{box-sizing:border-box}
.cf-instant-demo-2__fx{pointer-events:none;color:var(--band-ink);opacity:.55}
.cf-instant-demo-2__inner{position:relative;z-index:1;max-width:1120px;margin:0 auto}
.cf-instant-demo-2__grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);gap:clamp(32px,5vw,72px);align-items:start}
.cf-instant-demo-2__h{margin:0 0 clamp(16px,1.6vw,24px);font-family:var(--font-display);font-weight:var(--display-weight,800);letter-spacing:var(--display-tracking,-0.025em);text-transform:var(--display-case,none);font-size:clamp(2.5rem,5.4vw,4.875rem);line-height:1.04;text-wrap:balance;color:var(--band-ink)}
.cf-instant-demo-2__mark{color:oklch(from var(--id2-marker) 0.22 0.05 h);background:linear-gradient(transparent 10%,oklch(from var(--id2-marker) max(l, 0.86) min(c, 0.17) h) 10% 94%,transparent 94%);-webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 0.1em;margin:0 -0.04em;border-radius:0.1em 0.22em 0.14em 0.24em}
.cf-instant-demo-2__leads{display:grid;gap:8px;margin:0 0 32px}
.cf-instant-demo-2__leads p{margin:0;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;text-wrap:pretty}
.cf-instant-demo-2__leads strong{font-weight:800}
.cf-instant-demo-2__steps{list-style:none;margin:0 0 32px;padding:0;display:grid;gap:8px}
.cf-instant-demo-2__step{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:12px;row-gap:12px;align-items:start;padding:14px 16px 16px;border-radius:var(--radius,12px);background:oklch(from var(--band-ink) l c h / 0.08);border:1px solid oklch(from var(--band-ink) l c h / 0.16);transition:background .16s ease,border-color .16s ease}
.cf-instant-demo-2__step.is-done{background:oklch(from var(--band-ink) l c h / 0.13);border-color:oklch(from var(--band-ink) l c h / 0.32)}
.cf-instant-demo-2__stepnum{font-family:var(--font-display);font-weight:800;font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;font-variant-numeric:tabular-nums}
.cf-instant-demo-2__steptext{display:grid;gap:4px;min-width:0}
.cf-instant-demo-2__stepname{font-size:0.875rem;line-height:1.2;font-weight:800;letter-spacing:0.06em;text-transform:uppercase}
.cf-instant-demo-2__stepval{font-size:1.0625rem;line-height:1.3;font-weight:700;overflow-wrap:anywhere}
.cf-instant-demo-2__step:not(.is-done) .cf-instant-demo-2__stepval{font-weight:500}
.cf-instant-demo-2__bar{grid-column:1 / -1;display:block;height:6px;border-radius:999px;background:oklch(from var(--band-ink) l c h / 0.16);overflow:hidden}
.cf-instant-demo-2__bar span{display:block;height:100%;border-radius:inherit;background:var(--band-ink);transform:scaleX(0);transform-origin:left center;transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.cf-instant-demo-2__step.is-done .cf-instant-demo-2__bar span{transform:scaleX(1)}
.cf-instant-demo-2__q{border:0;margin:0 0 28px;padding:0;min-inline-size:0}
.cf-instant-demo-2__q:last-child{margin-bottom:0}
.cf-instant-demo-2__legend{display:block;padding:0 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(--band-ink);text-wrap:balance}
.cf-instant-demo-2__chips{display:flex;flex-wrap:wrap;gap:12px}
.cf-instant-demo-2__chip{position:relative;display:inline-flex;cursor:pointer}
.cf-instant-demo-2__chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;z-index:1}
.cf-instant-demo-2__chipface{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:56px;padding:0 22px;border-radius:999px;font-size:1.0625rem;line-height:1.15;font-weight:700;white-space:nowrap;color:var(--band-ink);background:oklch(from var(--band-ink) l c h / 0.1);border:1.5px solid oklch(from var(--band-ink) l c h / 0.28);transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease}
.cf-instant-demo-2__q:not(:disabled) .cf-instant-demo-2__chip:hover .cf-instant-demo-2__chipface{background:oklch(from var(--band-ink) l c h / 0.18);border-color:oklch(from var(--band-ink) l c h / 0.55);transform:translateY(-1px)}
.cf-instant-demo-2__chip input:active + .cf-instant-demo-2__chipface{transform:translateY(1px)}
.cf-instant-demo-2__chip input:focus-visible + .cf-instant-demo-2__chipface{outline:3px solid var(--band-ink);outline-offset:3px}
.cf-instant-demo-2__chip.is-on .cf-instant-demo-2__chipface,.cf-instant-demo-2__q:not(:disabled) .cf-instant-demo-2__chip.is-on:hover .cf-instant-demo-2__chipface{background:var(--accent-fill,var(--accent));color:var(--accent-fill-ink,var(--card));border-color:var(--band-ink);box-shadow:var(--shadow-md,0 1px 2px oklch(0.22 0.03 260 / 0.22),0 4px 10px -2px oklch(0.22 0.03 260 / 0.2))}
.cf-instant-demo-2__q:disabled .cf-instant-demo-2__chip{cursor:not-allowed}
.cf-instant-demo-2__q:disabled .cf-instant-demo-2__chipface{opacity:0.55}
.cf-instant-demo-2__card{position:relative;background:var(--card);color:var(--ink);border:1px solid var(--card-border,oklch(from var(--ink) l c h / 0.12));border-radius:var(--card-radius,var(--radius,14px));box-shadow:var(--card-shadow,var(--shadow-lg,0 2px 4px oklch(0.22 0.03 260 / 0.22),0 12px 24px -8px oklch(0.22 0.03 260 / 0.32)));padding:clamp(20px,3vw,32px)}
.cf-instant-demo-2__meter{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:start;padding-bottom:20px;border-bottom:1px solid oklch(from var(--ink) l c h / 0.12)}
.cf-instant-demo-2__num{margin:0 0 12px;display:flex;align-items:baseline;gap:8px;font-family:var(--font-display);font-weight:800;font-size:clamp(4rem,7vw,6.25rem);line-height:1;letter-spacing:-0.03em;font-variant-numeric:tabular-nums;color:var(--ink)}
.cf-instant-demo-2__unit{font-size:clamp(1.125rem,1.5vw,1.375rem);letter-spacing:0;color:var(--muted)}
.cf-instant-demo-2__title{margin:0 0 8px;font-family:var(--font-display);font-weight:var(--display-weight,800);text-transform:var(--display-case,none);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.15;letter-spacing:-0.01em;color:var(--ink);text-wrap:balance}
.cf-instant-demo-2__why{margin:0;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--muted);text-wrap:pretty}
.cf-instant-demo-2__why strong{color:var(--ink);font-weight:800}
.cf-instant-demo-2__spot{flex:none;line-height:0}
.cf-instant-demo-2__path{list-style:none;margin:0;padding:0;position:relative}
.cf-instant-demo-2__row{display:grid;grid-template-columns:24px minmax(0,1fr) auto;column-gap:14px;align-items:start;padding:14px 0;background:var(--card);border-bottom:1px solid oklch(from var(--ink) l c h / 0.1)}
.cf-instant-demo-2__row:last-child{border-bottom:0}
.cf-instant-demo-2__tick{width:24px;height:24px;margin-top:1px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:var(--success);color:var(--success-ink,#fff)}
.cf-instant-demo-2__rowtext{display:grid;gap:4px;min-width:0}
.cf-instant-demo-2__rowtitle{font-size:1.0625rem;line-height:1.3;font-weight:700;text-wrap:pretty}
.cf-instant-demo-2__rowdetail{font-size:0.9375rem;line-height:1.4;color:var(--muted);text-wrap:pretty}
.cf-instant-demo-2__tag{justify-self:start;display:inline-flex;align-items:center;gap:6px;min-height:28px;margin-top:4px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--accent) 10%,var(--card));color:var(--ink);font-size:0.875rem;line-height:1.2;font-weight:800}
.cf-instant-demo-2__tag svg{color:var(--accent)}
.cf-instant-demo-2__rowtime{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 5%,var(--card));font-size:0.9375rem;line-height:1.2;font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--ink)}
.cf-instant-demo-2__cut{margin:12px 0 0;padding:10px 14px;border-radius:10px;background:color-mix(in oklch,var(--ink) 4%,var(--card));font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--ink);text-wrap:pretty}
.cf-instant-demo-2__cut svg,.cf-instant-demo-2__err svg,.cf-instant-demo-2__note svg{display:inline-block;vertical-align:-0.15em;margin-inline-end:0.4em}
.cf-instant-demo-2__form{margin-top:24px}
.cf-instant-demo-2__instr{margin:0 0 16px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-instant-demo-2__instr strong{font-weight:800}
.cf-instant-demo-2__label{display:block;margin-bottom:8px;font-size:1rem;line-height:1.3;font-weight:700;color:var(--label-ink,var(--ink))}
.cf-instant-demo-2__field{display:block;width:100%;min-height:56px;padding:0 16px;font:inherit;font-size:1.0625rem;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));box-shadow:inset 0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.08);transition:border-color .16s ease,box-shadow .16s ease}
.cf-instant-demo-2__field::placeholder{color:color-mix(in oklch,var(--field-ink) 65%,var(--field));opacity:1}
.cf-instant-demo-2__field:focus{outline:none;border-color:var(--field-focus,var(--accent));box-shadow:0 0 0 3px oklch(from var(--field-focus,var(--accent)) l c h / 0.35)}
.cf-instant-demo-2__field[aria-invalid="true"]{border-color:var(--danger);box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.2)}
.cf-instant-demo-2__field[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.35)}
.cf-instant-demo-2__field:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 6%,var(--field))}
.cf-instant-demo-2__err{margin:8px 0 0;font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--danger);text-wrap:pretty}
.cf-instant-demo-2__cta{appearance:none;border:0;margin:16px 0 0;width:100%;min-height:64px;padding:0 28px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;white-space:nowrap;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 / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.35),0 8px 16px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.45));transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.cf-instant-demo-2__cta:hover:not(:disabled),.cf-instant-demo-2__cta.is-hover:not(:disabled){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:var(--button-shadow,inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.1) c h / 0.7),inset 0 -3px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.2) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.4),0 12px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.5))}
.cf-instant-demo-2__cta:active:not(:disabled),.cf-instant-demo-2__cta.is-active:not(:disabled){transform:translateY(1px);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.08) c h));box-shadow:inset 0 2px 4px oklch(from var(--button-bg,var(--cta)) calc(l - 0.22) c h / 0.5),inset 0 -2px 0 oklch(from var(--button-bg,var(--cta)) calc(l - 0.16) c h),0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.35)}
.cf-instant-demo-2__cta:focus-visible{outline:3px solid var(--field-focus,var(--accent));outline-offset:3px}
.cf-instant-demo-2__cta:disabled{cursor:not-allowed;transform:none;background:var(--button-2-bg,var(--secondary));color:var(--button-2-ink,var(--secondary-ink));text-shadow:none;box-shadow:none}
.cf-instant-demo-2__note{margin:12px 0 0;text-align:center;font-size:0.9375rem;line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-instant-demo-2__logos{margin-top:clamp(40px,5vw,64px);display:grid;gap:16px;justify-items:center;text-align:center}
.cf-instant-demo-2__logoslabel{margin:0;font-size:0.9375rem;line-height:1.4;font-weight:600;color:var(--band-ink)}
.cf-instant-demo-2__logorow{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:16px 40px}
.cf-instant-demo-2__logorow img{display:block;height:32px;width:auto;max-width:160px;object-fit:contain}
.cf-instant-demo-2__sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes cf-instant-demo-2-rise{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
.cf-instant-demo-2__rise{animation:cf-instant-demo-2-rise .45s cubic-bezier(.2,.7,.2,1) both}
@media (min-width:900px){.cf-instant-demo-2__ask{position:sticky;top:24px}}
@media (max-width:899px){.cf-instant-demo-2__grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:520px){
.cf-instant-demo-2__chips{gap:10px}
.cf-instant-demo-2__chipface{min-height:52px;padding:0 18px;font-size:1rem}
.cf-instant-demo-2__step{padding:12px 14px 14px;column-gap:10px}
.cf-instant-demo-2__row{column-gap:12px}
.cf-instant-demo-2__rowtime{padding:4px 10px}
}
@media (prefers-reduced-motion:reduce){.cf-instant-demo-2 *{animation:none !important;transition:none !important}}
`;
pieces/hero/instant-demo-2/specimen.tsx 101 lines
import React from "react";
import { InstantDemo2, type InstantDemo2Props } from "../instant-demo-2";
import defaults from "../../studio-defaults.json";
export const states = ["default", "hover", "active", "disabled", "error"];
export default function InstantDemo2Specimen({ state = "default" }: { state?: InstantDemo2Props["state"] }) {
return (
<InstantDemo2
state={state}
headline="Watch only the parts of Shiftwell your clinic will use"
highlight="your clinic will use"
leads={[
{ lead: "Two taps.", text: "Tell us your role and how many staff you schedule." },
{ lead: "Your own cut.", text: "We drop the chapters that don't apply and put yours first." },
]}
questions={[
{
id: "role",
step: "Your role",
label: "What's your role at the clinic?",
options: [
{ id: "practice-manager", label: "Practice manager", phrase: "a practice manager" },
{ id: "owner", label: "Clinic owner", phrase: "a clinic owner" },
{ id: "front-desk", label: "Front desk lead", phrase: "a front desk lead" },
{ id: "clinical", label: "Clinical lead", phrase: "a clinical lead" },
],
},
{
id: "size",
step: "Team size",
label: "How many staff do you schedule?",
options: [
{ id: "1-10", label: "1–10" },
{ id: "11-25", label: "11–25" },
{ id: "26-60", label: "26–60" },
{ id: "60-plus", label: "60+" },
],
},
]}
chapters={[
{
title: "Build next week's rota on one screen",
detail: "Copy last week, drag shifts, publish to every phone.",
seconds: 100,
only: ["practice-manager", "owner", "front-desk"],
leadFor: ["practice-manager"],
},
{
title: "Fill a sick call before the first patient",
detail: "Shiftwell texts qualified staff and the first yes takes the shift.",
seconds: 80,
leadFor: ["front-desk"],
},
{
title: "Every shift covered by the right licence",
detail: "Credentials and skill mix are checked as you schedule.",
seconds: 70,
only: ["practice-manager", "owner", "clinical"],
leadFor: ["clinical"],
},
{
title: "Shift swaps that follow your rules",
detail: "Staff trade shifts; you only see the ones that need you.",
seconds: 60,
only: ["practice-manager", "front-desk"],
},
{
title: "Overtime and labour cost at a glance",
detail: "This week's hours against budget, before payroll runs.",
seconds: 70,
only: ["practice-manager", "owner"],
leadFor: ["practice-manager", "owner"],
},
{
title: "Rotas across several sites",
detail: "Share float staff between your locations.",
seconds: 80,
only: ["26-60", "60-plus"],
},
{
title: "Payroll export in two clicks",
detail: "Send approved hours straight to payroll.",
seconds: 50,
only: ["owner"],
leadFor: ["owner"],
},
{
title: "Set up in one afternoon",
detail: "Import your staff list and shift templates.",
seconds: 40,
},
]}
defaultAnswers={{ role: "practice-manager", size: "11-25" }}
askText="Enter your work email, then click the button below to start watching."
emailPlaceholder="you@yourclinic.com"
buttonLabel="Watch My Path"
reassurance={defaults.sample.registration.privacy}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalInstantDemo2 |
string |
|
highlight OptionalInstantDemo2 |
string |
|
leads OptionalInstantDemo2 |
InstantDemo2Lead[] |
|
questions OptionalInstantDemo2 |
InstantDemo2Question[] |
|
chapters OptionalInstantDemo2 |
InstantDemo2Chapter[] |
|
defaultAnswers OptionalInstantDemo2 |
Record<string, string> |
|
stepsLabel OptionalInstantDemo2 |
string |
|
stepEmpty OptionalInstantDemo2 |
string |
|
pathTitle OptionalInstantDemo2 |
string |
|
fullTitle OptionalInstantDemo2 |
string |
|
reasonLine OptionalInstantDemo2 |
string |
|
reasonEmpty OptionalInstantDemo2 |
string |
|
unitLabel OptionalInstantDemo2 |
string |
|
liveLine OptionalInstantDemo2 |
string |
|
pathLabel OptionalInstantDemo2 |
string |
|
leadTag OptionalInstantDemo2 |
string |
|
skippedOne OptionalInstantDemo2 |
string |
|
skippedMany OptionalInstantDemo2 |
string |
|
askLead OptionalInstantDemo2 |
string |
|
askText OptionalInstantDemo2 |
string |
|
emailLabel OptionalInstantDemo2 |
string |
|
emailPlaceholder OptionalInstantDemo2 |
string |
|
buttonLabel OptionalInstantDemo2 |
string |
|
reassurance OptionalInstantDemo2 |
string |
|
requiredMessage OptionalInstantDemo2 |
string |
|
invalidMessage OptionalInstantDemo2 |
string |
|
logos OptionalInstantDemo2 |
InstantDemo2Logo[] |
|
logosLabel OptionalInstantDemo2 |
string |
|
spotImage OptionalInstantDemo2 |
string |
|
onSubmit OptionalInstantDemo2 |
(values: InstantDemo2Values) => void |
|
onAnswer OptionalInstantDemo2 |
(answers: Record<string, string | null>) => void |
|
state OptionalInstantDemo2 |
"default" | "hover" | "active" | "disabled" | "error" |
|
className OptionalInstantDemo2 |
string |
Theme roles it reads
Set by the theme bar, a preset or your brand. Colours come from the base tokens (--surface, --ink, --cta…) every piece uses.
--button-bg--button-bg-2--button-case--button-font--button-ink--button-radius--button-shadow--button-text-shadow--button-weight- Main CTA button: background, ink, font, weight, case, radius and shadow.
--button-2-bg--button-2-ink- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
--marker- The highlighter colour behind key phrases.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
This piece reads no image slots.
-
b77916eca54aa689.webp
image/webp · 8.32 KB
-
d0943b629c0b1324.webp
image/webp · 8.87 KB
-
d435db6662febfcf.webp
image/webp · 10 KB
-
f0a5d3e1e61804ba.webp
image/webp · 11.6 KB