1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 1 | 2 | 3 | 4 | 5 |
Calendars let people select a date, or a range of dates, on a grid of days, without an input or a dialog around it. Compose your own calendar from the parts on this page, in a Calendar or a RangeCalendar. For a complete picker, with a header and a date input, use a date picker.
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarGridBody,
CalendarGridHeader,
CalendarHeaderCell,
CalendarHeading,
CalendarMenuButton,
CalendarMonthPicker,
CalendarMonths,
CalendarPage,
CalendarWeekdays,
CalendarYearPicker,
RangeCalendar,
} from '@material-web/react'
import { parseDate } from '@internationalized/date'Basic calendar
A Calendar selects one date. Write its parts as its children, and name it with an aria-label. This one has the layout of a date picker's calendar: see Layout.
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarGridBody,
CalendarHeaderCell,
CalendarMenuButton,
CalendarPage,
CalendarWeekdays,
CalendarYearPicker,
Icon,
IconButton,
} from '@material-web/react'
export default function Basic() {
return (
<Calendar aria-label="Event date" defaultValue={parseDate('2025-08-17')} className="w-90">
<div className="calendar-nav">
<CalendarMenuButton />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-body">
<div className="calendar-days">
<CalendarWeekdays>
{(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}
</CalendarWeekdays>
<CalendarPage>
<CalendarGrid>
<CalendarGridBody>{(date) => <CalendarCell date={date} />}</CalendarGridBody>
</CalendarGrid>
</CalendarPage>
</div>
<CalendarYearPicker />
</div>
</Calendar>
)
}Range calendar
Use a RangeCalendar to select a range of dates, such as the dates of a flight or of a hotel stay: the first day pressed starts the range, and the second ends it. Its grids highlight the range between its ends.
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2025-02-03 to 2025-02-12
import { parseDate } from '@internationalized/date'
import {
CalendarCell,
CalendarGrid,
CalendarGridBody,
CalendarHeaderCell,
CalendarMenuButton,
CalendarPage,
CalendarWeekdays,
CalendarYearPicker,
Icon,
IconButton,
RangeCalendar,
} from '@material-web/react'
import { useState } from 'react'
import type { DateValue, RangeValue } from 'react-aria-components'
export default function Range() {
const [range, setRange] = useState<RangeValue<DateValue>>({
start: parseDate('2025-02-03'),
end: parseDate('2025-02-12'),
})
return (
<div className="flex w-90 flex-col gap-space-100">
<RangeCalendar aria-label="Trip dates" value={range} onChange={setRange}>
<div className="calendar-nav">
<CalendarMenuButton />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-body">
<div className="calendar-days">
<CalendarWeekdays>
{(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}
</CalendarWeekdays>
<CalendarPage>
<CalendarGrid>
<CalendarGridBody>{(date) => <CalendarCell date={date} />}</CalendarGridBody>
</CalendarGrid>
</CalendarPage>
</div>
<CalendarYearPicker />
</div>
</RangeCalendar>
<p className="m-0 px-space-300 text-body-md text-on-surface-variant">
{range.start.toString()} to {range.end.toString()}
</p>
</div>
)
}Composition
A Calendar and a RangeCalendar hold the other parts as their children, and take the same parts.
React Aria parts
These parts take the same props as the parts of the same name in React Aria's Calendar and RangeCalendar, and are composed the same way:
| Part | In | Use |
|---|---|---|
CalendarGrid | The calendar or a CalendarPage | Shows a month, with its seven columns spread evenly across its width. Pass it a function that returns a CalendarCell for a date, and it shows a CalendarGridHeader of CalendarHeaderCells above a CalendarGridBody of those cells. |
CalendarCell | CalendarGrid | Shows a day. Return it from the function of a CalendarGrid or a CalendarGridBody. Its children are the day's number by default. |
CalendarHeading | The calendar or a CalendarPage | The heading of a month, as above each month of a range |
This example uses these parts alone: a CalendarHeading between the previous and next buttons, above a CalendarGrid with a function as its children. The days of the adjacent months are dimmed.
August 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarHeading,
Icon,
IconButton,
} from '@material-web/react'
export default function Anatomy() {
return (
<Calendar aria-label="Event date" defaultValue={parseDate('2025-08-17')} className="w-90">
<div className="flex items-center justify-between px-space-150">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
<CalendarHeading className="p-0" />
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</div>
<div className="px-space-150">
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</div>
</Calendar>
)
}M3 parts
These parts are specific to this library:
| Part | In | Use |
|---|---|---|
CalendarWeekdays | The calendar | Shows the days of the week once above a calendar's grids, so that they stay in place while the days page or scroll |
CalendarPage | The calendar | Holds what the previous and next buttons page through. It is as tall as six weeks, or as its content when that is taller. |
CalendarMonths | The calendar | Shows the months of the calendar's visibleDuration in a scrolling column, under a CalendarWeekdays. See Months in a column. |
CalendarMenuButton | The calendar | Opens a picker over the days: the years (the default), or the months with picker="month" |
CalendarYearPicker | The calendar | A grid of years. See Month and year pickers. |
CalendarMonthPicker | The calendar | A menu of months. See Month and year pickers. |
Layout
Lay the parts out with the calendar's classes. This is the layout of the date picker's calendar:
<Calendar aria-label="Event date">
<div className="calendar-nav">
<CalendarMenuButton />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-body">
<div className="calendar-days">
<CalendarWeekdays>{(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}</CalendarWeekdays>
<CalendarPage>
<CalendarGrid>
<CalendarGridBody>{(date) => <CalendarCell date={date} />}</CalendarGridBody>
</CalendarGrid>
</CalendarPage>
</div>
<CalendarYearPicker />
</div>
</Calendar>| Class | Use |
|---|---|
calendar-nav | The navigation row, with the menu button at its start. |
calendar-nav-arrows | Holds the previous and next buttons at the end of the row, and hides them in place while a picker is open. |
calendar-arrow-slot | Holds one of these buttons, in its middle. |
calendar-body | The area under the navigation row. It is as tall as the days of the week and six weeks of days, whatever the month, and a picker covers it while open. |
calendar-days | Holds the days of the week and the page, and hides the days of the adjacent months. |
A calendar is as wide as the element that holds it. Give it a width with a class, such as w-90 for 360dp.
Slots
- previous
- next
- errorMessage
| Slot | Child | Use |
|---|---|---|
previous | Any button, such as an icon button | The previous button, which pages back |
next | Any button | The next button, which pages forward |
errorMessage | A Text | The error message. See Invalid selection. |
Note: Inside a calendar, a button without a slot throws an error. Give any other button slot={null}.
Month and year pickers
A CalendarMenuButton opens a picker over the days: the years (the default), or the months with picker="month". Its label is the month and year shown, unless you give it children. CalendarYearPicker is a grid of years, and CalendarMonthPicker is a menu of months. Each opens from its menu button and closes when a year or a month is chosen, which the calendar then shows.
A picker covers the element that holds it. Put it next to the days, in your own element with position: relative, such as one with the calendar-body class.
Shift+M moves the focus to the months' menu button, and Shift+Y to the years'. With one menu button, both move the focus to it. On a keyboard layout without Latin letters, use the keys in the places of M and Y on a US keyboard. Escape in a picker closes the picker alone, not what is around the calendar.
This example has a menu button for each picker. Their labels are written from the state that the Calendar passes to a function as its children:
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { DateFormatter, parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarGridBody,
CalendarHeaderCell,
CalendarMenuButton,
CalendarMonthPicker,
CalendarPage,
CalendarWeekdays,
CalendarYearPicker,
Icon,
IconButton,
} from '@material-web/react'
import { useLocale } from 'react-aria-components'
export default function Menus() {
const { locale } = useLocale()
const month = new DateFormatter(locale, { month: 'short' })
const year = new DateFormatter(locale, { year: 'numeric' })
return (
<Calendar aria-label="Event date" defaultValue={parseDate('2025-08-17')} className="w-90">
{({ state }) => {
const shown = state.visibleRange.start.toDate(state.timeZone)
return (
<>
<div className="calendar-nav gap-space-100">
<CalendarMenuButton picker="month">{month.format(shown)}</CalendarMenuButton>
<CalendarMenuButton picker="year">{year.format(shown)}</CalendarMenuButton>
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-body">
<div className="calendar-days">
<CalendarWeekdays>
{(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}
</CalendarWeekdays>
<CalendarPage>
<CalendarGrid>
<CalendarGridBody>{(date) => <CalendarCell date={date} />}</CalendarGridBody>
</CalendarGrid>
</CalendarPage>
</div>
<CalendarMonthPicker />
<CalendarYearPicker />
</div>
</>
)
}}
</Calendar>
)
}Controlled
Pass dates as CalendarDate objects from @internationalized/date, as parseDate returns for a string such as 2025-08-17. Set the initial date with defaultValue, or control it with value and onChange, which is called with the date when a day is selected.
August 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
2025-08-17
import { parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
} from '@material-web/react'
import { useState } from 'react'
import type { DateValue } from 'react-aria-components'
export default function Controlled() {
const [date, setDate] = useState<DateValue>(parseDate('2025-08-17'))
return (
<div className="flex w-90 flex-col gap-space-100">
<Calendar aria-label="Event date" value={date} onChange={setDate}>
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</CalendarPage>
</div>
</Calendar>
<p className="m-0 px-space-300 text-body-md text-on-surface-variant">{date.toString()}</p>
</div>
)
}A RangeCalendar takes the same props. Its value is a { start, end } pair of CalendarDate objects, and its onChange is called once the second day ends the range. The range calendar above is controlled.
Initial month
A calendar opens at the month of its value, or at the current month when it has none. To open at another month, set defaultFocusedValue to a date in that month.
To move the calendar from your own code, control the focused date with focusedValue and onFocusChange: the calendar shows the month of that date. See React Aria's Controlling the focused date.
This calendar opens at April 2022 with no date selected, and its Today button moves it to the current month.
April 2022
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
import { getLocalTimeZone, parseDate, today } from '@internationalized/date'
import {
Button,
Calendar,
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
} from '@material-web/react'
import { useState } from 'react'
export default function Focused() {
const [focused, setFocused] = useState(parseDate('2022-04-17'))
return (
<div className="flex w-90 flex-col items-center gap-space-200">
<Button variant="outlined" onPress={() => setFocused(today(getLocalTimeZone()))}>
Today
</Button>
<Calendar aria-label="Event date" focusedValue={focused} onFocusChange={setFocused}>
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</CalendarPage>
</div>
</Calendar>
</div>
)
}Form props
Set isDisabled to disable a calendar: its days and its buttons are dimmed, they cannot be pressed or focused, and the selected date is not marked. Set isReadOnly to keep the value as it is: the days can be focused and the months paged, but a press on a day selects nothing.
August 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
August 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
} from '@material-web/react'
function Parts() {
return (
<>
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</CalendarPage>
</div>
</>
)
}
export default function FormProps() {
const date = parseDate('2025-08-17')
return (
<>
<Calendar aria-label="Disabled" defaultValue={date} isDisabled className="w-90">
<Parts />
</Calendar>
<Calendar aria-label="Read-only" defaultValue={date} isReadOnly className="w-90">
<Parts />
</Calendar>
</>
)
}Validation
Set minValue and maxValue to limit the dates that can be selected. Pass isDateUnavailable to mark days as unavailable: they are struck out, and can be focused with the keyboard but not selected.
Set allowsNonContiguousRanges on a RangeCalendar to let a range run over unavailable days. These days are left out of the selection, and of the highlight of the range.
February 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
import { parseDate } from '@internationalized/date'
import {
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
RangeCalendar,
} from '@material-web/react'
import type { DateValue } from 'react-aria-components'
const booked = [
[parseDate('2025-02-11'), parseDate('2025-02-12')],
[parseDate('2025-02-20'), parseDate('2025-02-22')],
] as const
const isBooked = (date: DateValue) =>
booked.some(([start, end]) => date.compare(start) >= 0 && date.compare(end) <= 0)
export default function Unavailable() {
return (
<div className="w-90">
<RangeCalendar
aria-label="Trip dates"
defaultValue={{ start: parseDate('2025-02-06'), end: parseDate('2025-02-14') }}
minValue={parseDate('2025-02-04')}
isDateUnavailable={isBooked}
allowsNonContiguousRanges
>
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</CalendarPage>
</div>
</RangeCalendar>
</div>
)
}Invalid selection
A calendar is invalid when you set isInvalid, or when its value is outside the bounds or on an unavailable day. It then shows its selected day or its range in the error colors. For an error message under the days, put a Text from react-aria-components in the errorMessage slot, and render it while the calendar is invalid.
February 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
import { parseDate } from '@internationalized/date'
import {
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
RangeCalendar,
} from '@material-web/react'
import { useState } from 'react'
import { Text, type DateValue, type RangeValue } from 'react-aria-components'
export default function Invalid() {
const [range, setRange] = useState<RangeValue<DateValue>>({
start: parseDate('2025-02-06'),
end: parseDate('2025-02-18'),
})
const isInvalid = range.end.compare(range.start) > 7
return (
<div className="w-90">
<RangeCalendar aria-label="Stay" value={range} onChange={setRange} isInvalid={isInvalid}>
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>{(date) => <CalendarCell date={date} />}</CalendarGrid>
</CalendarPage>
</div>
{isInvalid && <Text slot="errorMessage">Maximum stay duration is 1 week</Text>}
</RangeCalendar>
</div>
)
}Localization
A calendar formats its dates for the locale, which also sets the calendar system, the first day of the week, the names and digits of the days, months and years, and the direction the arrow keys move. To set a locale, wrap the calendar in an I18nProvider from react-aria-components. See Internationalization.
- First day of the week: Set
firstDayOfWeekon the calendar to start the week on another day than the locale's, as infirstDayOfWeek="mon". - Days of the week: Set
weekdayStyleon aCalendarGridor aCalendarWeekdaystonarrow(the default),shortorlong, for names such as S, Sun or Sunday. - Direction: A calendar follows the page's
dir. Make it agree with the locale, so that the days run in the direction the arrow keys move. - Calendar systems: See React Aria's International calendars and Custom calendar systems.
For more on the locale and the direction, see Text and locale on the date picker page.
Customization
Pass classes in className to restyle a part: each part takes its own. See Styling for the classes, the states and the theme.
- States: A
CalendarCellreports the states of its day. Style one with its variant, such asselected:,unavailable:oroutside-month:. See States. - Functions:
className,styleand the children of aCalendar, aRangeCalendarand aCalendarCellcan be functions of its state. See Children as a function.
Months side by side
To show several months side by side, set visibleDuration on the calendar, and put a CalendarHeading and a CalendarGrid for each month in one CalendarPage, each with an offset from the first month. The previous and next buttons page through all the months at once, or by one month with pageBehavior="single".
February 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
26 | 27 | 28 | 29 | 30 | 31 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 1 |
March 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
import { parseDate } from '@internationalized/date'
import {
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
RangeCalendar,
} from '@material-web/react'
export default function Months() {
return (
<RangeCalendar
aria-label="Trip dates"
defaultValue={{ start: parseDate('2025-02-24'), end: parseDate('2025-03-05') }}
visibleDuration={{ months: 2 }}
>
<div className="calendar-nav">
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage className="flex flex-wrap gap-x-space-300">
{[0, 1].map((months) => (
<div key={months} className="min-w-60 flex-1">
<CalendarHeading offset={{ months }} />
<CalendarGrid offset={{ months }}>
{(date) => <CalendarCell date={date} />}
</CalendarGrid>
</div>
))}
</CalendarPage>
</div>
</RangeCalendar>
)
}selectionAlignment sets where the month of the value is among them when the calendar opens: start, center (the default) or end.
Months in a column
CalendarMonths shows the months of the calendar's visibleDuration in a scrolling column, each under its CalendarHeading. It starts scrolled to the focused month. Put it under a CalendarWeekdays in a RangeCalendar, as in this example:
August 2025
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { parseDate } from '@internationalized/date'
import {
CalendarHeaderCell,
CalendarMonths,
CalendarWeekdays,
RangeCalendar,
} from '@material-web/react'
export default function Scrolling() {
return (
<div className="flex h-140 w-90 flex-col">
<RangeCalendar
aria-label="Trip dates"
defaultValue={{ start: parseDate('2025-08-17'), end: parseDate('2025-08-23') }}
visibleDuration={{ months: 24 }}
>
<CalendarWeekdays>
{(day) => <CalendarHeaderCell>{day}</CalendarHeaderCell>}
</CalendarWeekdays>
<CalendarMonths />
</RangeCalendar>
</div>
)
}Custom day rendering
To draw a day yourself, pass a function as the children of its CalendarCell. It is called with the state of the day, such as formattedDate, the number of the day in the locale, isSelected and isToday. This example marks the days that have an event with a dot:
August 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 31 | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 1 | 2 | 3 | 4 | 5 | 6 |
import { parseDate } from '@internationalized/date'
import {
Calendar,
CalendarCell,
CalendarGrid,
CalendarHeading,
CalendarPage,
Icon,
IconButton,
} from '@material-web/react'
const events = ['2025-08-05', '2025-08-14', '2025-08-17', '2025-08-22']
export default function CustomDay() {
return (
<Calendar aria-label="Event date" defaultValue={parseDate('2025-08-17')} className="w-90">
<div className="calendar-nav">
<CalendarHeading className="p-0" />
<div className="calendar-nav-arrows">
<span className="calendar-arrow-slot">
<IconButton slot="previous" aria-label="Previous month">
<Icon name="chevron_left" className="rtl:icon-mirrored" />
</IconButton>
</span>
<span className="calendar-arrow-slot">
<IconButton slot="next" aria-label="Next month">
<Icon name="chevron_right" className="rtl:icon-mirrored" />
</IconButton>
</span>
</div>
</div>
<div className="calendar-days">
<CalendarPage>
<CalendarGrid>
{(date) => (
<CalendarCell date={date}>
{({ formattedDate }) => (
<>
{formattedDate}
{events.includes(date.toString()) && (
<span className="absolute inset-x-0 bottom-space-50 mx-auto size-1 rounded-shape-full bg-current" />
)}
</>
)}
</CalendarCell>
)}
</CalendarGrid>
</CalendarPage>
</div>
</Calendar>
)
}Interaction and style
- States: The days, a menu button, the years and the months show a state layer on hover and a ripple on a press. Keyboard focus shows a focus ring, and a press with a mouse or touch does not. Today is ringed, the selected day is filled, and an unavailable day is struck out.
- Touch target: Each day, each year and a menu button have a 48dp touch target, and so does an icon button as the previous or next button. Each month in the months' menu is a 48dp row.
- Color contrast: Material advises 4.5:1 contrast between the dates and the background. With the default color roles, the days and the selected day keep it on the date picker's container in every scheme, and so do the days of an invalid range. On a background of your own, keep that contrast.
- Density: The days, a menu button, the years and the months keep their size in every density.
- Motion: With reduced motion, the pages change and the pickers open and close at once.
- Forced colors: In forced colors, the selected day, the band of a range, the chosen year and the chosen month are filled with the system's highlight color, and the days outside the month or the bounds and the unavailable days are grayed out.
- Right to left: In a right-to-left locale, Left arrow and Right arrow move the other way along the days. In a right-to-left
dir, the next page slides in from the left. Make the two agree, as Localization explains.
Focus
- The days are a single tab stop: the focus lands on the selected day, or on today when none is selected, and the arrow keys move it from there. Set
autoFocusto focus that day when the calendar is shown. - An unavailable day can be focused with the keyboard, but not selected.
- While a picker is open, the page under it cannot be reached, and the picker takes the focus on its chosen year or month. When the picker closes, the focus returns to its menu button.
- When the previous or next button is disabled at a bound while it has the focus, the focus moves to the days.
- The days and the buttons of a disabled calendar cannot be focused. The days of a read-only calendar can.
Keyboard navigation
| Keys | Actions |
|---|---|
| Tab | Move the focus to the next control, with the days as one stop |
| Left or Right arrow | Move the focus to the previous or next day |
| Up or Down arrow | Move the focus to the same day of the previous or next week |
| Page Up or Page Down | Move the focus to the same day of the previous or next month |
| Shift+Page Up or Shift+Page Down | Move the focus to the same day of the previous or next year |
| Home or End | Move the focus to the first or last day of the month |
| Space or Enter | Select the focused day, or start or end a range, or choose the focused year or month |
| Arrow keys | Move the focus among the years or the months, while a picker is open |
| Shift+M | Move the focus to the months' menu button |
| Shift+Y | Move the focus to the years' menu button |
| Escape | Close the open picker, or cancel a range whose end is not selected yet |
- With one menu button, Shift+M and Shift+Y both move the focus to it. See Month and year pickers.
Labeling elements
- Name the calendar with an
aria-labeloraria-labelledby. The month shown is added to the name, as in Event date, August 2025, and each grid of days is named the same way, with its own month. - Name the previous and next buttons with an
aria-label. - Each day is named with its full date, such as Sunday, August 17, 2025, as Material advises, so the days of the week are hidden from assistive technology. The name also says whether the day is today or selected, and whether it is the first or the last date allowed.
- A day outside the bounds or unavailable is reported as disabled. While the calendar is invalid, its selected days are reported as invalid, and described by the
Textin theerrorMessageslot. - A menu button is named by its label, the month and year shown unless you give it children, and reports whether its picker is open. The years and the months are list boxes named in the locale, the chosen one selected.
- When a day is selected, screen readers announce the selection. When the previous or next button changes the page, they announce the month shown.
Calendar, RangeCalendar, CalendarGrid, CalendarGridHeader, CalendarGridBody, CalendarHeaderCell, CalendarCell and CalendarHeading take the props of the React Aria Components part of the same name, and a ref.
Calendar
Props of Calendar (31)
classNamestring | (values: CalendarRenderProps<'single'> & { defaultClassName: string | undefined; }) => stringDefault'react-aria-Calendar'The CSS className for the element. A function may be provided to compute the class based on component state.
visibleDurationDateDurationDefault{ months: 1 }The amount of days that will be displayed at once. This affects how pagination works.
createCalendar(identifier: CalendarIdentifier) => ICalendarA function to create a new Calendar object for a given calendar identifier. If not provided, the
createCalendarfunction from@internationalized/datewill be used.idstringThe element's unique identifier. See MDN.
aria-labelstringDefines a string value that labels the current element.
aria-labelledbystringIdentifies the element (or elements) that labels the current element.
aria-describedbystringIdentifies the element (or elements) that describes the object.
aria-detailsstringIdentifies the element (or elements) that provide a detailed, extended description for the object.
isDisabledbooleanDefaultfalseWhether the calendar is disabled.
autoFocusbooleanDefaultfalseWhether to automatically focus the calendar when it mounts.
onFocusChange(date: CalendarDate) => voidHandler that is called when the focused date changes.
valuenull | ZonedDateTime | CalendarDate | CalendarDateTimeThe current value (controlled).
onChange(value: MappedDateValue<T>) => voidHandler that is called when the value changes.
selectionMode'single'Default'single'Whether single or multiple selection is enabled.
isDateUnavailable(date: DateValue) => booleanCallback that is called for each date of the calendar. If it returns true, then the date is unavailable.
minValueDateValue | nullThe minimum allowed date that a user may select.
maxValueDateValue | nullThe maximum allowed date that a user may select.
isReadOnlybooleanDefaultfalseWhether the calendar value is immutable.
focusedValueDateValue | nullControls the currently focused date within the calendar.
defaultFocusedValueDateValue | nullThe date that is focused when the calendar first mounts (uncontrolled).
isInvalidbooleanWhether the current selection is invalid according to application logic.
pageBehavior'single' | 'visible'DefaultvisibleControls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.
firstDayOfWeek'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'The day that starts the week.
selectionAlignment'center' | 'start' | 'end'Default'center'Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection.
weeksInMonthnumberThe number of weeks in a month. This overrides the default set by the locale.
defaultValuenull | ZonedDateTime | CalendarDate | CalendarDateTimeThe default value (uncontrolled).
childrenChildrenOrFunction<T>The children of the component. A function may be provided to alter the children based on component state.
styleCSSProperties | (values: CalendarRenderProps<'single'> & { defaultStyle: CSSProperties; }) => CSSProperties | undefinedThe inline style for the element. A function may be provided to compute the style based on component state.
renderDOMRenderFunction<'div', CalendarRenderProps<'single'>>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
slotstring | nullA slot name for the component. Slots allow the component to receive props from a parent component. An explicit
nullvalue indicates that the local props completely override all props received from a parent.refRef<HTMLDivElement>
Calendar also takes the 70 attributes and events of the element it renders.
RangeCalendar
Props of RangeCalendar (32)
classNameClassNameOrFunction<RangeCalendarRenderProps>Default'react-aria-RangeCalendar'The CSS className for the element. A function may be provided to compute the class based on component state.
visibleDurationDateDurationDefault{ months: 1 }The amount of days that will be displayed at once. This affects how pagination works.
createCalendar(identifier: CalendarIdentifier) => ICalendarA function to create a new Calendar object for a given calendar identifier. If not provided, the
createCalendarfunction from@internationalized/datewill be used.idstringThe element's unique identifier. See MDN.
aria-labelstringDefines a string value that labels the current element.
aria-labelledbystringIdentifies the element (or elements) that labels the current element.
aria-describedbystringIdentifies the element (or elements) that describes the object.
aria-detailsstringIdentifies the element (or elements) that provide a detailed, extended description for the object.
isDisabledbooleanDefaultfalseWhether the calendar is disabled.
autoFocusbooleanDefaultfalseWhether to automatically focus the calendar when it mounts.
onFocusChange(date: CalendarDate) => voidHandler that is called when the focused date changes.
valuenull | RangeValue<T>The current value (controlled).
onChange(value: RangeValue<MappedDateValue<T>>) => voidHandler that is called when the value changes.
isDateUnavailable(date: DateValue, anchorDate: CalendarDate | null) => booleanCallback that is called for each date of the calendar. If it returns true, then the date is unavailable. The second argument provides the current selection anchor date, if any. This can be used to adjust the available dates based on the user's first selected date.
minValueDateValue | nullThe minimum allowed date that a user may select.
maxValueDateValue | nullThe maximum allowed date that a user may select.
isReadOnlybooleanDefaultfalseWhether the calendar value is immutable.
focusedValueDateValue | nullControls the currently focused date within the calendar.
defaultFocusedValueDateValue | nullThe date that is focused when the calendar first mounts (uncontrolled).
isInvalidbooleanWhether the current selection is invalid according to application logic.
pageBehavior'single' | 'visible'DefaultvisibleControls the behavior of paging. Pagination either works by advancing the visible page by visibleDuration (default) or one unit of visibleDuration.
firstDayOfWeek'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat'The day that starts the week.
selectionAlignment'center' | 'start' | 'end'Default'center'Determines the alignment of the visible months on initial render based on the current selection or current date if there is no selection.
weeksInMonthnumberThe number of weeks in a month. This overrides the default set by the locale.
defaultValuenull | RangeValue<T>The default value (uncontrolled).
commitBehavior'select' | 'reset' | 'clear'Default'select'Controls the behavior when a pointer is released outside the calendar or a blur occurs mid selection:
clear: clear the currently selected range of dates.reset: reset the selection to the previously selected range of dates.select: select the currently hovered range of dates.
allowsNonContiguousRangesbooleanWhen combined with
isDateUnavailable, determines whether non-contiguous ranges, i.e. ranges containing unavailable dates, may be selected.childrenChildrenOrFunction<T>The children of the component. A function may be provided to alter the children based on component state.
styleCSSProperties | (values: RangeCalendarRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties | undefinedThe inline style for the element. A function may be provided to compute the style based on component state.
renderDOMRenderFunction<'div', RangeCalendarRenderProps>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
slotstring | nullA slot name for the component. Slots allow the component to receive props from a parent component. An explicit
nullvalue indicates that the local props completely override all props received from a parent.refRef<HTMLDivElement>
RangeCalendar also takes the 70 attributes and events of the element it renders.
CalendarGrid
Props of CalendarGrid (7)
classNamestringDefault'react-aria-CalendarGrid'The CSS className for the element.
childrenReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement)Either a function to render calendar cells for each date in the month, or children containing a
<CalendarGridHeader>`` and` when additional customization is needed.offsetDateDurationAn offset from the beginning of the visible date range that this CalendarGrid should display. Useful when displaying more than one month at a time.
weekdayStyle'narrow' | 'short' | 'long'Default'narrow'The style of weekday names to display in the calendar grid header, e.g. single letter, abbreviation, or full day name.
styleCSSPropertiesThe inline style for the element.
renderDOMRenderFunction<'table', undefined>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
refRef<HTMLTableElement>
CalendarGrid also takes the 70 attributes and events of the element it renders.
CalendarGridHeader
Props of CalendarGridHeader (5)
classNamestringDefault'react-aria-CalendarGridHeader'The CSS className for the element.
childrenrequired(day: string) => ReactElementA function to render a
<CalendarHeaderCell>for a weekday name.styleCSSPropertiesThe inline style for the element.
renderDOMRenderFunction<'thead', undefined>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
refRef<HTMLTableSectionElement>
CalendarGridHeader also takes the 70 attributes and events of the element it renders.
CalendarGridBody
Props of CalendarGridBody (5)
classNamestringDefault'react-aria-CalendarGridBody'The CSS className for the element.
childrenrequired(date: CalendarDate) => ReactElementA function to render a
<CalendarCell>for a given date.styleCSSPropertiesThe inline style for the element.
renderDOMRenderFunction<'tbody', undefined>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
refRef<HTMLTableSectionElement>
CalendarGridBody also takes the 70 attributes and events of the element it renders.
CalendarHeaderCell
Props of CalendarHeaderCell (6)
classNamestringDefault'react-aria-CalendarHeaderCell'The CSS className for the element.
childrenReactNodeThe children of the component.
styleCSSPropertiesThe inline style for the element.
idstringThe element's unique identifier. See MDN.
renderDOMRenderFunction<'th', undefined>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
refRef<HTMLTableCellElement>
CalendarHeaderCell also takes the 70 attributes and events of the element it renders.
CalendarCell
Props of CalendarCell (9)
classNameClassNameOrFunction<CalendarCellRenderProps>Default'react-aria-CalendarCell'The CSS className for the element. A function may be provided to compute the class based on component state.
daterequiredCalendarDateThe date to render in the cell.
childrenChildrenOrFunction<T>The children of the component. A function may be provided to alter the children based on component state.
styleCSSProperties | (values: CalendarCellRenderProps & { defaultStyle: CSSProperties; }) => CSSProperties | undefinedThe inline style for the element. A function may be provided to compute the style based on component state.
renderDOMRenderFunction<'div', CalendarCellRenderProps>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
onHoverStart(e: HoverEvent) => voidHandler that is called when a hover interaction starts.
onHoverEnd(e: HoverEvent) => voidHandler that is called when a hover interaction ends.
onHoverChange(isHovering: boolean) => voidHandler that is called when the hover state changes.
refRef<HTMLTableCellElement>
CalendarCell also takes the 70 attributes and events of the element it renders.
CalendarHeading
Props of CalendarHeading (6)
classNamestringDefault'react-aria-CalendarHeading'The CSS className for the element.
offsetDateDurationDefault0The number of months from the start of the visible range to display.
formatCalendarHeadingFormatOptionsThe format of the month heading.
levelnumberDefault3The heading level.
renderDOMRenderFunction<'h1', undefined>Overrides the default DOM element with a custom render function. This allows rendering existing components with built-in styles and behaviors such as router links, animation libraries, and pre-styled components.
Requirements:
- You must render the expected element type (e.g. if
<button>is expected, you cannot render an<a>). - Only a single root DOM element can be rendered (no fragments).
- You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.
- You must render the expected element type (e.g. if
refRef<HTMLHeadingElement>
CalendarHeading also takes the 277 attributes and events of the element it renders.
CalendarWeekdays
Pass a function as its children: it is called with the name of each day of the week, and returns its label, such as a CalendarHeaderCell. weekdayStyle sets the format of the names, as on a CalendarGrid.
Props of CalendarWeekdays (3)
childrenrequired(day: string) => ReactElementA function to render a
<CalendarHeaderCell>for a weekday name.weekdayStyle'narrow' | 'short' | 'long'Default'narrow'The style of weekday names to display in the calendar grid header, e.g. single letter, abbreviation, or full day name.
refRef<HTMLTableElement>
CalendarWeekdays also takes the 2 attributes and events of the element it renders.
CalendarPage
Takes className, style, ref and children.
Props of CalendarPage (1)
refRef<HTMLDivElement>
CalendarPage also takes the 3 attributes and events of the element it renders.
CalendarMonths
Takes className, style and ref.
Props of CalendarMonths (1)
refRef<HTMLDivElement>
CalendarMonths also takes the 2 attributes and events of the element it renders.
CalendarMenuButton
Takes the props of a button, except slot. Its children are its label.
isPendingbooleanWhether the button is in a pending state. This disables press and hover events while retaining focusability, and announces the pending state to screen readers.
Props of CalendarMenuButton (47)
formstringThe
<form>element to associate the button with. The value of this attribute must be the id of a<form>in the same document. See MDN.idstringThe element's unique identifier. See MDN.
aria-labelstringDefines a string value that labels the current element.
aria-labelledbystringIdentifies the element (or elements) that labels the current element.
aria-describedbystringIdentifies the element (or elements) that describes the object.
aria-detailsstringIdentifies the element (or elements) that provide a detailed, extended description for the object.
onClick(e: MouseEvent<FocusableElement>) => voidNot recommended – use
onPressinstead.onClickis an alias foronPressprovided for compatibility with other libraries.onPressprovides additional event details for non-mouse interactions.isDisabledbooleanWhether the button is disabled.
onPress(e: PressEvent) => voidHandler that is called when the press is released over the target.
onPressStart(e: PressEvent) => voidHandler that is called when a press interaction starts.
onPressEnd(e: PressEvent) => voidHandler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
onPressChange(isPressed: boolean) => voidHandler that is called when the press state changes.
onPressUp(e: PressEvent) => voidHandler that is called when a press is released over the target, regardless of whether it started on the target or not.
autoFocusbooleanWhether the element should receive focus on render.
onFocus(e: FocusEvent<Target>) => voidHandler that is called when the element receives focus.
onBlur(e: FocusEvent<Target>) => voidHandler that is called when the element loses focus.
onFocusChange(isFocused: boolean) => voidHandler that is called when the element's focus status changes.
onKeyDown(e: KeyboardEvent) => voidHandler that is called when a key is pressed.
onKeyUp(e: KeyboardEvent) => voidHandler that is called when a key is released.
hrefstringA URL to link to if elementType="a".
targetstringThe target window for the link.
relstringThe relationship between the linked resource and the current page. See MDN.
elementType(props: any) => ReactNode | Promise<ReactNode> | new (props: any, context: any) => Component<any, any, any> | 'button'Default'button'The HTML element or React element used to render the button, e.g. 'div', 'a', or
RouterLink.aria-disabled'true' | 'false' | booleanIndicates whether the element is disabled to users of assistive technology.
aria-expanded'true' | 'false' | booleanIndicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
aria-haspopup'dialog' | 'menu' | 'true' | 'false' | 'grid' | 'listbox' | 'tree' | booleanIndicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
aria-controlsstringIdentifies the element (or elements) whose contents or presence are controlled by the current element.
aria-pressed'true' | 'false' | 'mixed' | booleanIndicates the current "pressed" state of toggle buttons.
aria-current'time' | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | booleanIndicates whether this element represents the current item within a container or set of related elements.
type'button' | 'submit' | 'reset'Default'button'The behavior of the button when used in an HTML form.
preventFocusOnPressbooleanWhether to prevent focus from moving to the button when pressing it.
Caution, this can make the button inaccessible and should only be used when alternative keyboard interaction is provided, such as ComboBox's MenuTrigger or a NumberField's increment/decrement control.
formActionButtonHTMLAttributes<HTMLButtonElement>['formAction']The URL that processes the information submitted by the button. Overrides the action attribute of the button's form owner.
formEncTypestringIndicates how to encode the form data that is submitted.
formMethodstringIndicates the HTTP method used to submit the form.
formNoValidatebooleanIndicates that the form is not to be validated when it is submitted.
formTargetstringOverrides the target attribute of the button's form owner.
namestringSubmitted as a pair with the button's value as part of the form data.
valuestringThe value associated with the button's name when it's submitted with the form data.
excludeFromTabOrderbooleanWhether to exclude the element from the sequential tab order. If true, the element will not be focusable via the keyboard by tabbing. This should be avoided except in rare scenarios where an alternative means of accessing the element or its functionality via the keyboard is available.
onHoverStart(e: HoverEvent) => voidHandler that is called when a hover interaction starts.
onHoverEnd(e: HoverEvent) => voidHandler that is called when a hover interaction ends.
onHoverChange(isHovering: boolean) => voidHandler that is called when the hover state changes.
refRef<HTMLButtonElement & Element>classNameClassNameOrFunction<ButtonRenderProps>styleStyleOrFunction<ButtonRenderProps>picker'month' | 'year'childrenReactNode
CalendarYearPicker
Takes the props of React Aria's CalendarYearPicker, except children, and the className and style of the element it opens in.
Props of CalendarYearPicker (2)
visibleYearsnumberDefault20The number of years to display.
formatCalendarYearPickerFormatOptionsThe format to display.
CalendarYearPicker also takes the 2 attributes and events of the element it renders.
CalendarMonthPicker
Takes the props of React Aria's CalendarMonthPicker, except children, and the className and style of the element it opens in. format is long by default.
Props of CalendarMonthPicker (1)
format'numeric' | 'narrow' | 'short' | 'long' | '2-digit'The format of the month.
CalendarMonthPicker also takes the 2 attributes and events of the element it renders.