UIComponentsReact
A calendar of events by day, week, work week, month or agenda, where people pick a time for a new event and move or resize the ones there by pointer, touch or keyboard.
Built on the headless Scheduler.See its API in Docs
Rendered by React 19.3.1
Installation
npx shadcn@4.23.0 add https://hamur.dev/r/react/scheduler.jsonIt also adds utils, button. The app needs its setup first: Installation.
Usage
Put a SchedulerHeading, the SchedulerPrevButton, SchedulerTodayButton and SchedulerNextButton, and a SchedulerGrid (or a SchedulerAgenda for the agenda view) inside Scheduler, and give it the app's events. The Grid's children are a function of its model: map it to a SchedulerGridHeader with a row of SchedulerHeaderCells (an empty one first, over the times) and the all-day row (a SchedulerRowHeader without time, then one SchedulerSlot date per day), and a SchedulerGridBody with one SchedulerGridRow per slot row (a SchedulerRowHeader with time on the hour's first row, then one SchedulerSlot start per day). A Slot holds the SchedulerEvents of the segments that start in it, each followed by its SchedulerMoveHandle and its two SchedulerResizeHandles (edge start and end), then the SchedulerPlaceholder when the model names that slot, and today's first row the SchedulerNowIndicator. The month grid is a row of weekday header cells and one row per week of day cells, with a SchedulerMoreButton for the events a cell does not draw. The agenda maps its days to SchedulerAgendaDays with a SchedulerAgendaHeading and their Events; SchedulerEmpty shows while the range has none. view, date, events, onEventChange, value, onValueChange, slotDuration, minTime, maxTime, locale, labels, readOnly, disabled and the rest come from the headless Scheduler.
import {
Scheduler,
SchedulerAgenda,
SchedulerAgendaDay,
SchedulerAgendaHeading,
SchedulerEmpty,
SchedulerEvent,
SchedulerGrid,
SchedulerGridBody,
SchedulerGridHeader,
SchedulerGridRow,
SchedulerHeaderCell,
SchedulerHeading,
SchedulerMoreButton,
SchedulerMoveHandle,
SchedulerNextButton,
SchedulerNowIndicator,
SchedulerPlaceholder,
SchedulerPrevButton,
SchedulerResizeHandle,
SchedulerRowHeader,
SchedulerSlot,
SchedulerTodayButton,
} from '@/components/ui/scheduler'Examples
Default
A working week from 8:00 to 18:00 with overlapping events that move and resize by pointer or keyboard.
The Grid scrolls inside its border, so give it a height (max-h-96, say); its header stays on top, and the Grid's scroll-padding-top keeps a focused slot below it. A slot is --scheduler-slot-height tall (2rem) and the times take --scheduler-gutter (4rem); set either on Scheduler to change them. An Event is placed in its day column by the segment's CSS variables and shares the column with the events it overlaps; in the all-day row, the month and the agenda it is a chip instead. The handles show while their Event is hovered or focused (data-hovered, data-focused) and stay in the accessibility tree; they may be smaller than 24 by 24 CSS pixels (WCAG 2.5.8) because a press of a handle then a slot, the arrow keys after Enter, and the app's edit form do the same thing (WCAG 2.5.7). Each control has a focus ring (WCAG 2.4.7). The PrevButton and NextButton are the Button's outline icon-sm with chevrons that turn in right-to-left text, named by the view ("Previous week"); the TodayButton is the outline sm with the app's text. There is no view switcher part: bind a Toggle Group to view. This item takes Base UI's component ID as its slug and one name per Base UI part.
API reference
The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Scheduler's API reference.