A calendar displays one or more date grids and allows users to select a single date.
Vanilla CSS theme
--tint CSS variable used by the Vanilla CSS examples.December 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
Value
Use the value or defaultValue prop to set the date value, using objects in the @internationalized/date package. This library supports parsing date strings in multiple formats, manipulation across international calendar systems, time zones, etc.
February 2020
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
Selected date: Monday, February 3, 2020
import {parseDate, getLocalTimeZone} from '@internationalized/date';
import {useDateFormatter} from 'react-aria';
import {Calendar} from './Calendar';
import {useState} from 'react';
function Example() {
let [date, setDate] = useState(parseDate('2020-02-03'));
let formatter = useDateFormatter({ dateStyle: 'full' });
return (
<>
<Calendar
value={date}
onChange={setDate}
/>
<p>Selected date: {formatter.format(date.toDate(getLocalTimeZone()))}</p>
</>
);
}
International calendars
By default, Calendar displays the value using the calendar system for the user's locale. Use <I18nProvider> to override the calendar system by setting the Unicode calendar locale extension. The onChange event always receives a date in the same calendar as the value or defaultValue (Gregorian if no value is provided), regardless of the displayed locale.
शक 1946 माघ
| र | सो | मं | बु | गु | शु | श |
|---|---|---|---|---|---|---|
Custom calendar systems
Calendar also supports custom calendar systems that implement custom business rules, for example a fiscal year calendar that follows a 4-5-4 format, where month ranges don't follow the usual Gregorian calendar. See the @internationalized/date docs for an example implementation.
December 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
import type {AnyCalendarDate} from '@internationalized/date';
import {CalendarDate, startOfWeek, toCalendar, GregorianCalendar} from '@internationalized/date';
import {Calendar} from './Calendar';
export default function Example() {
return (
<Calendar
firstDayOfWeek="sun"
createCalendar={() => new Custom454()} />
);
}
// See @internationalized/date docs linked above.
Validation
Use the minValue and maxValue props to set the valid date range. The isDateUnavailable callback prevents certain dates from being selected. For custom validation rules, set the isInvalid prop and the errorMessage slot.
December 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
Display options
Set the visibleDuration prop and render multiple CalendarGrid elements to display more than one month at a time. The pageBehavior prop controls whether pagination advances by a single month or multiple. The firstDayOfWeek prop overrides the locale-specified first day of the week.
December 2025
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
January 2026
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
firstDayOfWeek
Controlling the focused date
Use the focusedValue or defaultFocusedValue prop to control which date is focused. This controls which month is visible. The onFocusChange event is called when a date is focused by the user.
July 2021
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
import {Calendar} from './Calendar';
import {Button} from './Button';
import {CalendarDate, today, getLocalTimeZone} from '@internationalized/date';
import {useState} from 'react';
function Example() {
let defaultDate = new CalendarDate(2021, 7, 1);
let [focusedDate, setFocusedDate] = useState(defaultDate);
return (
<div>
<Button
style={{marginBottom: 20}}
onPress={() => setFocusedDate(today(getLocalTimeZone()))}>
Today
</Button>
<Calendar
focusedValue={focusedDate}
onFocusChange={setFocusedDate}
/>
</div>
);
}
Month and year pickers
You can also control the focused date via CalendarStateContext. This example shows month and year dropdown components that work inside any <Calendar>.
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
import {Calendar} from 'react-aria-components';
import {CalendarGrid, CalendarCell} from './Calendar';
import {MonthDropdown} from './MonthDropdown';
import {YearDropdown} from './YearDropdown';
import {Button} from './Button';
import {ChevronLeft, ChevronRight} from 'lucide-react';
<Calendar>
<header style={{display: 'flex', gap: 4}}>
<Button slot="previous" variant="quiet">
<ChevronLeft />
</Button>
<MonthDropdown />
<YearDropdown />
<Button slot="next" variant="quiet">
<ChevronRight />
</Button>
</header>
<CalendarGrid>
{(date) => <CalendarCell date={date} />}
</CalendarGrid>
</Calendar>
API
<Calendar>
<Button slot="previous" />
<Heading />
<Button slot="next" />
<CalendarGrid>
<CalendarGridHeader>
{day => <CalendarHeaderCell />}
</CalendarGridHeader>
<CalendarGridBody>
{date => <CalendarCell date={date} />}
</CalendarGridBody>
</CalendarGrid>
<Text slot="errorMessage" />
</Calendar>
Calendar
A calendar displays one or more date grids and allows users to select a single date.
| Name | Type | Default |
|---|---|---|
visibleDuration | DateDuration | Default: {months: 1}
|
| The amount of days that will be displayed at once. This affects how pagination works. | ||
createCalendar | | Default: — |
A function to create a new Calendar
object for a given calendar identifier. If not provided, the createCalendar function
from @internationalized/date will be used. | ||
isDateUnavailable | | Default: — |
| Callback that is called for each date of the calendar. If it returns true, then the date is unavailable. | ||
isDisabled | boolean | Default: false
|
| Whether the calendar is disabled. | ||
isReadOnly | boolean | Default: false
|
| Whether the calendar value is immutable. | ||
focusedValue | DateValue | null | Default: — |
| Controls the currently focused date within the calendar. | ||
defaultFocusedValue | DateValue | null | Default: — |
| The date that is focused when the calendar first mounts (uncontrolled). | ||
pageBehavior | PageBehavior | Default: visible
|
| Controls 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' | Default: — |
| The day that starts the week. | ||
selectionAlignment | 'start'
| 'center'
| '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. | ||
children | ChildrenOrFunction | Default: — |
| The children of the component. A function may be provided to alter the children based on component state. | ||
value | DateValue | null | Default: — |
| The current value (controlled). | ||
defaultValue | DateValue | null | Default: — |
| The default value (uncontrolled). | ||
onChange | | Default: — |
| Handler that is called when the value changes. | ||
Default className: react-aria-Calendar
| Render Prop | CSS Selector |
|---|---|
isDisabled | CSS Selector: [data-disabled]
|
| Whether the calendar is disabled. | |
state | CSS Selector: — |
| State of the calendar. | |
isInvalid | CSS Selector: [data-invalid]
|
| Whether the calendar is invalid. | |
CalendarGrid
A calendar grid displays a single grid of days within a calendar or range calendar which can be keyboard navigated and selected by the user.
| Name | Type | Default |
|---|---|---|
children | ReactElement
| ReactElement | Default: — |
Either a function to render calendar cells for each date in the month,
or children containing a <CalendarGridHeader>`` and<CalendarGridBody>`
when additional customization is needed. | ||
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. | ||
Default className: react-aria-CalendarGrid
CalendarGridHeader
A calendar grid header displays a row of week day names at the top of a month.
| Name | Type | |
|---|---|---|
children | | |
A function to render a <CalendarHeaderCell> for a weekday name. | ||
Default className: react-aria-CalendarGridHeader
CalendarHeaderCell
A calendar header cell displays a week day name at the top of a column within a calendar.
| Name | Type | |
|---|---|---|
children | ReactNode | |
| The children of the component. | ||
Default className: react-aria-CalendarHeaderCell
CalendarGridBody
A calendar grid body displays a grid of calendar cells within a month.
| Name | Type | |
|---|---|---|
children | | |
A function to render a <CalendarCell> for a given date. | ||
Default className: react-aria-CalendarGridBody
CalendarCell
A calendar cell displays a date cell within a calendar grid which can be selected by the user.
| Name | Type | |
|---|---|---|
date | CalendarDate | |
| The date to render in the cell. | ||
children | ChildrenOrFunction | |
| The children of the component. A function may be provided to alter the children based on component state. | ||
Default className: react-aria-CalendarCell
| Render Prop | CSS Selector |
|---|---|
date | CSS Selector: — |
| The date that the cell represents. | |
formattedDate | CSS Selector: — |
| The day number formatted according to the current locale. | |
isHovered | CSS Selector: [data-hovered]
|
| Whether the cell is currently hovered with a mouse. | |
isPressed | CSS Selector: [data-pressed]
|
| Whether the cell is currently being pressed. | |
isSelected | CSS Selector: [data-selected]
|
| Whether the cell is selected. | |
isSelectionStart | CSS Selector: [data-selection-start]
|
| Whether the cell is the first date in a range selection. | |
isSelectionEnd | CSS Selector: [data-selection-end]
|
| Whether the cell is the last date in a range selection. | |
isFocused | CSS Selector: [data-focused]
|
| Whether the cell is focused. | |
isFocusVisible | CSS Selector: [data-focus-visible]
|
| Whether the cell is keyboard focused. | |
isDisabled | CSS Selector: [data-disabled]
|
Whether the cell is disabled, according to the calendar's minValue, maxValue, and isDisabled props.
Disabled dates are not focusable, and cannot be selected by the user. They are typically
displayed with a dimmed appearance. | |
isOutsideVisibleRange | CSS Selector: [data-outside-visible-range]
|
| Whether the cell is outside the visible range of the calendar. For example, dates before the first day of a month in the same week. | |
isOutsideMonth | CSS Selector: [data-outside-month]
|
| Whether the cell is outside the current month. | |
isUnavailable | CSS Selector: [data-unavailable]
|
Whether the cell is unavailable, according to the calendar's isDateUnavailable prop. Unavailable dates remain
focusable, but cannot be selected by the user. They should be displayed with a visual affordance to indicate they
are unavailable, such as a different color or a strikethrough.
Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,
as defined by WCAG. | |
isInvalid | CSS Selector: [data-invalid]
|
| Whether the cell is part of an invalid selection. | |
isToday | CSS Selector: [data-today]
|
| Whether the cell is today. | |