A calendar component that allows users to select a date or a range of dates. It renders a month grid with previous/next navigation; it has no text entry.
Use mode="single" to let a user select a single date.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Popover
Compose the Calendar inside a Popover to reveal it from a trigger.
Range
Use mode="range" to let a user select a start and end date.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Range with multiple months
Use numberOfMonths to render more than one month at a time.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Hidden days
Pass an array of dates to hidden to remove them from the calendar.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Disabled days
Pass an array of dates to disabled to prevent them from being selected.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Server rendering
Calendar highlights today's date and prefixes that day's aria-label with Today,. If you omit today, DayPicker reads the clock during render, once on the server and again in the browser. If the two clocks or time zones disagree on the date, the highlight and the label land on different days. React then reports a hydration mismatch. If you also omit month and defaultMonth, the grid opens on different months.
Under SSR, pass today and defaultMonth (or month) from one date the request produced, such as a loader value. timeZone aligns the zone only, not the clock, so it doesn't replace today.
| Su | Mo | Tu | We | Th | Fr | Sa |
|---|---|---|---|---|---|---|
Accessibility
The month grid, the day buttons, and the previous/next month buttons come from React DayPicker, which names them and handles arrow-key navigation between days. The navigation buttons carry mantle's IconButton ghost styling, including its focus ring.
API Reference
The Calendar is built on top of React DayPicker and accepts every DayPicker prop. Mantle changes these:
@ngrok/mantle/calendar also exports the DateRange type for mode="range".