TimeGrid
A calendar's time grid.
ESTGMTTuesday, November 17, 2026Wednesday, November 18, 2026Thursday, November 19, 2026All day
Product offsite
View code
<TimeGrid
id="week"
label="Three days from November 17"
days={[{ date: "2026-11-17" }, { date: "2026-11-18" }, { date: "2026-11-19" }]}
zones={[{ label: "EST", hours: est }, { label: "GMT", hours: gmt }]}
today="2026-11-18"
spans={[{ id: "offsite", start: "2026-11-18", end: "2026-11-19", title: "Product offsite" }]}
events={[
{ id: "a", date: "2026-11-18", start: 540, end: 600, title: "Standup", time: "9 – 10 AM" },
{ id: "b", date: "2026-11-18", start: 570, end: 660, title: "Design review", time: "9:30 – 11 AM" },
{ id: "c", date: "2026-11-17", start: 600, end: 690, title: "Planning", editable: true },
]}
edit={{ move: { action: "/events/move" }, create: { action: "/events/new", method: "get" } }}
labels={{ allDay: "All day", now: "Now", moved: "{title} moved to {time}", resized: "{title} now ends at {time}" }}
/>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 { TimeGrid } from "@sdxc/ui/schedule";Renders the grid: a header of day links over the all-day lane, then one scroller holding the
hour labels and the day columns. Each event is placed from its minutes, side by side with
those it overlaps; an editable one also takes a resize edge, and the forms edit names.
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 "Week of November 16". |
id | string | Yes | Unique on the page; prefixes every event's popover id. |
days | Day[] | Yes | |
events | Event[] | Yes | |
spans | Span[] | No | |
zones | Zone[] | Yes | The viewer's zone, then any second zone, as columns of hour labels. |
today | string | No | Today, as YYYY-MM-DD; its header is marked. |
now | { date: string; minute: number; at: number } | No | The present: the day, its minute, and the instant it was read, so the line moves on as time passes and a cached page still draws it where the clock is. |
workday | { start: number; end: number } | No | The minutes outside it are shaded, such as { start: 540, end: 1080 }. |
scrollTo | number | No | The minute the grid opens scrolled to. @default 480 |
locale | string | No | Formats the day headers and the times a change announces. @default "en" |
edit | Edit | No | |
pages | { previous: string; next: string } | No | The previous and next ranges' addresses, which a horizontal swipe on a touch screen follows; keep visible arrows beside the grid, since a swipe has no affordance. |
labels | Labels | Yes |
Also accepts everything in Omit<TagProps<"div">, "children">.