Time Grid

A day, three days or a week of hours: overlapping events side by side, drag to add, move and resize, the keyboard, time zones and working hours.

December 2026

EST
All day
9:00 AM

Tuesday, December 8, 2026

All day
9:00 AM

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/time-grid

Usage

import { expandEvents, type ScheduleEvent } from "./ui/uicontext/components/schedule/Events.ts"import { TimeGrid } from "./ui/uicontext/components/schedule/TimeGrid.ts"
const Message = UiSchema.TaggedEnum({	RequestedDateCalendar: { date: Schema.String },	RequestedNewEvent: { start: Schema.String, end: Schema.String },	RequestedMoveEvent: { occurrence: Schema.String, start: Schema.String, end: Schema.String },})export const Week = (h: Html.H<typeof Message.Type>, events: ReadonlyArray<ScheduleEvent>, date: string, now: string) =>	TimeGrid(h, {		props: {			label: "Calendar",			// repeats become one occurrence per day; give the grid the weeks around the one shown			occurrences: expandEvents(events, "2026-12-01T00:00:00Z", "2026-12-20T00:00:00Z"),			date,			view: "week",			timeZone: "America/New_York",			now,		},		onEmit: {			RequestedDate: ({ date }) => Message.RequestedDateCalendar({ date }),			RequestedCreate: ({ start, end }) => Message.RequestedNewEvent({ start, end }),			// move it at once with moveOccurrence; keep `previous` for an Undo			RequestedChange: ({ occurrence, start, end }) => Message.RequestedMoveEvent({ occurrence, start, end }),			RequestedOpen: () => undefined,			RequestedDelete: () => undefined,			RequestedView: () => undefined,		},	})

Examples

Two time zones, read-only

New York's hours with London's beside them, lunch shaded from the working hours, and nothing to drag.

December 2026

GMTEST
All day
9:00 AM

Tuesday, December 8, 2026

9:00 AM

Thirty events in a day

Clashes three deep, long titles and calls that overlap the next: the worst a day should look.

EST
All day
9:00 AM
All day
9:00 AM

API reference

Props

TimeGrid props
NameTypeDefaultDescription
labelrequiredstring—What the grid shows: "Team calendar"
occurrencesrequiredOccurrence[]—The occurrences to draw (see expandEvents); the grid picks the ones on its days
daterequiredIsoDate—A day in the period shown
viewrequiredTimeGridView——
timeZonerequiredTimeZoneId—The zone times are drawn in
secondZoneTimeZoneId—A second zone, its hours beside the first
nowrequiredstring—The app's current instant (ISO): today and the line across it
weekStartnumber—The first day of the week, 0 (Sunday) to 6; the locale's by default
stepInt15Minutes a drag or an arrow key snaps to; 15 by default
defaultDurationInt30Minutes a click or Enter makes; 30 by default
workingHoursHoursRange[][]—Working hours per weekday, Sunday first, in timeZone; the rest is shaded
selectedstring | null—The occurrence whose details are open: it's marked, and an EventPopover anchors to it
readOnlystring—Why nothing can be changed here: "You can view this calendar, not edit it"
outcomesOutcome[]—The answers to its requests
controlsbooleantrueDraw the title, Today, Previous, Next and the view switch; true by default
localestring——
hour12boolean——
scrollToInt—The minute to scroll to as it opens; an hour before working hours by default
agentIdstring——

Events

TimeGrid events
EventPayloadDescription
RequestedDate{ date: IsoDate }Show another period: a day in it
RequestedView{ view: TimeGridView }—
RequestedOpen{ occurrence: string }Open an occurrence's details
RequestedCreate{ start: string; end: string; allDay: boolean }A new event over these times (ISO instants), or these days when allDay
RequestedChange{ request: string; occurrence: string; start: string; end: string; previous: { start, end } }New times for an occurrence; previous are the times it had, for an Undo. Answer through outcomes
RequestedDelete{ occurrence: string }—

Agent actions

What agents can do with TimeGrid
ActionDescription
ChoseDateShow the period around a day, "YYYY-MM-DD"
PickedViewShow a day, 3 days, the work week or the week
ClickedEventOpen an event's details by its id
RequestedCreateEventMake an event over two ISO instants; the app asks for its title
RequestedMoveEventGive an event new times: its id and two ISO instants

Source