Calendar: Month and year dropdowns
captionLayout="dropdown" replaces the caption with native selects, so phones get their own picker. Set startMonth and endMonth to bound the years.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
This adds the example as components/examples/calendar/dropdowns.tsx, together with the Calendar component and the HextaUI theme tokens it needs.
pnpm dlx shadcn@latest add https://hextaui.com/r/calendar-dropdowns.jsonTo add only the component, follow the Calendar installation.
Props in this example
The Calendar props this example sets, from the API reference.
| Prop | Type | Default |
|---|---|---|
modeWithout a mode, days are not selectable. | "single" | "multiple" | "range" | – |
defaultMonth | Date | – |
startMonth | Date | – |
endMonth | Date | – |
captionLayout | "label" | "dropdown" | "dropdown-months" | "dropdown-years" | "label" |
Every prop is in the Calendar API reference.
See them all, with keyboard support and accessibility notes, on the Calendar page.
- ButtonButtons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- MotionThe easing curves, durations and reduced-motion check every component animates with, plus hooks for size morphs and sliding highlights.
- useTodayToday's date that rolls over at midnight and when the tab comes back, without a hydration mismatch.
- CheckboxA checkbox whose check draws in, with indeterminate parents, groups and labels that share its hover.
- ComboboxA filterable select with chips, groups and async results, in a popup that resizes as you type.
- Date pickerA button that opens a calendar in a popover, or a bottom sheet on phones, for single dates and ranges.