Reservation 1
Reservation block: a booking path (party, day, open time, details) whose rail fills stop by stop and ends at the confirm button, so the visitor always sees how close they are to a held table.
Use it in a prompt
Use forms/reservation 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/reservation.tsx. - Import it and pass your copy and images (Props tab):
import { Reservation } from "@/components/funneldna/forms/reservation"
It restyles from the theme tokens on any wrapper (Theme tab). The specimen source is a complete working example.
pieces/forms/reservation/component.tsx 632 lines
// layout: path-to-action
// Reservation block: a booking path (party, day, open time, details) whose rail fills stop by stop and ends at the confirm button, so the visitor always sees how close they are to a held table.
// Theme: every colour, face, radius and shadow reads the theme contract tokens. The only hex is the white tick glyph fallback on the solid success badge (contract: status badges use a white glyph). Shadow colours are written inline as var(--shadow, oklch(...)) so the fixed value is only ever a var() fallback.
import * as React from "react";
import { AlertCircle, CalendarCheck, Check, Info, Lock } from "lucide-react";
export type ReservationChoice = {
value: string;
label: string;
/** Small line under the label, e.g. "guests" or "45 min" */
detail?: string;
/** How the choice reads in the summary, e.g. "Table for 2" */
summary?: string;
};
export type ReservationSlot = {
time: string;
/** Already taken: shown, struck through and not selectable */
full?: boolean;
};
export type ReservationDate = {
/** Stable value passed to onSubmit, e.g. "2026-11-27" */
value: string;
weekday: string;
day: string;
month: string;
/** Closed days show in the picker but cannot be chosen */
closed?: boolean;
/** The supplied open times for this day */
slots: ReservationSlot[];
};
export type ReservationValues = {
choice: string;
date: string;
time: string;
name: string;
phone: string;
email: string;
note: string;
};
export type ReservationField = { label: string; placeholder: string };
export type ReservationCopy = {
/** Screen-reader prefix for each step title; {n} is the step number */
stepLabel: string;
/** Placeholders: {weekday} {day} {month} */
dateSummary: string;
/** Placeholders: {choice} {date} {time} */
summary: string;
/** Placeholder: {name} (first name) */
detailsChip: string;
finalTitle: string;
pickDateFirst: string;
fullyBooked: string;
closed: string;
full: string;
optional: string;
errorChoice: string;
errorDate: string;
errorTime: string;
errorName: string;
errorPhone: string;
errorEmail: string;
};
export type ReservationProps = {
headline?: string;
/** The phrase inside the headline set in the accent colour */
highlight?: string;
lead?: string;
/** Slot "scene": the table, chair or room waiting for them */
sceneImage?: string;
sceneAlt?: string;
/** Step 1: party size, service or appointment type */
choiceTitle?: string;
choices?: ReservationChoice[];
/** "compact" for numbers (party size), "wide" for named services */
choiceLayout?: "compact" | "wide";
dateTitle?: string;
dates?: ReservationDate[];
timeTitle?: string;
detailsTitle?: string;
fields?: Partial<Record<"name" | "phone" | "email" | "note", ReservationField>>;
/** Show the optional note field */
showNote?: boolean;
copy?: Partial<ReservationCopy>;
defaultChoice?: string;
defaultDate?: string;
defaultTime?: string;
/** The plain instruction right above the button */
instruction?: string;
buttonLabel?: string;
reassurance?: string;
/** Shown when booking is disabled */
disabledNote?: string;
disabled?: boolean;
state?: "default" | "hover" | "active" | "disabled" | "error";
/** Called with the validated booking; the page wires what happens next */
onSubmit?: (values: ReservationValues) => void;
className?: string;
};
type ErrorKey = "choice" | "date" | "time" | "name" | "phone" | "email";
type Errors = Partial<Record<ErrorKey, string>>;
export function Reservation(props: ReservationProps) {
const {
headline = "Book your table in under a minute",
highlight = "in under a minute",
lead = "Choose your party, your night and an open time. Your table is set when you arrive.",
sceneImage,
sceneAlt = "A table for two set by the window",
choiceTitle = "How many are joining you?",
choices = DEFAULT_CHOICES,
choiceLayout = "compact",
dateTitle = "Pick your night",
dates = DEFAULT_DATES,
timeTitle = "Choose an open time",
detailsTitle = "Who is the table for?",
fields,
showNote = true,
copy,
defaultChoice = "",
defaultDate = "",
defaultTime = "",
instruction = "Tap the button below to confirm your reservation.",
buttonLabel = "Confirm my table",
reassurance = "We only use your details for this booking.",
disabledNote = "Online booking is paused right now. Please check back soon.",
disabled = false,
state = "default",
onSubmit,
className,
} = props;
const t: ReservationCopy = { ...DEFAULT_COPY, ...copy };
const f = { ...DEFAULT_FIELDS, ...fields };
const uid = React.useId();
const formRef = React.useRef<HTMLFormElement>(null);
const [values, setValues] = React.useState<ReservationValues>(() => ({
choice: defaultChoice,
date: defaultDate,
time: defaultTime,
name: "",
phone: "",
email: "",
note: "",
}));
const [submitted, setSubmitted] = React.useState(state === "error");
React.useEffect(() => {
setSubmitted(state === "error");
}, [state]);
const isDisabled = disabled || state === "disabled";
const choice = choices.find((c) => c.value === values.choice);
const day = dates.find((d) => d.value === values.date && !d.closed);
const slot = day?.slots.find((s) => s.time === values.time && !s.full);
const errors = validate(values, !!choice, !!day, !!slot, t);
const shown: Errors = submitted ? errors : {};
const done = [!!choice, !!day, !!slot, !errors.name && !errors.phone && !errors.email];
const current = done.indexOf(false);
const ready = current === -1;
const choiceText = choice ? choice.summary ?? choice.label : "";
const dateText = day ? fill(t.dateSummary, { weekday: day.weekday, day: day.day, month: day.month }) : "";
const firstName = values.name.trim().split(" ")[0] || "";
const summary = ready ? fill(t.summary, { choice: choiceText, date: dateText, time: values.time }) : t.finalTitle;
const update = (key: keyof ReservationValues, value: string) =>
setValues((v) => {
if (key !== "date") return { ...v, [key]: value };
const next = dates.find((d) => d.value === value);
const keep = next?.slots.some((s) => s.time === v.time && !s.full);
return { ...v, date: value, time: keep ? v.time : "" };
});
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
if (isDisabled) return;
setSubmitted(true);
const first = ORDER.find((k) => errors[k]);
if (!first) {
onSubmit?.(values);
return;
}
const target =
first === "name" || first === "phone" || first === "email"
? document.getElementById(uid + "-" + first)
: formRef.current?.querySelector<HTMLElement>("[data-group='" + first + "'] input:not(:disabled)");
target?.focus();
}
const errId = (k: string) => uid + "-" + k + "-err";
return (
<section className={cx("cf-reservation", sceneImage && "has-scene", className)} aria-labelledby={uid + "-h"}>
<style>{css}</style>
<div className="cf-reservation__wrap">
<header className="cf-reservation__head">
<h2 id={uid + "-h"} className="cf-reservation__h2">
{emphasise(headline, highlight)}
</h2>
{lead ? <p className="cf-reservation__lead">{lead}</p> : null}
</header>
<div className="cf-reservation__stage">
{sceneImage ? (
<figure className="cf-reservation__photo">
<img src={sceneImage} alt={sceneAlt} width={1120} height={400} loading="lazy" decoding="async" />
</figure>
) : null}
<form ref={formRef} className="cf-reservation__card" noValidate onSubmit={handleSubmit} aria-labelledby={uid + "-h"}>
{isDisabled && disabledNote ? (
<p className="cf-reservation__paused" role="status">
<Info size={18} strokeWidth={2.5} className="cf-reservation__inline-icon" aria-hidden="true" />
{disabledNote}
</p>
) : null}
<fieldset className="cf-reservation__shell" disabled={isDisabled}>
<ol className="cf-reservation__path">
<Stop n={1} done={done[0]} current={current === 0}>
<fieldset className="cf-reservation__set" data-group="choice" aria-describedby={shown.choice ? errId("choice") : undefined}>
<Legend step={fill(t.stepLabel, { n: 1 })} title={choiceTitle} chip={choiceText} />
<div className={cx("cf-reservation__choices", choiceLayout === "wide" && "is-wide")}>
{choices.map((c) => (
<label key={c.value} className="cf-reservation__tile">
<input
type="radio"
name={uid + "-choice"}
value={c.value}
checked={values.choice === c.value}
onChange={() => update("choice", c.value)}
/>
<span className="cf-reservation__face">
<span className="cf-reservation__big">{c.label}</span>
{c.detail ? <span className="cf-reservation__sub">{c.detail}</span> : null}
</span>
</label>
))}
</div>
{shown.choice ? <ErrorLine id={errId("choice")}>{shown.choice}</ErrorLine> : null}
</fieldset>
</Stop>
<Stop n={2} done={done[1]} current={current === 1}>
<fieldset className="cf-reservation__set" data-group="date" aria-describedby={shown.date ? errId("date") : undefined}>
<Legend step={fill(t.stepLabel, { n: 2 })} title={dateTitle} chip={dateText} />
<div className="cf-reservation__dates">
{dates.map((d) => (
<label key={d.value} className="cf-reservation__tile is-date">
<input
type="radio"
name={uid + "-date"}
value={d.value}
disabled={d.closed}
checked={values.date === d.value}
onChange={() => update("date", d.value)}
/>
<span className="cf-reservation__face">
<span className="cf-reservation__sub cf-reservation__wk">{d.weekday}</span>
<span className="cf-reservation__big">{d.day}</span>
<span className="cf-reservation__sub">{d.closed ? t.closed : d.month}</span>
</span>
</label>
))}
</div>
{shown.date ? <ErrorLine id={errId("date")}>{shown.date}</ErrorLine> : null}
</fieldset>
</Stop>
<Stop n={3} done={done[2]} current={current === 2}>
<fieldset className="cf-reservation__set" data-group="time" aria-describedby={shown.time && day ? errId("time") : undefined}>
<Legend step={fill(t.stepLabel, { n: 3 })} title={timeTitle} chip={slot ? values.time : ""} />
{day ? (
day.slots.some((s) => !s.full) ? (
<div key={day.value} className="cf-reservation__times">
{day.slots.map((s, i) => (
<label
key={s.time}
className={cx("cf-reservation__tile is-time", s.full && "is-full")}
style={{ "--i": Math.min(i, 4) } as React.CSSProperties}
>
<input
type="radio"
name={uid + "-time"}
value={s.time}
disabled={s.full}
checked={values.time === s.time}
onChange={() => update("time", s.time)}
/>
<span className="cf-reservation__face">
<span className="cf-reservation__time">{s.time}</span>
{s.full ? <span className="cf-reservation__sub">{t.full}</span> : null}
</span>
</label>
))}
</div>
) : (
<p className="cf-reservation__hint">{t.fullyBooked}</p>
)
) : (
<p className="cf-reservation__hint">{t.pickDateFirst}</p>
)}
{shown.time && day ? <ErrorLine id={errId("time")}>{shown.time}</ErrorLine> : null}
</fieldset>
</Stop>
<Stop n={4} done={done[3]} current={current === 3}>
<fieldset className="cf-reservation__set">
<Legend
step={fill(t.stepLabel, { n: 4 })}
title={detailsTitle}
chip={done[3] && firstName ? fill(t.detailsChip, { name: firstName }) : ""}
/>
<div className="cf-reservation__fields">
{FIELD_KEYS.map((k) => {
const id = uid + "-" + k;
const err = shown[k];
return (
<div key={k} className="cf-reservation__field">
<label htmlFor={id} className="cf-reservation__label">
{f[k].label}
</label>
<input
id={id}
name={k}
className="cf-reservation__input"
type={INPUTS[k].type}
autoComplete={INPUTS[k].autoComplete}
inputMode={INPUTS[k].inputMode}
placeholder={f[k].placeholder}
value={values[k]}
onChange={(e) => update(k, e.target.value)}
aria-invalid={err ? true : undefined}
aria-describedby={err ? id + "-err" : undefined}
/>
{err ? <ErrorLine id={id + "-err"}>{err}</ErrorLine> : null}
</div>
);
})}
{showNote ? (
<div className="cf-reservation__field is-note">
<label htmlFor={uid + "-note"} className="cf-reservation__label">
{f.note.label} <span className="cf-reservation__opt">{t.optional}</span>
</label>
<textarea
id={uid + "-note"}
name="note"
rows={2}
className="cf-reservation__input"
placeholder={f.note.placeholder}
value={values.note}
onChange={(e) => update("note", e.target.value)}
/>
</div>
) : null}
</div>
</fieldset>
</Stop>
<Stop n={5} end last ready={ready}>
<h3 className="cf-reservation__title cf-reservation__final-title" aria-live="polite">
{summary}
</h3>
<p className="cf-reservation__instruction">{instruction}</p>
<button
type="submit"
className={cx("cf-reservation__cta", state === "hover" && "is-hover", state === "active" && "is-active")}
>
{buttonLabel}
</button>
{reassurance ? (
<p className="cf-reservation__reassure">
<Lock size={16} strokeWidth={2.5} className="cf-reservation__inline-icon" aria-hidden="true" />
{reassurance}
</p>
) : null}
</Stop>
</ol>
</fieldset>
</form>
</div>
</div>
</section>
);
}
export default Reservation;
// private
function Stop(props: { n: number; done?: boolean; current?: boolean; last?: boolean; end?: boolean; ready?: boolean; children: React.ReactNode }) {
const { n, done = false, current = false, last = false, end = false, ready = false, children } = props;
return (
<li
className={cx("cf-reservation__stop", done && "is-done", current && "is-current", ready && "is-ready", end && "cf-reservation__final")}
aria-current={current || (end && ready) ? "step" : undefined}
>
<div className="cf-reservation__rail" aria-hidden="true">
{end ? (
<span className="cf-reservation__end">
<CalendarCheck size={24} strokeWidth={2.5} />
</span>
) : done ? (
<span className="cf-reservation__badge">
<Check size={18} strokeWidth={3} />
</span>
) : (
<span className="cf-reservation__num">{n}</span>
)}
{!last ? (
<span className="cf-reservation__seg">
<span className="cf-reservation__fill" />
</span>
) : null}
</div>
<div className="cf-reservation__body">{children}</div>
</li>
);
}
// private
function Legend(props: { step: string; title: React.ReactNode; chip?: React.ReactNode }) {
return (
<legend className="cf-reservation__legend">
<span className="cf-reservation__legend-row">
<span className="cf-reservation__title">
<span className="cf-reservation__sr">{props.step} </span>
{props.title}
</span>
{props.chip ? (
<span className="cf-reservation__chip">
<Check size={16} strokeWidth={2.5} aria-hidden="true" />
{props.chip}
</span>
) : null}
</span>
</legend>
);
}
// private
function ErrorLine(props: { id: string; children: React.ReactNode }) {
return (
<p id={props.id} className="cf-reservation__err" role="alert">
<AlertCircle size={16} strokeWidth={2.5} className="cf-reservation__inline-icon" aria-hidden="true" />
{props.children}
</p>
);
}
function validate(v: ReservationValues, hasChoice: boolean, hasDay: boolean, hasSlot: boolean, t: ReservationCopy): Errors {
const e: Errors = {};
if (!hasChoice) e.choice = t.errorChoice;
if (!hasDay) e.date = t.errorDate;
if (!hasSlot) e.time = t.errorTime;
if (!v.name.trim()) e.name = t.errorName;
if (v.phone.replace(/[^0-9]/g, "").length < 7) e.phone = t.errorPhone;
if (!/^[^ @]+@[^ @]+[.][^ @]{2,}$/.test(v.email.trim())) e.email = t.errorEmail;
return e;
}
function fill(template: string, map: Record<string, string | number>): string {
return Object.keys(map).reduce((out, key) => out.split("{" + key + "}").join(String(map[key])), template);
}
function emphasise(text: string, phrase?: string): React.ReactNode {
if (!phrase) return text;
const at = text.indexOf(phrase);
if (at < 0) return text;
return (
<>
{text.slice(0, at)}
<em>{phrase}</em>
{text.slice(at + phrase.length)}
</>
);
}
function cx(...parts: Array<string | false | null | undefined>): string {
return parts.filter(Boolean).join(" ");
}
function makeSlots(full: number[]): ReservationSlot[] {
return TIMES.map((time, i) => ({ time, full: full.includes(i) }));
}
const ORDER: ErrorKey[] = ["choice", "date", "time", "name", "phone", "email"];
const FIELD_KEYS = ["name", "phone", "email"] as const;
const INPUTS: Record<(typeof FIELD_KEYS)[number], { type: string; autoComplete: string; inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"] }> = {
name: { type: "text", autoComplete: "name" },
phone: { type: "tel", autoComplete: "tel", inputMode: "tel" },
email: { type: "email", autoComplete: "email", inputMode: "email" },
};
const DEFAULT_FIELDS: Record<"name" | "phone" | "email" | "note", ReservationField> = {
name: { label: "Full name", placeholder: "Jane Smith" },
phone: { label: "Mobile number", placeholder: "(555) 123-4567" },
email: { label: "Email address", placeholder: "you@example.com" },
note: { label: "Anything we should know?", placeholder: "Celebrating something? Any allergies?" },
};
const DEFAULT_COPY: ReservationCopy = {
stepLabel: "Step {n}:",
dateSummary: "{weekday} {day} {month}",
summary: "{choice} · {date} · {time}",
detailsChip: "For {name}",
finalTitle: "Your table is almost ready",
pickDateFirst: "Pick a day above to see the open times.",
fullyBooked: "Every time is taken on this day. Try another night.",
closed: "Closed",
full: "Full",
optional: "(optional)",
errorChoice: "Choose how many are joining you.",
errorDate: "Pick a day to see the open times.",
errorTime: "Choose a time to continue.",
errorName: "Enter the name for the booking.",
errorPhone: "Enter a number we can reach you on.",
errorEmail: "Enter a valid email, like you@example.com.",
};
const DEFAULT_CHOICES: ReservationChoice[] = ["1", "2", "3", "4", "5", "6"].map((n) => ({
value: n,
label: n,
detail: n === "1" ? "guest" : "guests",
summary: "Table for " + n,
}));
const TIMES = ["5:30 pm", "6:00 pm", "6:30 pm", "7:00 pm", "7:30 pm", "8:00 pm", "8:30 pm", "9:00 pm"];
const DEFAULT_DATES: ReservationDate[] = [
{ value: "2026-11-23", weekday: "Mon", day: "23", month: "Nov", closed: true, slots: [] },
{ value: "2026-11-24", weekday: "Tue", day: "24", month: "Nov", slots: makeSlots([2]) },
{ value: "2026-11-25", weekday: "Wed", day: "25", month: "Nov", slots: makeSlots([4]) },
{ value: "2026-11-26", weekday: "Thu", day: "26", month: "Nov", slots: makeSlots([3, 4]) },
{ value: "2026-11-27", weekday: "Fri", day: "27", month: "Nov", slots: makeSlots([2, 3, 5]) },
{ value: "2026-11-28", weekday: "Sat", day: "28", month: "Nov", slots: makeSlots([1, 2, 3, 5, 6]) },
{ value: "2026-11-29", weekday: "Sun", day: "29", month: "Nov", slots: makeSlots([4]) },
{ value: "2026-11-30", weekday: "Mon", day: "30", month: "Nov", closed: true, slots: [] },
];
const css = `
.cf-reservation{--res-gap:clamp(28px,3.5vw,40px);--res-rail:40px;background:var(--surface);color:var(--ink);font-family:var(--font-body);padding:clamp(56px,8vw,112px) clamp(16px,5vw,48px) clamp(64px,8.5vw,120px);overflow-x:clip}
.cf-reservation *,.cf-reservation *::before,.cf-reservation *::after{box-sizing:border-box}
.cf-reservation__wrap{max-width:1120px;margin:0 auto}
.cf-reservation__head{max-width:46rem;margin:0 auto;text-align:center}
.cf-reservation__h2{margin:0 0 16px;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(2rem,3.6vw,3.25rem);line-height:1.06;text-wrap:balance;color:var(--ink)}
.cf-reservation__h2 em{font-style:normal;color:var(--accent)}
.cf-reservation__lead{margin:0 auto;max-width:60ch;font-size:clamp(1.125rem,1.5vw,1.375rem);line-height:1.4;font-weight:500;color:var(--muted);text-wrap:pretty}
.cf-reservation__stage{margin-top:clamp(32px,4vw,48px)}
.cf-reservation__photo{margin:0;border-radius:var(--card-radius,var(--radius,12px));overflow:hidden;aspect-ratio:16/10;background:color-mix(in oklch,var(--ink) 6%,var(--surface))}
.cf-reservation__photo img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 60%}
.cf-reservation__card{position:relative;margin:16px 0 0;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(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.22),0 12px 24px -8px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.32)));padding:clamp(20px,4vw,48px)}
.cf-reservation:not(.has-scene) .cf-reservation__card{margin-top:0}
.cf-reservation__paused{margin:0 0 24px;padding:14px 16px;border-radius:min(10px,var(--radius,10px));background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--ink);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-reservation__inline-icon{display:inline-block;vertical-align:-0.15em;margin-inline-end:.4em}
.cf-reservation__shell{border:0;margin:0;padding:0;min-width:0}
.cf-reservation__path{list-style:none;margin:0;padding:0}
.cf-reservation__stop{display:grid;grid-template-columns:var(--res-rail) minmax(0,1fr);column-gap:clamp(12px,2.5vw,24px);padding-bottom:var(--res-gap)}
.cf-reservation__stop:last-child{padding-bottom:0}
.cf-reservation__rail{position:relative;display:flex;justify-content:center}
.cf-reservation__body{min-width:0}
.cf-reservation__num,.cf-reservation__badge,.cf-reservation__end{width:32px;height:32px;display:grid;place-items:center;flex:none}
.cf-reservation__num{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1;font-variant-numeric:tabular-nums;color:var(--muted);transition:color .16s ease}
.is-current .cf-reservation__num{color:var(--accent)}
.cf-reservation__badge{border-radius:999px;background:var(--success);color:var(--success-ink,#fff);animation:cf-res-pop .3s cubic-bezier(.2,.7,.2,1) both}
.cf-reservation__end{color:var(--muted);transition:color .16s ease}
.is-ready .cf-reservation__end{color:var(--success)}
.cf-reservation__seg{position:absolute;left:50%;top:40px;bottom:calc(8px - var(--res-gap));width:2px;margin-left:-1px;border-radius:2px;background:oklch(from var(--ink) l c h / 0.14);overflow:hidden}
.cf-reservation__fill{position:absolute;inset:0;background:var(--accent-fill,var(--accent));transform:scaleY(0);transform-origin:top;transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.is-done .cf-reservation__fill{transform:scaleY(1)}
.cf-reservation__set{border:0;margin:0;padding:0;min-width:0}
.cf-reservation__legend{float:left;width:100%;padding:0;margin:0 0 16px}
.cf-reservation__legend+*{clear:both}
.cf-reservation__legend-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;min-height:32px}
.cf-reservation__title{margin:0;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;text-wrap:balance;color:var(--ink)}
.cf-reservation__sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cf-reservation__chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:4px 12px;border-radius:999px;background:color-mix(in oklch,var(--ink) 6%,var(--card));color:var(--ink);font-size:.875rem;font-weight:800;line-height:1.2;animation:cf-res-pop .3s cubic-bezier(.2,.7,.2,1) both}
.cf-reservation__chip svg{flex:none;color:var(--success)}
.cf-reservation__choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:8px}
.cf-reservation__choices.is-wide{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}
.cf-reservation__dates{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(76px,1fr);gap:8px;overflow-x:auto;padding:6px 6px 12px;margin:-6px -6px -6px;scroll-snap-type:x proximity;overscroll-behavior-x:contain;scrollbar-width:thin}
.cf-reservation__times{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}
.cf-reservation__tile{position:relative;display:block;min-width:0;scroll-snap-align:start}
.cf-reservation__tile.is-time{animation:cf-res-in .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0) * .07s)}
.cf-reservation__tile input{position:absolute;top:0;left:0;width:1px;height:1px;margin:0;opacity:0;pointer-events:none;color:var(--field-ink,var(--ink));accent-color:var(--field-focus,var(--accent))}
.cf-reservation__face{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;height:100%;min-height:64px;padding:10px 12px;text-align:center;border-radius:var(--field-radius,var(--radius,12px));background:var(--field,var(--card));color:var(--field-ink,var(--ink));border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}
.is-date .cf-reservation__face{min-height:96px}
.is-time .cf-reservation__face{min-height:56px}
.cf-reservation__big{font-family:var(--font-display);font-weight:var(--display-weight,800);font-size:clamp(1.3125rem,1.8vw,1.625rem);line-height:1.1;font-variant-numeric:tabular-nums}
.cf-reservation__time{font-size:clamp(1.0625rem,1.25vw,1.125rem);font-weight:800;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap}
.cf-reservation__sub{font-size:.875rem;font-weight:700;line-height:1.2;color:color-mix(in oklch,var(--field-ink,var(--ink)) 70%,var(--field,var(--card)))}
.cf-reservation__wk{text-transform:uppercase;letter-spacing:.06em}
@media (hover:hover){.cf-reservation__tile input:not(:disabled)+.cf-reservation__face:hover{transform:translateY(-1px);border-color:oklch(from var(--field-focus,var(--accent)) l c h / 0.7);box-shadow:var(--shadow-sm,0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.2))}}
.cf-reservation__tile input:checked+.cf-reservation__face{transform:translateY(-1px);background:color-mix(in oklch,var(--accent) 12%,var(--field,var(--card)));border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent),var(--shadow-sm,0 1px 2px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.2))}
.cf-reservation__tile input:focus-visible+.cf-reservation__face{outline:3px solid oklch(from var(--field-focus,var(--accent)) l c h / 0.45);outline-offset:2px}
.cf-reservation__tile input:disabled+.cf-reservation__face{cursor:not-allowed;transform:none;background:color-mix(in oklch,var(--ink) 5%,var(--card));border-color:transparent;box-shadow:none;color:var(--muted)}
.cf-reservation__tile input:disabled+.cf-reservation__face .cf-reservation__sub{color:var(--muted)}
.is-full .cf-reservation__time{text-decoration:line-through;text-decoration-thickness:2px}
.cf-reservation__hint{margin:0;padding:16px;border-radius:min(10px,var(--radius,10px));background:color-mix(in oklch,var(--ink) 4%,var(--card));color:var(--muted);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-reservation__fields{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}
@media (min-width:900px){.cf-reservation__fields{grid-template-columns:repeat(3,minmax(0,1fr))}.cf-reservation__field.is-note{grid-column:1 / -1}}
.cf-reservation__field{min-width:0}
.cf-reservation__label{display:block;margin:0 0 8px;font-size:1.0625rem;font-weight:700;line-height:1.3;color:var(--label-ink,var(--ink))}
.cf-reservation__opt{font-weight:500;color:var(--muted)}
.cf-reservation__input{display:block;width:100%;min-height:56px;margin:0;padding:0 16px;font:inherit;font-size:1.0625rem;line-height:1.3;color:var(--field-ink,var(--ink));background:var(--field,var(--card));border:1px solid var(--field-border,color-mix(in oklch,var(--ink) 22%,transparent));border-radius:var(--field-radius,var(--radius,12px));appearance:none;transition:border-color .16s ease,box-shadow .16s ease}
textarea.cf-reservation__input{min-height:96px;padding:14px 16px;resize:vertical}
.cf-reservation__input::placeholder{color:color-mix(in oklch,var(--field-ink,var(--ink)) 65%,var(--field,var(--card)));opacity:1}
.cf-reservation__input: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-reservation__input[aria-invalid="true"]{border-color:var(--danger)}
.cf-reservation__input[aria-invalid="true"]:focus{box-shadow:0 0 0 3px oklch(from var(--danger) l c h / 0.3)}
.cf-reservation__input:disabled{cursor:not-allowed;background:color-mix(in oklch,var(--ink) 5%,var(--card));color:var(--muted)}
.cf-reservation__err{margin:8px 0 0;color:var(--danger);font-size:.9375rem;font-weight:600;line-height:1.4;text-wrap:pretty}
.cf-reservation__final-title{margin:0 0 12px;padding-top:1px}
.cf-reservation__instruction{margin:0 0 24px;font-size:clamp(1.0625rem,1.25vw,1.125rem);line-height:1.5;color:var(--ink);text-wrap:pretty}
.cf-reservation__cta{appearance:none;border:0;margin:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-height:72px;min-width:min(100%,320px);padding:0 28px;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;text-align:center;text-wrap:balance;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.3),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-reservation__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:inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) 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.32),0 12px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.5)}
@media (hover:hover){.cf-reservation__cta: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:inset 0 1px 0 oklch(from var(--button-bg,var(--cta)) calc(l + 0.12) 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.32),0 12px 20px -6px oklch(from var(--shadow,oklch(0.22 0.03 260)) l c h / 0.5)}}
.cf-reservation__cta:active:not(:disabled),.cf-reservation__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.55),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.3)}
.cf-reservation__cta:focus-visible{outline:3px solid oklch(from var(--button-bg,var(--cta)) l c h / 0.5);outline-offset:3px}
.cf-reservation__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:var(--button-2-shadow,var(--shadow-sm))}
.cf-reservation__reassure{margin:12px 0 0;color:var(--muted);font-size:.9375rem;font-weight:500;line-height:1.4;text-wrap:pretty}
@media (max-width:599px){.cf-reservation{--res-rail:32px}.cf-reservation__cta{width:100%}}
@media (min-width:760px){.cf-reservation__photo{aspect-ratio:14/5}.cf-reservation.has-scene .cf-reservation__card{max-width:920px;margin:calc(-1 * clamp(96px,14vw,160px)) auto 0}}
@keyframes cf-res-in{from{opacity:.82;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cf-res-pop{from{transform:scale(.9)}to{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.cf-reservation *,.cf-reservation *::before,.cf-reservation *::after{animation:none !important;transition:none !important}}
`;
pieces/forms/reservation/specimen.tsx 24 lines
import __studioImagef3a6dd52 from "../assets/15bd4beb9eb30257.webp";
import { Reservation } from "../reservation";
import { slot } from "../../slots";
export const states = ["default", "hover", "active", "disabled", "error"] as const;
type SpecimenState = (typeof states)[number];
export default function ReservationSpecimen({ state = "default" }: { state?: SpecimenState }) {
const filled = state !== "error";
return (
<Reservation
key={state}
state={state}
sceneImage={slot(
"scene",
__studioImagef3a6dd52
)}
sceneAlt="A candlelit table for two set by a tall window at dusk"
defaultChoice="2"
defaultDate="2026-11-27"
defaultTime={filled ? "7:30 pm" : ""}
/>
);
}
| Name | Type | Details |
|---|---|---|
headline OptionalReservation |
string |
|
highlight OptionalReservation |
string |
|
lead OptionalReservation |
string |
|
sceneImage OptionalReservation |
string |
|
sceneAlt OptionalReservation |
string |
|
choiceTitle OptionalReservation |
string |
|
choices OptionalReservation |
ReservationChoice[] |
|
choiceLayout OptionalReservation |
"compact" | "wide" |
|
dateTitle OptionalReservation |
string |
|
dates OptionalReservation |
ReservationDate[] |
|
timeTitle OptionalReservation |
string |
|
detailsTitle OptionalReservation |
string |
|
fields OptionalReservation |
Partial<Record<"name" | "phone" | "email" | "note", ReservationField>> |
|
showNote OptionalReservation |
boolean |
|
copy OptionalReservation |
Partial<ReservationCopy> |
|
defaultChoice OptionalReservation |
string |
|
defaultDate OptionalReservation |
string |
|
defaultTime OptionalReservation |
string |
|
instruction OptionalReservation |
string |
|
buttonLabel OptionalReservation |
string |
|
reassurance OptionalReservation |
string |
|
disabledNote OptionalReservation |
string |
|
disabled OptionalReservation |
boolean |
|
state OptionalReservation |
"default" | "hover" | "active" | "disabled" | "error" |
|
onSubmit OptionalReservation |
(values: ReservationValues) => void |
|
className OptionalReservation |
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--button-2-shadow- Secondary button.
--card-border--card-radius--card-shadow- Cards and panels: radius, border and shadow.
--display-case--display-tracking--display-weight- Headlines: weight, letter case and tracking.
--field--field-border--field-focus--field-ink--field-radius- Form inputs: background, ink, border, radius and focus colour.
Image slots
Filled from the brand’s images; the specimen ships its own defaults.
scene- A wide atmosphere photo behind or beside the copy.
-
15bd4beb9eb30257.webp
image/webp · 75.4 KB