FreeBusy
A "find a time" grid.
View code
<FreeBusy
label="Availability on November 18"
start={480}
end={1080}
hours={hours}
labels={{ busy: "Busy {times}", free: "Free all day" }}
people={[
{ id: "noor", name: "Noor Haddad", detail: "New York", busy: [{ start: 570, end: 600, title: "Standup" }] },
{ id: "mara", name: "Mara Lindqvist", detail: "London", busy: [], outside: [{ start: 750, end: 1080 }] },
]}
slots={[{ start: 600, end: 690, label: "10:00", href: "/new?start=600", selected: true }]}
/>Installation
An ordinary dependency: install it, import the theme once, and import the component where it is used.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
import { FreeBusy } from "@sdxc/ui/schedule";Renders the grid: a sticky column of names beside a track per person, under an axis of hours and a row of slot labels. Every block is placed as a percentage of the visible range, so it lines up at any width; each name carries a hidden summary of that person's busy times.
Props
Read from the component's own types, so every prop, every default and every allowed value is listed.
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | Yes | The grid's accessible name, such as "Availability on November 18". |
start | number | Yes | The first visible minute from midnight, such as 480. |
end | number | Yes | The last visible minute from midnight, such as 1140. |
step | number | No | Minutes per column; the track's faint lines fall on it. @default 30 |
hours | Hour[] | Yes | The axis labels; each also draws an hour line down the tracks. |
people | Person[] | Yes | |
slots | Slot[] | No | |
now | number | No | The present minute, drawn as a thin line. |
formatTime | (minute: number) => string | No | Writes the minutes in each row's summary. @default H:MM on a 24-hour clock |
labels | Labels | Yes |
Also accepts everything in Omit<TagProps<"div">, "children">.