Skip to contents

Calendar

An easily stylable calendar component.

View as Markdown
March 2026

Anatomy

Import the component and assemble its parts:

Anatomy

Examples

Unavailable dates

You can use the isDateUnavailable() prop to mark specific dates as unavailable. Unavailable dates are visually indicated and cannot be selected, but are focusable.

This example disables weekends, US holidays, and the first Monday of every month.

March 2026

Validation

You can use the minDate and maxDate props to limit the range of selectable dates.

March 2026
March 2026

Lazy loading

You can render custom content inside <Calendar.DayButton> and use Calendar.useContext() to react to month changes — for example, to lazily load per-day data.

March 2026

Display week numbers

You can use useWeekList() and useDayList() hooks to build a calendar with additional DOM elements, like week numbers.

March 2026
10
11
12
13
14

Timezone support

You can use the timezone prop to display data in the calendar in your preferred timezone.

Timezone support is based on @date-fns/tz.

Calendar is displayed in America/New_York timezone.

April 2025

Stored date: Thu Apr 17 2025 04:45:00 GMT+0200 (Central European Summer Time)

The calendar can display the date in a selected timezone.

March 2026

Month and year select

Use Calendar.useContext() inside the calendar to read visibleDate and call setVisibleDate, enabling custom controls like the Select component for direct month and year navigation.

Animating month changes

You can use the <Calendar.Viewport> component to animate month transitions. Wrapping the <Calendar.DayGridBody> in the <Calendar.Viewport> renders the previous month if a transition is in progress.

March 2026

Animating with motion/react

You can use external animation libraries like Framer Motion to animate month transitions.

March 2026

Localization

The calendar’s locale is controlled by the date library. It handles month and day names, as well as the start of the week. You can use the <LocalizationProvider> to customize these settings.

API reference

Root

Groups all parts of the calendar. Renders a <div> element.

defaultValueTemporalValue
Description

The uncontrolled value that should be initially selected. To render a controlled (Range)Calendar, use the value prop instead.

Type
valueTemporalValue
Name
Description

The controlled value that should be selected. To render an uncontrolled (Range)Calendar, use the defaultValue prop instead.

Type
onValueChangefunction
Description

Event handler called when the selected value changes. Provides the new value as an argument. Has getValidationError() in the eventDetails to retrieve the validation error associated to the new value.

Type
defaultVisibleDateDate
Description

The date used to decide which month should be initially displayed in the Day Grid. To render a controlled Calendar, use the visibleDate prop instead.

Type
visibleDateDate
Description

The date used to decide which month should be displayed in the Day Grid. To render an uncontrolled Calendar, use the defaultVisibleDate prop instead.

Type
onVisibleDateChangefunction
Description

Event handler called when the visible date changes. Provides the new date as an argument. Has the change reason in the eventDetails.

Type
isDateUnavailablefunction
Description

Mark specific dates as unavailable. Those dates will not be selectable but they will still be focusable with the keyboard.

Type
maxDateDate
Description

Maximal selectable date.

Type
minDateDate
Description

Minimal selectable date.

Type
monthPageSizenumber1
Description

The amount of months to move by when navigating. This is mostly useful when displaying multiple day grids.

Type
Default
1
referenceDateDate'The closest valid date using the validation props.'
Description

The date used to generate the new value when both value and defaultValue are empty. It can be used to:

  • set a desired time on the selected date;
  • set a desired default year or month;
Type
Default
'The closest valid date using the validation props.'
timezonestring'The timezone of the "value" or "defaultValue" prop if defined, "default" otherwise.'
Description

Choose which timezone to use for the value. Example: “default”, “system”, “UTC”, “America/New_York”. If you pass values from other timezones to some props, they will be converted to this timezone before being used.

Type
Default
'The timezone of the "value" or "defaultValue" prop if defined, "default" otherwise.'
disabledbooleanfalse
Description

Whether the component should ignore user interaction.

Type
Default
false
readOnlybooleanfalse
Description

Whether the user should be unable to select a date in the calendar.

Type
Default
false
invalidbooleanfalse
Description

Whether the calendar is forcefully marked as invalid. A calendar can be invalid when the selected date fails validation (that is, is outside of the allowed minDate and maxDate range).

Type
Default
false
children| React.ReactNode
| ((parameters: CalendarContext) => React.ReactNode)
Description

The children of the component. If a function is provided, it will be called with the public context as its parameter.

Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type
data-disabled

Present when the calendar is disabled.

data-readonly

Present when the calendar is readonly.

data-invalid

Present when the current value is invalid (fails validation).

data-empty

Present when the current value is empty.

data-navigation-direction

Indicates the direction of the navigation (based on the month navigating to).

AttributeDescription
data-disabled

Present when the calendar is disabled.

data-readonly

Present when the calendar is readonly.

data-invalid

Present when the current value is invalid (fails validation).

data-empty

Present when the current value is empty.

data-navigation-direction

Indicates the direction of the navigation (based on the month navigating to).

Calendar.Root.PropsHide

Re-Export of Root props as CalendarRootProps

Calendar.Root.StateHide

Calendar.Root.ChangeEventReasonHide

Calendar.Root.NavigationDirectionHide

Calendar.Root.ValueChangeEventDetailsHide

Calendar.Root.ValueChangeHandlerContextHide

Calendar.Root.VisibleDateChangeEventDetailsHide

DayGrid

Groups all the parts of the calendar’s day grid. Renders a <table> element.

classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGrid.PropsHide

Re-Export of DayGrid props as CalendarDayGridProps

Calendar.DayGrid.StateHide

DayGridHeader

Groups all parts of the calendar’s day grid header. Renders a <thead> element.

classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGridHeader.PropsHide

Re-Export of DayGridHeader props as CalendarDayGridHeaderProps

Calendar.DayGridHeader.StateHide

DayGridHeaderCell

An individual day header cell in the calendar. Renders a <th> element.

value*
Name
Type
formatterfunction(date) => adapter.format(date, 'EEE').charAt(0).toUpperCase()
Description

The formatter function used to display the day of the week.

Type
Default
(date) => adapter.format(date, 'EEE').charAt(0).toUpperCase()
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGridHeaderCell.PropsHide

Re-Export of DayGridHeaderCell props as CalendarDayGridHeaderCellProps

Calendar.DayGridHeaderCell.StateHide

DayGridBody

Groups all parts of the calendar’s day grid. Renders a <tbody> element.

fixedWeekNumbernumber
Description

Will render the requested amount of weeks by adding weeks of the next month if needed. Set it to 6 to create a Gregorian calendar where all months have the same number of weeks.

Type
offsetnumber0
Name
Description

The offset to apply to the rendered month compared to the current month. This is mostly useful when displaying multiple day grids.

Type
Default
0
children| React.ReactNode
| ((week: Date, index: number, weeks: Date[]) => React.ReactNode)
Description

The children of the component. If a function is provided, it will be called for each week to render as its parameter.

Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGridBody.PropsHide

Re-Export of DayGridBody props as CalendarDayGridBodyProps

Calendar.DayGridBody.StateHide

DayGridRow

Groups all cells of a given calendar’s day grid row. Renders a <tr> element.

value*
Name
Description

The date object representing the week.

Type
children| React.ReactNode
| ((day: Date, index: number, days: Date[]) => React.ReactNode)
Description

The children of the component. If a function is provided, it will be called for each day of the week as its parameter.

Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGridRow.PropsHide

Re-Export of DayGridRow props as CalendarDayGridRowProps

Calendar.DayGridRow.StateHide

DayGridCell

An individual day cell in the calendar. Renders a <td> element.

value*
Name
Description

The value to select when this cell is clicked.

Type
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type

Calendar.DayGridCell.PropsHide

Re-Export of DayGridCell props as CalendarDayGridCellProps

Calendar.DayGridCell.StateHide

DayButton

An individual interactive day button in the calendar. Renders a <button> element.

focusableWhenDisabledbooleanfalse
Description

When true the item remains focusable when disabled.

Type
Default
false
nativeButtonbooleantrue
Description

Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).

Type
Default
true
formatstringadapter.formats.dayOfMonth
Name
Description

The format used to display the day.

Type
Default
adapter.formats.dayOfMonth
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type
data-selected

Present when the day is selected.

data-disabled

Present when the day is disabled.

data-current

Present when the day is the current date.

data-outside-month

Present when the day is outside the month rendered by the day grid wrapping it.

data-unavailable

Present when the day is unavailable.

AttributeDescription
data-selected

Present when the day is selected.

data-disabled

Present when the day is disabled.

data-current

Present when the day is the current date.

data-outside-month

Present when the day is outside the month rendered by the day grid wrapping it.

data-unavailable

Present when the day is unavailable.

Calendar.DayButton.PropsHide

Re-Export of DayButton props as CalendarDayButtonProps

Calendar.DayButton.StateHide

DecrementMonth

Displays an element to navigate to the previous month in the calendar. Renders a <button> element.

nativeButtonbooleantrue
Description

Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).

Type
Default
true
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type
data-disabled

Present when the button is disabled.

AttributeDescription
data-disabled

Present when the button is disabled.

Calendar.DecrementMonth.PropsHide

Re-Export of DecrementMonth props as CalendarDecrementMonthProps

Calendar.DecrementMonth.StateHide

IncrementMonth

Displays an element to navigate to the next month in the calendar. Renders a <button> element.

nativeButtonbooleantrue
Description

Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>).

Type
Default
true
classNamestring | function
Description

CSS class applied to the element, or a function that returns a class based on the component’s state.

Type
styleReact.CSSProperties | function
Name
Type
renderReactElement | function
Name
Description

Allows you to replace the component’s HTML element with a different tag, or compose it with another component.

Accepts a ReactElement or a function that returns the element to render.

Type
data-disabled

Present when the button is disabled.

AttributeDescription
data-disabled

Present when the button is disabled.

Calendar.IncrementMonth.PropsHide

Re-Export of IncrementMonth props as CalendarIncrementMonthProps

Calendar.IncrementMonth.StateHide

Viewport

A viewport for displaying calendar month transitions. This component is only required if you want to animate certain part of a calendar when navigating between months. The first rendered child element has to handle a ref. Passes data-current to the currently visible content and data-previous to the previous content when animating between two. Doesn’t render its own HTML element.

children*
Description

The content to render inside the transition container.

Type
data-current

Applied to the direct child of the viewport when no transitions are present or the new content when it’s entering.

data-navigation-direction

Indicates the direction of the navigation (based on the month navigating to).

data-previous

Applied to the direct child of the viewport that contains the exiting content when transitions are present.

data-starting-style

Present when the day grid body is animating in.

data-ending-style

Present when the day grid body is animating out.

AttributeDescription
data-current

Applied to the direct child of the viewport when no transitions are present or the new content when it’s entering.

data-navigation-direction

Indicates the direction of the navigation (based on the month navigating to).

data-previous

Applied to the direct child of the viewport that contains the exiting content when transitions are present.

data-starting-style

Present when the day grid body is animating in.

data-ending-style

Present when the day grid body is animating out.

Calendar.Viewport.PropsHide

Re-Export of Viewport props as CalendarViewportProps

Calendar.Viewport.StateHide