Design System
Forms

Calendar

The raw month grid behind Date picker and Date range picker. Reach for it directly only when you need the grid without a field.

Not documented yet

This component ships in the design system and is fully supported. What is missing is the guidance around it: when to reach for it, the do and don't, and the accessibility notes. Until that is written, Storybook is the reference for variants, props and live controls.

Props

PropTypeDefaultDescription
mode"single" | "multiple" | "range" | undefinedEnable the selection of a single day, multiple days, or a range of days.
requiredboolean | undefinedWhether the selection is required.
classNamestring | undefinedClass name to add to the root element.
classNames(Partial<ClassNames> & Partial<DeprecatedUI<string>>) | undefinedChange the class names used by DayPicker. Use this prop when you need to change the default class names — for example, when importing the style via CSS modules or when using a CSS framework.
modifiersClassNamesModifiersClassNames | undefinedChange the class name for the day matching the `modifiers`.
styleReact.CSSProperties | undefinedStyle to apply to the root element.
styles(Partial<Styles> & Partial<DeprecatedUI<React.CSSProperties>>) | undefinedChange the inline styles of the HTML elements.
modifiersStylesModifiersStyles | undefinedChange the class name for the day matching the {@link modifiers}.
idstring | undefinedA unique id to add to the root element.
defaultMonthDate | undefinedThe current monthThe initial month to show in the calendar. Use this prop to let DayPicker control the current month. If you need to set the month programmatically, use {@link month} and {@link onMonthChange}.
monthDate | undefinedThe month displayed in the calendar. As opposed to `defaultMonth`, use this prop with `onMonthChange` to change the month programmatically.
numberOfMonthsnumber | undefined1The number of displayed months.
startMonthDate | undefinedThe earliest month to start the month navigation.
fromDatedeprecatedDate | undefined
fromMonthdeprecatedDate | undefined
fromYeardeprecatednumber | undefined
endMonthDate | undefinedThe latest month to end the month navigation.
toDatedeprecatedDate | undefined
toMonthdeprecatedDate | undefined
toYeardeprecatednumber | undefined
pagedNavigationboolean | undefinedPaginate the month navigation displaying the `numberOfMonths` at a time.
reverseMonthsboolean | undefinedRender the months in reversed order (when {@link numberOfMonths} is set) to display the most recent month first.
hideNavigationboolean | undefinedHide the navigation buttons. This prop won't disable the navigation: to disable the navigation, use {@link disableNavigation}.
disableNavigationboolean | undefinedDisable the navigation between months. This prop won't hide the navigation: to hide the navigation, use {@link hideNavigation}.
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years" | undefinedShow dropdowns to navigate between months or years. - `label`: Displays the month and year as a label. Default value. - `dropdown`: Displays dropdowns for both month and year navigation. - `dropdown-months`: Displays a dropdown only for the month navigation. - `dropdown-years`: Displays a dropdown only for the year navigation. **Note:** By default, showing the dropdown will set the {@link startMonth} to 100 years ago and {@link endMonth} to the end of the current year. You can override this behavior by explicitly setting `startMonth` and `endMonth`.
reverseYearsboolean | undefinedReverse the order of years in the dropdown when using `captionLayout="dropdown"` or `captionLayout="dropdown-years"`.
navLayout"around" | "after" | undefinedAdjust the positioning of the navigation buttons. - `around`: Displays the buttons on either side of the caption. - `after`: Displays the buttons after the caption. This ensures the tab order matches the visual order. If not set, the buttons default to being displayed after the caption, but the tab order may not align with the visual order.
fixedWeeksboolean | undefinedDisplay always 6 weeks per each month, regardless of the month’s number of weeks. Weeks will be filled with the days from the next month.
hideWeekdaysboolean | undefinedHide the row displaying the weekday row header.
showOutsideDaysboolean | undefinedShow the outside days (days falling in the next or the previous month). **Note:** when a {@link broadcastCalendar} is set, this prop defaults to true.
showWeekNumberboolean | undefinedShow the week numbers column. Weeks are numbered according to the local week index.
animateboolean | undefinedAnimate navigating between months.
broadcastCalendarboolean | undefinedDisplay the weeks in the month following the broadcast calendar. Setting this prop will ignore {@link weekStartsOn} (always Monday) and {@link showOutsideDays} will default to true.
ISOWeekboolean | undefinedUse ISO week dates instead of the locale setting. Setting this prop will ignore `weekStartsOn` and `firstWeekContainsDate`.
timeZonestring | undefinedThe time zone (IANA or UTC offset) to use in the calendar (experimental). See [Wikipedia](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the possible values.
noonSafeboolean | undefinedKeep calendar math at noon in the configured {@link timeZone} to avoid historical second-level offsets drifting dates across midnight. This prop sets the time of the dates to noon (12:00).
componentsPartial<CustomComponents> | undefinedChange the components used for rendering the calendar elements.
footerReact.ReactNodeAdd a footer to the calendar, acting as a live region. Use this prop to communicate the calendar's status to screen readers. Prefer strings over complex UI elements.
autoFocusboolean | undefinedWhen a selection mode is set, DayPicker will focus the first selected day (if set) or today's date (if not disabled). Use this prop when you need to focus DayPicker after a user action, for improved accessibility.
initialFocusdeprecatedboolean | undefined
disabledMatcher | Matcher[] | undefinedApply the `disabled` modifier to the matching days. Disabled days cannot be selected when in a selection mode is set.
hiddenMatcher | Matcher[] | undefinedApply the `hidden` modifier to the matching days. Will hide them from the calendar.
todayDate | undefinedThe today’s date. Default is the current date. This date will get the `today` modifier to style the day.
modifiersRecord<string, Matcher | Matcher[] | undefined> | undefinedAdd modifiers to the matching days.
labelsPartial<Labels> | undefinedLabels creators to override the defaults. Use this prop to customize the aria-label attributes in DayPicker.
formattersPartial<Formatters> | undefinedFormatters used to format dates to strings. Use this prop to override the default functions.
dirstring | undefinedThe text direction of the calendar. Use `ltr` for left-to-right (default) or `rtl` for right-to-left.
aria-labelstring | undefinedThe aria-label attribute to add to the container element.
aria-labelledbystring | undefinedThe aria-labelledby attribute to add to the container element.
role"application" | "dialog" | undefinedThe role attribute to add to the container element.
noncestring | undefinedA cryptographic nonce ("number used once") which can be used by Content Security Policy for the inline `style` attributes.
titlestring | undefinedAdd a `title` attribute to the container element.
langstring | undefinedAdd the language tag to the container element. When omitted, DayPicker uses the active locale code (`locale.code`). Set this prop to override the language tag.
localePartial<DayPickerLocale> | undefinedenUS - The English locale default of `date-fns`.The locale object used to localize dates. Pass a locale from `react-day-picker/locale` to localize the calendar.
numeralsNumerals | undefined`latn` Latin (Western Arabic)The numeral system to use when formatting dates. - `latn`: Latin (Western Arabic) - `arab`: Arabic-Indic - `arabext`: Eastern Arabic-Indic (Persian) - `deva`: Devanagari - `beng`: Bengali - `guru`: Gurmukhi - `gujr`: Gujarati - `orya`: Oriya - `tamldec`: Tamil - `telu`: Telugu - `knda`: Kannada - `mlym`: Malayalam
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6 | undefinedThe index of the first day of the week (0 - Sunday). Overrides the locale's default.
firstWeekContainsDate1 | 4 | undefinedThe day of January that is always in the first week of the year.
useAdditionalWeekYearTokensboolean | undefinedEnable `DD` and `DDDD` for week year tokens when formatting or parsing dates.
useAdditionalDayOfYearTokensboolean | undefinedEnable `YY` and `YYYY` for day of year tokens when formatting or parsing dates.
onMonthChangeMonthChangeEventHandler | undefinedEvent fired when the user navigates between months.
onNextClickMonthChangeEventHandler | undefinedEvent handler when the next month button is clicked.
onPrevClickMonthChangeEventHandler | undefinedEvent handler when the previous month button is clicked.
onWeekNumberClickdeprecatedanyEvent handler when a week number is clicked.
onDayClickDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefinedEvent handler when a day is clicked.
onDayFocusDayEventHandler<React.FocusEvent<Element, Element>> | undefinedEvent handler when a day is focused.
onDayBlurDayEventHandler<React.FocusEvent<Element, Element>> | undefinedEvent handler when a day is blurred.
onDayKeyDownDayEventHandler<React.KeyboardEvent<Element>> | undefinedEvent handler when a key is pressed on a day.
onDayMouseEnterDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefinedEvent handler when the mouse enters a day.
onDayMouseLeaveDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefinedEvent handler when the mouse leaves a day.
dateLibPartial<DateLib> | undefinedReplace the default date library with a custom one. Experimental: not guaranteed to be stable (may not respect semver).
onDayKeyUpdeprecatedDayEventHandler<React.KeyboardEvent<Element>> | undefined
onDayKeyPressdeprecatedDayEventHandler<React.KeyboardEvent<Element>> | undefined
onDayPointerEnterdeprecatedDayEventHandler<React.PointerEvent<Element>> | undefined
onDayPointerLeavedeprecatedDayEventHandler<React.PointerEvent<Element>> | undefined
onDayTouchCanceldeprecatedDayEventHandler<React.TouchEvent<Element>> | undefined
onDayTouchEnddeprecatedDayEventHandler<React.TouchEvent<Element>> | undefined
onDayTouchMovedeprecatedDayEventHandler<React.TouchEvent<Element>> | undefined
onDayTouchStartdeprecatedDayEventHandler<React.TouchEvent<Element>> | undefined

On this page