Use cases
- Date selection — let users pick a single date from a calendar grid.
- Date range — select a start and end date (e.g. leave requests, reporting periods).
- Inline display — show a calendar permanently in a sidebar or panel.
When NOT to use
- Known dates like birthdays → use a
DatePickertext input for faster entry. - Time selection → Calendar handles dates only; pair with a time input if needed.
Modes
| Mode | Description |
|---|---|
single | Select one date. |
range | Select a start → end range. Use numberOfMonths={2} for clarity. |
multiple | Select several individual dates. |
DayPicker v10 API
Calendar is now powered by @daypicker/react v10. The MiHCM wrapper does not hide DayPicker capabilities; it forwards the full v10 DayPicker prop surface and only adds tokenized default class names, larger targets, and MiHCM focus/selection styling.
Use the v10 APIs directly for product-specific behavior:
| Capability | Props / APIs |
|---|---|
| Selection | mode, selected, onSelect, required, min, max, excludeDisabled |
| Date matching | disabled, hidden, selected, modifiers, today |
| Navigation | month, defaultMonth, onMonthChange, startMonth, endMonth, disableNavigation, hideNavigation, onPrevClick, onNextClick |
| Caption / layout | captionLayout, navLayout, reverseYears, numberOfMonths, reverseMonths, pagedNavigation, fixedWeeks, showOutsideDays, hideWeekdays, showWeekNumber |
| Localization | locale, lang, dir, weekStartsOn, firstWeekContainsDate, ISOWeek, timeZone, noonSafe, numerals |
| Custom rendering | components, formatters, labels, footer |
| Styling | className, classNames, style, styles, modifiersClassNames, modifiersStyles, nonce |
| Events | onDayClick, onDayFocus, onDayBlur, onDayKeyDown, onDayMouseEnter, onDayMouseLeave |
Use @daypicker/react/locale for production locale objects, and install the relevant DayPicker add-on package when you need non-Gregorian calendars such as Persian, Buddhist, Ethiopic, Hebrew, or Hijri.
Removed v9 compatibility APIs such as fromMonth, toMonth, fromDate, toDate, initialFocus, components.Button, and deprecated class key aliases are not supported in v10. Use startMonth, endMonth, hidden, autoFocus, PreviousMonthButton, NextMonthButton, and current v10 class keys instead.
The MiHCM wrapper only supplies roomier tokenized defaults: 52px day cells, 44px circular day targets, clearer header spacing, semantic selected/today states, and accessible focus rings.
Hover and selection visuals are intentionally applied to each day button, not the table cell. This keeps single dates circular and range-middle dates discrete rounded squares instead of stretched pills.
Composition
Calendar is the low-level grid. For a trigger + popup pattern, use DatePicker which wraps Calendar in a Button + popover.
Related
- DatePicker — button trigger + calendar popup.