Slot picker
A day strip or a month, then the times: duration, time zone with its offset, taken and past slots struck, one chosen. For bookings.
import { SlotPicker, daySlots } from "@forgeron/ui";30 minEurope/Paris UTC+1
Nov 18 · Wednesday
import { SlotPicker, defaultWeekly } from "@forgeron/ui";
export default function Strip() {
return (
<SlotPicker
availability={{ timezone: "Europe/Paris", weekly: defaultWeekly(), exceptions: [] }}
busy={[{ date: "2026-11-18", start: "10:00", end: "11:00" }]}
duration={30}
defaultDate="2026-11-18"
now="2026-11-18T09:40"
confirmLabel="Book"
onConfirm={() => {}}
/>
);
}1 h
November 2026
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
Nov 18 · Wednesday
// A month beside the times; the viewer reads them in their own zone.
import { SlotPicker, defaultWeekly } from "@forgeron/ui";
export default function CalendarAndZone() {
return (
<SlotPicker
layout="calendar"
availability={{ timezone: "Europe/Paris", weekly: defaultWeekly(), exceptions: [] }}
duration={60}
defaultDate="2026-11-18"
defaultTimezone="America/New_York"
now="2026-11-18T04:00"
/>
);
}API → Props
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | SlotChoice | null | — | { date, time, timezone, duration, host } in the zone shown, and the same moment where the hours are written. Controlled or not. |
onChange | (slot: SlotChoice | null) => void | — | A click on a free time chooses it; another click removes it. |
availability / busy | Availability / BusyBlock[] | — | Hours and time already taken: the slots are computed from them. |
slots | { date, time, available? }[] | — | Slots given as they are (a server's answer), in the host's zone; they replace the computation. |
duration / interval | number | 30 / duration | Minutes of a visit and between two starts. |
hostTimezone | string | availability.timezone | The zone the hours and slots are written in. |
timezone / defaultTimezone | string | — | The zone shown; the slots move to it. Controlled or not. |
onTimezoneChange / timezonePicker | (zone) => void / boolean | — | Lets the person change the zone. |
layout | "strip" | "calendar" | "strip" | A row of days with their counts, or a month beside the times. |
date / defaultDate | string | — | The day shown. Controlled or not. |
days / max | number / string | 7 | Days in the strip; the last day that can be booked. |
now | string | — | YYYY-MM-DDTHH:mm in the zone shown: earlier slots are past. |
showUnavailable / hour12 | boolean | true / false | Keep taken slots in the list, struck; AM and PM. |
confirmLabel / onConfirm | string / (slot) => void | — | A primary button under the times. |
className | string | — | Extra classes. |