Calendar
A date grid with single, range and multiple selection. Months slide in the direction you navigate and the selection pill glides between days. Zero date library.
Saturday, October 31
Playground
Tweak the props, the preview and the code follow.
const [value, setValue] = React.useState<Date | undefined>()
<Calendar
mode="single"
selected={value}
onSelect={setValue}
/>Installation
npx @plumsydev/plum-ui add calendarUsage
import { Calendar, type DateRange } from "@/components/ui/calendar"const [date, setDate] = React.useState<Date | undefined>(new Date())
<Calendar mode="single" selected={date} onSelect={setDate} />Examples
Range
Two months side by side, minDate to block the past and a live preview of the range on hover.
Multiple
Pick any number of days. Each one pops in with a spring.
Click days to add them. Click again to remove.
Booking
Weekends disabled, a two-month window and time slots that react to the selected day.
Pick a weekday
API Reference
Calendar
| Prop | Type | Default |
|---|---|---|
modeSelection model. Drives the type of `selected` and `onSelect`. | "single" | "range" | "multiple" | "single" |
selectedControlled selection. Leave it out to let the calendar manage its own state. | Date | DateRange | Date[] | — |
defaultSelectedInitial selection when uncontrolled. | Date | DateRange | Date[] | — |
onSelectCalled with the new selection. Clicking a selected day in single mode clears it. | (value) => void | — |
monthControlled visible month. | Date | — |
defaultMonthInitial visible month. Defaults to the selection, then today. | Date | — |
onMonthChangeCalled when navigating. | (month: Date) => void | — |
numberOfMonthsRender one or two months side by side. | 1 | 2 | 1 |
disabledReturn true to disable a day. | (date: Date) => boolean | — |
minDateDays before are disabled and navigation stops. | Date | — |
maxDateDays after are disabled and navigation stops. | Date | — |
weekStartsOn0 for Sunday, 1 for Monday. | 0 | 1 | 1 |
localeAny BCP 47 locale. Month and weekday names come from `Intl`. | string | "en-US" |
showOutsideDaysShow the trailing days of the adjacent months. | boolean | true |
childrenFooter rendered under the grid. | ReactNode | — |
Notes
- Keyboard: arrows move by day and week,
PageUp/PageDownby month (addShiftfor a year),Home/Endjump to the week edges,Enterselects. - Every grid has six rows, so the height never jumps between months.