Usage
import { BookingSlots } from './BookingSlots.jsx'
// Without callbacks it runs on a sample week. Wire it to your calendar:
<BookingSlots
locale="en"
today="2026-12-08"
times={salon.startTimes} // ['09:00', '09:30', ...]
closed={[0]} // Sundays
taken={calendar.taken} // { '2026-12-09': ['10:00', '13:30'] }
stylist={{ name: 'Mara', look: 'long', tone: 'secondary' }}
service="Cut & blow-dry"
minutes={60}
onDayChange={(day) => calendar.load(day)} // a promise shows the times loading
onContinue={({ day, time }) => holdTime(day, time)}
onWaitlist={(day) => joinWaitlist(day)}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
locale | 'en' | 'zh-CN' | 'es' | 'ja' | 'en' | Language of the text, dates and times. |
today | 'YYYY-MM-DD' | '2026-12-08' | The current day; earlier days count as past. The sample uses a fixed day. |
times | string[] | 16 sample times | Start times of an open day, 'HH:MM'. An empty array shows the empty state. |
closed | number[] | [0] | Weekdays the salon is closed, 0 for Sunday. |
taken | { [day]: string[] } | sample bookings | Times already booked, per day. A day with every time taken shows as full. |
stylist / service / minutes | { name, avatar?, look?, tone? } / string / number | sample | Who and what the time is for (avatar, an image URL, replaces the drawn portrait); minutes give the end time. |
defaultDay / defaultTime | string | first free day / '10:30' | Day and time chosen at first; a taken time is ignored. |
loading | boolean | false | Shows the skeleton of the week while it loads. |
error | boolean | string | false | Shows the error banner with a retry button; a string replaces its sentence. |
onDayChange | (day) => Promise | void | — | Another day was chosen; while a returned promise runs, the times show as loading. |
onChange | (day, time | null) => void | — | The chosen day or time changed. |
onContinue | ({ day, time }) => Promise | void | — | Holds the chosen time; the button waits for a returned promise. |
onWaitlist / onRetry | (day) => void / () => void | — | A full day’s waiting list was joined; and the error banner’s retry. |
labels | object | — | Replaces any built-in text (keys as in copy.js). |
className | string | — | Added to the root element; other attributes go there too. |
Add it to your project
Copy the prompt into Codex or Claude Code. The agent reads the published source, shows you what it will write and adds the block together with the components it is built from.
BookingSlots.jsxbooking-slots.csscopy.jskit.jsxkit.cssui/base-button/ui/empty-state/ui/alert-banner/ui/success-check/ui/skeleton-shimmer/ui/week-strip/tokens.cssREADME.md
The block, its stylesheet and text, the shared kit, the components it uses and tokens.css install together into one folder.