SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

FreeBusy

A "find a time" grid.

Noor HaddadNew York · 10:12 AMBusy Standup 9:30–10:00, Roadmap review 13:00–14:30
Mara LindqvistLondon · 3:12 PMBusy Crit prep 9:00–9:30
Tomás ReyesMexico City · 9:12 AMBusy 11:30–12:00
View code
tsx
<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.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
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.

PropTypeRequiredDescription
labelstringYesThe grid's accessible name, such as "Availability on November 18".
startnumberYesThe first visible minute from midnight, such as 480.
endnumberYesThe last visible minute from midnight, such as 1140.
stepnumberNoMinutes per column; the track's faint lines fall on it. @default 30
hoursHour[]YesThe axis labels; each also draws an hour line down the tracks.
peoplePerson[]Yes
slotsSlot[]No
nownumberNoThe present minute, drawn as a thin line.
formatTime(minute: number) => stringNoWrites the minutes in each row's summary. @default H:MM on a 24-hour clock
labelsLabelsYes

Also accepts everything in Omit<TagProps<"div">, "children">.

@sdxc/ui

Can’t find it? Contact us