Calendar

A month grid to pick a day with the mouse or the keyboard. DatePicker uses it, and you can use it alone when the calendar should always be visible.

General

Pass the selected day with value and listen to onChange.

Min and max

Days outside the range are disabled and the keyboard does not go there.

Locale and first day of the week

locale sets the names of the month and of the weekdays, and weekStartsOn the first column (0 is Sunday).

APIs

Calendar.Props

AttributeDescriptionTypeAccepted valuesDefault
valueselected day, to control the componentDate / null--
onChangecalled with the day the user picked(date: Date) => void--
minfirst day that can be pickedDate--
maxlast day that can be pickedDate--
localelanguage of the month and weekday namesstringany Intl localeen-US
weekStartsOnfirst day of the week, 0 is Sundaynumber0 to 60
autoFocusmove the focus to the day when it is shownboolean-false
previousLabelname of the previous month buttonstring-Previous month
nextLabelname of the next month buttonstring-Next month
...native propsHTMLAttributes'id', 'className', ...-

Ref

The ref points at the root element.

Accessibility

The days are a grid named by the month, with a single tab stop on the focused day. The selected day has aria-selected and today has aria-current="date".

KeyAction
Arrow keysMove by one day, or one week
Home and EndGo to the first and to the last day of the week
Page Up and Page DownGo to the previous and to the next month
Shift and Page Up or DownGo to the previous and to the next year
Enter and SpacePick the day
Edit this page on GitHub