Jump to a page or a component.
Month grid, slot column, or both — date, time and datetime pickers.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
No install — ask an AI agent to copy this component from registry.json, then pnpm add react-day-picker.
import { Calendar, CalendarDayButton, CalendarGranularity, getCalendarTime, setCalendarTime } from "@/components/ui/calendar";selected. DayPicker types selected/onSelect as a closed union keyed on mode, so a Date there would mean one thing under mode="single" and nothing under mode="range". getCalendarTime / setCalendarTime bridge the two so a datetime calendar still drives one Date in state.time is given, like the day selection above it.locale also drives the month dropdown's own labels, so a localized calendar does not end up with English month abbreviations in its caption.${testId}-day-2026-09-19) and built from local date parts, not toISOString — the latter converts to UTC and would label the cell with the previous day east of Greenwich.The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.
| Prop | Type | Default | Description |
|---|---|---|---|
| granularity | "date" | "time" | "datetime" | "date" | Which fields show: the month grid, a time field, or both. |
| time / defaultTime | string | — | Controlled / initial selection, "HH:mm". |
| onTimeChange | (time: string) => void | — | Called with the row's "HH:mm" value when it is clicked. |
| timeStep | number | 30 | Minutes between generated slots. |
| timeStart / timeEnd | string | "00:00" / "23:30" | Bounds of the generated list, both inclusive. |
| timeSlots | string[] | — | Explicit "HH:mm" list, for an irregular set of times. |
| timeDisabled | (time: string) => boolean | — | Greys a row out and makes it unclickable. |
| formatTime | (time: string) => string | locale hour/minute | Row label from a 24-hour value. |
| timeLabel | string | "Time" | Accessible name for the column. Pass a translated string. |
| mode | "single" | "multiple" | "range" | — | Selection behaviour. Passed through to DayPicker. |
| captionLayout | "label" | "dropdown" | … | "label" | Month caption style. |
| buttonVariant | Button variant | "ghost" | Variant for the prev/next arrows. |
| showOutsideDays | boolean | true | Render neighbouring months' leading/trailing days. |