Scheduler
Month-view event calendar that lays events onto day cells.
Import
tsx
import { Scheduler } from "@cooud-ui/ui";
bash
npx cooud-ui add scheduler
Examples
API Reference
Generated from the component's exported types.
SchedulerProps
Extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue">
| Prop | Type | Default | Description |
|---|---|---|---|
month | Date | — | Controlled visible month. Provide together with `onMonthChange`. |
defaultMonth | Date | — | Initial visible month for the uncontrolled case. Defaults to "today". |
onMonthChange | (month: Date) => void | — | Called with the first day of the next visible month on Prev/Today/Next. |
events | SchedulerEvent[] | [] | Events to lay out across the grid. Bucketed by calendar day. |
onEventClick | (event: SchedulerEvent) => void | — | Fired when an event chip is activated. |
onDayClick | (date: Date) => void | — | Fired when a day cell (not a chip) is activated, with that day's date. |
today | Date | — | The day to highlight as "today". Optional and defaulting to `undefined` so server render and first client paint are deterministic — pass a stable Date (or compute one in an effect) to light up the current day without a hydration mismatch. |
weekStartsOn | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 0 | Locale-aware start of the week (0 = Sunday … 6 = Saturday). Defaults to `0`, matching the Sun…Sat header. |
ariaLabel | string | "Event calendar" | Accessible label for the grid. Defaults to "Event calendar". |