SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

TimeGrid

A calendar's time grid.

ESTGMTTuesday, November 17, 2026Wednesday, November 18, 2026Thursday, November 19, 2026All day
Product offsite
View code
tsx
<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.

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

Usage

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

PropTypeRequiredDescription
labelstringYesThe grid's accessible name, such as "Week of November 16".
idstringYesUnique on the page; prefixes every event's popover id.
daysDay[]Yes
eventsEvent[]Yes
spansSpan[]No
zonesZone[]YesThe viewer's zone, then any second zone, as columns of hour labels.
todaystringNoToday, as YYYY-MM-DD; its header is marked.
now{ date: string; minute: number; at: number }NoThe 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 }NoThe minutes outside it are shaded, such as { start: 540, end: 1080 }.
scrollTonumberNoThe minute the grid opens scrolled to. @default 480
localestringNoFormats the day headers and the times a change announces. @default "en"
editEditNo
pages{ previous: string; next: string }NoThe 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.
labelsLabelsYes

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

@sdxc/ui

Can’t find it? Contact us