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.

Purpose

Calendar is the inline month grid — no trigger, no popover, always visible. In a form you almost never want it raw: Date picker and Date range picker wrap this same grid in a labelled field. Use Calendar directly when the grid itself is the interface — a filter panel that stays open, an availability view, a scheduling surface.

It is react-day-picker v9 themed to HealthMetrics tokens, with two defaults changed: the caption renders month and year dropdowns (captionLayout="dropdown") so far-off dates take two picks instead of dozens of clicks, and the navigable window spans 100 years back to 10 years ahead unless you pass startMonth/endMonth.

August 2026
2627282930311
2345678
9101112131415
16171819202122
23242526272829
303112345

Selection modes

The mode prop switches selection behaviour: single (one date), multiple (several dates) or range (a contiguous span). Selection is controlled — pair selected with onSelect:

Controlled single and range selection
const [date, setDate] = React.useState<Date | undefined>(new Date());
<Calendar mode="single" selected={date} onSelect={setDate} />;

const [range, setRange] = React.useState<DateRange | undefined>();
<Calendar mode="range" selected={range} onSelect={setRange} numberOfMonths={2} />;

A range renders as a continuous --accent band with solid --primary endpoints:

August 2026

States

The state model lives on the day cells, not the control:

  • Selected — solid --primary fill, --primary-foreground text.
  • Today — 1px --primary border ring only; the number keeps its colour so it never clashes with a selection on the same day.
  • Range middle — --accent cell fill; cells touch so the band has no gaps.
  • Outside days — adjacent-month days in --muted-foreground (showOutsideDays defaults on).
  • Disabled — 40% opacity and no pointer events, via any react-day-picker disabled matcher.
August 2026

Structure

PropertyValue
Containercontent width (w-fit), 12px padding (p-3)
Caption40px row (h-10), 14px semibold label
Month/year dropdownsnative <select>, 32px tall (h-8), 1px --input border, --radius-md
Nav buttonsoutline Button icon-sm, pinned to the corners
Weekday header36×40px cells, 12.8px text, --muted-foreground
Day cells40px square (size-10), ghost button, --radius-md
Selected day--primary fill, --primary-foreground text
Today1px --primary border ring
Range band--accent fill; endpoints squared on the inner edge
Disabled day40% opacity, no pointer events
Month windowcurrent year −100 → +10 (startMonth/endMonth defaults)

Best practices

Do

  • Prefer Date picker or Date range picker in forms — they add the field, label pairing and popover for you.
  • Constrain the window with startMonth/endMonth when the valid span is known — a claim date does not need next decade.
  • Use disabled matchers to grey out impossible dates (weekends, dates before today) rather than validating after the pick.
  • Keep mode="range" selections on one Calendar — the band only reads as one span within a single grid.

Don't

  • Drop a raw Calendar into a form just to pick one date — an always-open grid dominates the layout for a single value.
  • Override captionLayout back to label-only navigation for far-off dates such as dates of birth — that is dozens of clicks.
  • Recolour today's number — the ring-only marker exists so today and selected can coexist on the same day.

Accessibility & keyboard

  • Day cells are real <button>s inside react-day-picker's grid; selection state is conveyed with aria-selected, not colour alone.
  • The month and year dropdowns are native <select> elements with their own accessible names — fully keyboard- and screen-reader-operable.
  • The previous/next controls are real buttons with chevron glyphs.
  • Disabled days are removed from interaction (pointer-events-none), not merely dimmed.
  • Keyboard: Tab reaches the nav buttons, dropdowns and grid in order; arrow keys move a day (up/down a week) at a time; Enter or Space selects the focused day.

Props

CalendarProps is exactly React.ComponentProps<typeof DayPicker> — every react-day-picker prop passes straight through (mode, selected, onSelect, numberOfMonths, disabled, startMonth/endMonth…). The wrapper only changes defaults: showOutsideDays on, captionLayout="dropdown", and the ±100/10-year month window.

PropTypeDefaultDescription
mode"single" | "multiple" | "range" | undefined—Enable the selection of a single day, multiple days, or a range of days.
requiredboolean | undefined—Whether the selection is required.
classNamestring | undefined—Class name to add to the root element.
classNames(Partial<ClassNames> & Partial<DeprecatedUI<string>>) | undefined—Change 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 | undefined—Change the class name for the day matching the `modifiers`.
styleReact.CSSProperties | undefined—Style to apply to the root element.
styles(Partial<Styles> & Partial<DeprecatedUI<React.CSSProperties>>) | undefined—Change the inline styles of the HTML elements.
modifiersStylesModifiersStyles | undefined—Change the class name for the day matching the {@link modifiers}.
idstring | undefined—A 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 | undefined—The 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 | undefined—The earliest month to start the month navigation.
fromDatedeprecatedDate | undefined——
fromMonthdeprecatedDate | undefined——
fromYeardeprecatednumber | undefined——
endMonthDate | undefined—The latest month to end the month navigation.
toDatedeprecatedDate | undefined——
toMonthdeprecatedDate | undefined——
toYeardeprecatednumber | undefined——
pagedNavigationboolean | undefined—Paginate the month navigation displaying the `numberOfMonths` at a time.
reverseMonthsboolean | undefined—Render the months in reversed order (when {@link numberOfMonths} is set) to display the most recent month first.
hideNavigationboolean | undefined—Hide the navigation buttons. This prop won't disable the navigation: to disable the navigation, use {@link disableNavigation}.
disableNavigationboolean | undefined—Disable 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" | undefined—Show 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 | undefined—Reverse the order of years in the dropdown when using `captionLayout="dropdown"` or `captionLayout="dropdown-years"`.
navLayout"around" | "after" | undefined—Adjust 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 | undefined—Display 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 | undefined—Hide the row displaying the weekday row header.
showOutsideDaysboolean | undefined—Show 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 | undefined—Show the week numbers column. Weeks are numbered according to the local week index.
animateboolean | undefined—Animate navigating between months.
broadcastCalendarboolean | undefined—Display 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 | undefined—Use ISO week dates instead of the locale setting. Setting this prop will ignore `weekStartsOn` and `firstWeekContainsDate`.
timeZonestring | undefined—The 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 | undefined—Keep 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> | undefined—Change the components used for rendering the calendar elements.
footerReact.ReactNode—Add 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 | undefined—When 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[] | undefined—Apply the `disabled` modifier to the matching days. Disabled days cannot be selected when in a selection mode is set.
hiddenMatcher | Matcher[] | undefined—Apply the `hidden` modifier to the matching days. Will hide them from the calendar.
todayDate | undefined—The today’s date. Default is the current date. This date will get the `today` modifier to style the day.
modifiersRecord<string, Matcher | Matcher[] | undefined> | undefined—Add modifiers to the matching days.
labelsPartial<Labels> | undefined—Labels creators to override the defaults. Use this prop to customize the aria-label attributes in DayPicker.
formattersPartial<Formatters> | undefined—Formatters used to format dates to strings. Use this prop to override the default functions.
dirstring | undefined—The text direction of the calendar. Use `ltr` for left-to-right (default) or `rtl` for right-to-left.
aria-labelstring | undefined—The aria-label attribute to add to the container element.
aria-labelledbystring | undefined—The aria-labelledby attribute to add to the container element.
role"application" | "dialog" | undefined—The role attribute to add to the container element.
noncestring | undefined—A cryptographic nonce ("number used once") which can be used by Content Security Policy for the inline `style` attributes.
titlestring | undefined—Add a `title` attribute to the container element.
langstring | undefined—Add 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 | undefined—The index of the first day of the week (0 - Sunday). Overrides the locale's default.
firstWeekContainsDate1 | 4 | undefined—The day of January that is always in the first week of the year.
useAdditionalWeekYearTokensboolean | undefined—Enable `DD` and `DDDD` for week year tokens when formatting or parsing dates.
useAdditionalDayOfYearTokensboolean | undefined—Enable `YY` and `YYYY` for day of year tokens when formatting or parsing dates.
onMonthChangeMonthChangeEventHandler | undefined—Event fired when the user navigates between months.
onNextClickMonthChangeEventHandler | undefined—Event handler when the next month button is clicked.
onPrevClickMonthChangeEventHandler | undefined—Event handler when the previous month button is clicked.
onWeekNumberClickdeprecatedany—Event handler when a week number is clicked.
onDayClickDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefined—Event handler when a day is clicked.
onDayFocusDayEventHandler<React.FocusEvent<Element, Element>> | undefined—Event handler when a day is focused.
onDayBlurDayEventHandler<React.FocusEvent<Element, Element>> | undefined—Event handler when a day is blurred.
onDayKeyDownDayEventHandler<React.KeyboardEvent<Element>> | undefined—Event handler when a key is pressed on a day.
onDayMouseEnterDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefined—Event handler when the mouse enters a day.
onDayMouseLeaveDayEventHandler<React.MouseEvent<Element, MouseEvent>> | undefined—Event handler when the mouse leaves a day.
dateLibPartial<DateLib> | undefined—Replace 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