Usage
To display a Calendar, supply a mode
to Calendar
. Calendar can display three different modes: single
, multiple
, or range
.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Single
Calendars in single
mode allow the user to select up to one date.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Multiple
Calendars in multiple
mode allow the user to select more than one date.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Range
Calendars in range
mode allow the user to select a range of dates.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Dark mode
To display a calendar on a dark background, set theme to “dark”.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
When showInput
is enabled, the Calendar will show an input field which allows the user to input a date. This works for all modes.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Controlled state
Calendars can be controlled by passing a selected
and an onSelect
.
Dates displayed in a Calendar input can be formatted by passing in a format
string. This string should follow moment
’s formatting guide.
January 2025
Su | Mo | Tu | We | Th | Fr | Sa |
---|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
API Reference
Calendar
Inherits properties from DayPicker
.
Prop | Type | Default |
format | string | |
mode | "single" "multiple" "range" | |
onSelect | (selected: Date | Date[] | DateRange) => void | |
placeholder | string | |
selected | Date Date[] DateRange | |
showInput | boolean | |
theme | "light" "dark" | "light" |