
Date picker with single and multiple selection via DayPicker.
npx shadcn@latest add https://ui.edbn.me/api/analytics/registry/calendar.jsonStyled DayPicker v10 wrapper. Forwards supported DayPicker props, forwards refs to the root element, and defaults showOutsideDays to true and navLayout to around.
mode'single' | 'multiple'undefinedEnables single-day or multiple-day selection. Omit for a non-selecting calendar.
selectedDate | Date[]undefinedControlled selected value for the active selection mode.
onSelectOnSelectHandler<Date | Date[]>undefinedCalled with the next selection, trigger date, modifiers, and input event.
requiredbooleanfalsePrevents clearing the current selection.
min / maxnumberundefinedMinimum and maximum selected dates for multiple selection mode.
defaultMonthDatecurrent monthInitial visible month for uncontrolled navigation.
monthDateundefinedControlled visible month.
onMonthChange(month: Date) => voidundefinedCalled when the visible month changes.
startMonth / endMonthDateundefinedEarliest and latest month available to navigation. Use these instead of deprecated fromDate/toDate props.
numberOfMonthsnumber1Number of months to render.
pagedNavigationbooleanfalseMoves by numberOfMonths when navigating multi-month calendars.
reverseMonthsbooleanfalseRenders multiple months in reverse order.
captionLayout'label' | 'dropdown' | 'dropdown-months' | 'dropdown-years''label'Controls month/year caption rendering. Dropdown layouts are rendered through the local Select component while preserving DayPicker's month and year navigation contract.
navLayout'around' | 'after''around'Controls navigation button placement. The wrapper defaults to around for balanced visual navigation.
hideNavigationbooleanfalseHides previous/next navigation controls.
disableNavigationbooleanfalseDisables navigation without hiding the controls.
showOutsideDaysbooleantrueShows days from adjacent months in the current grid.
fixedWeeksbooleanfalseAlways renders six weeks for each month.
showWeekNumberbooleanfalseAdds a week-number column.
autoFocusbooleanfalseFocuses the selected day or today after mount. Use instead of deprecated initialFocus.
disabledMatcher | Matcher[]undefinedDates that cannot be selected.
hiddenMatcher | Matcher[]undefinedDates removed from the rendered calendar.
modifiersRecord<string, Matcher | Matcher[]>undefinedNamed date matchers for custom styling and behavior.
localePartial<DayPickerLocale>enUSLocale object for translated month/day formatting.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6locale defaultOverrides the first day of the week.
ISOWeek / broadcastCalendarbooleanfalseSwitches week calculation to ISO week dates or broadcast calendar rules.
numerals'latn' | 'arab' | 'arabext' | ...'latn'Numeral system used when formatting dates.
timeZonestringundefinedIANA time zone or UTC offset used for calendar math.
noonSafebooleanfalseKeeps date math at noon in the configured time zone to avoid historical offset drift.
classNamestringundefinedClass name applied to the calendar root.
refReact.Ref<HTMLDivElement>undefinedForwarded to the DayPicker root element through the Root slot while preserving DayPicker's internal rootRef.
classNamesPartial<ClassNames>undefinedClass names for DayPicker slots and modifiers.
modifiersClassNamesRecord<string, string>undefinedClass names for custom modifiers.
stylesPartial<Styles>undefinedInline styles for DayPicker slots and modifiers.
componentsPartial<CustomComponents>{ Chevron, Root }Custom renderers for DayPicker slots. The wrapper supplies a Chevron and Root by default; custom Root components receive a composed rootRef.
formatters / labelsPartial<Formatters> | Partial<Labels>undefinedCustom date text and ARIA label formatters for localization or product language.
footerReactNode | stringundefinedFooter content announced as a polite live region.
| Attribute | Description |
|---|---|
| data-slot="calendar" | Applied by the wrapper to the DayPicker root. |
| data-mode | Selection mode on the root when mode is set. |
| data-required | Present on the root when required is true. |
| data-multiple-months | Present on the root when numberOfMonths is greater than 1. |
| data-week-numbers | Present on the root when showWeekNumber is true. |
| data-broadcast-calendar | Present on the root when broadcastCalendar is true. |
| data-nav-layout | Root navigation layout value when navLayout is set. |
| data-day | ISO date for each rendered day cell. |
| data-month | Month id on outside-day cells. |
| data-selected | Present on selected day cells. |
| data-disabled | Present on disabled day cells. |
| data-hidden | Present on hidden day cells. |
| data-outside | Present on days outside the visible month. |
| data-focused | Present on the keyboard-focused day cell. |
| data-today | Present on today's date. |
| Variable | Description |
|---|---|
| --cell-size | Calendar cell width and height. Override on className, for example [--cell-size:2.75rem]. |
| --cell-radius | Radius used for day buttons. Override on className when changing density. |
| --calendar-selection | Selection accent used for selected days. Defaults to chart/sidebar tokens inside the component. |
| --calendar-selection-foreground | Text color on selected days. |