Skip to contents

Calendar

An easily stylable calendar component.

View as Markdown
March 2026

Anatomy

Import the component and assemble its parts:

Anatomy

Examples

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 <select> dropdowns 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

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
Date | null | undefined
valueTemporalValue
Name
Description

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

Type
Date | null | undefined
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
| ((
    value: TemporalValue,
    eventDetails: CalendarValueChangeEventDetails<ValidateDateReturnValue>,
  ) => void)
| undefined
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
Date | undefined
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
Date | undefined
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
| ((
    visibleDate: Date,
    eventDetails: CalendarVisibleDateChangeEventDetails,
  ) => void)
| undefined
isDateUnavailable((day: Date) => boolean)
Description

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

Type
((day: Date) => boolean) | undefined
maxDateDate
Description

Maximal selectable date.

Type
Date | undefined
minDateDate
Description

Minimal selectable date.

Type
Date | undefined
monthPageSizenumber1
Description

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

Type
number | undefined
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
Date | undefined
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
string | undefined
Default
'The timezone of the "value" or "defaultValue" prop if defined, "default" otherwise.'
disabledbooleanfalse
Description

Whether the component should ignore user interaction.

Type
boolean | undefined
Default
false
readOnlybooleanfalse
Description

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

Type
boolean | undefined
Default
false
invalidbooleanfalse
Description

Whether the calendar is forcefully marked as invalid.

Type
boolean | undefined
Default
false
childrenReactNode | ((parameters: CalendarContext) => ReactNode)
Description

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

Type
| React.ReactNode
| ((parameters: CalendarContext) => ReactNode)
classNamestring | function
Description

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

Type
| string
| ((state: Calendar.Root.State) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.Root.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.Root.State,
  ) => ReactElement)
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-disabledPresent when the calendar is disabled.
data-readonlyPresent when the calendar is readonly.
data-invalidPresent when the current value is invalid (fails validation).
data-emptyPresent when the current value is empty.
data-navigation-directionIndicates the direction of the navigation (based on the month navigating to).

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
| string
| ((state: Calendar.DayGrid.State) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGrid.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGrid.State,
  ) => ReactElement)

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
| string
| ((
    state: Calendar.DayGridHeader.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGridHeader.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGridHeader.State,
  ) => ReactElement)

DayGridHeaderCell

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

value*Date
Name
Type
Date
formatter((date: Date) => string)(date) => adapter.format(date, 'EEE').charAt(0).toUpperCase()
Description

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

Type
((date: Date) => string) | undefined
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
| string
| ((
    state: Calendar.DayGridHeaderCell.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGridHeaderCell.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGridHeaderCell.State,
  ) => ReactElement)

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
number | undefined
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
number | undefined
Default
0
childrenReactNode | ((week: Date, index: number, weeks: Date[]) => 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
| React.ReactNode
| ((
    week: Date,
    index: number,
    weeks: Date[],
  ) => ReactNode)
classNamestring | function
Description

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

Type
| string
| ((
    state: Calendar.DayGridBody.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGridBody.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGridBody.State,
  ) => ReactElement)

DayGridRow

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

value*Date
Name
Description

The date object representing the week.

Type
Date
childrenReactNode | ((day: Date, index: number, days: Date[]) => 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
| React.ReactNode
| ((day: Date, index: number, days: Date[]) => ReactNode)
classNamestring | function
Description

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

Type
| string
| ((state: Calendar.DayGridRow.State) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGridRow.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGridRow.State,
  ) => ReactElement)

DayGridCell

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

value*Date
Name
Description

The value to select when this cell is clicked.

Type
Date
classNamestring | function
Description

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

Type
| string
| ((
    state: Calendar.DayGridCell.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayGridCell.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayGridCell.State,
  ) => ReactElement)

DayButton

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

focusableWhenDisabledbooleanfalse
Description

When true the item remains focusable when disabled.

Type
boolean | undefined
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 (e.g. <div>).

Type
boolean | undefined
Default
true
formatstringadapter.formats.dayOfMonth
Name
Description

The format used to display the day.

Type
string | undefined
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
| string
| ((state: Calendar.DayButton.State) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DayButton.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DayButton.State,
  ) => ReactElement)
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-selectedPresent when the day is selected.
data-disabledPresent when the day is disabled.
data-currentPresent when the day is the current date.
data-outside-monthPresent when the day is outside the month rendered by the day grid wrapping it.
data-unavailablePresent when the day is unavailable.

DecrementMonth

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

focusableWhenDisabledbooleantrue
Description

When true the button remains focusable when disabled.

Type
boolean | undefined
Default
true
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 (e.g. <div>).

Type
boolean | undefined
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
| string
| ((
    state: Calendar.DecrementMonth.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.DecrementMonth.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.DecrementMonth.State,
  ) => ReactElement)
data-disabled
Present when the button is disabled.
AttributeDescription
data-disabledPresent when the button is disabled.

IncrementMonth

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

focusableWhenDisabledbooleantrue
Description

When true the button remains focusable when disabled.

Type
boolean | undefined
Default
true
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 (e.g. <div>).

Type
boolean | undefined
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
| string
| ((
    state: Calendar.IncrementMonth.State,
  ) => string | undefined)
styleReact.CSSProperties | function
Name
Type
| React.CSSProperties
| ((
    state: Calendar.IncrementMonth.State,
  ) => CSSProperties | undefined)
| undefined
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
| ReactElement
| ((
    props: HTMLProps,
    state: Calendar.IncrementMonth.State,
  ) => ReactElement)
data-disabled
Present when the button is disabled.
AttributeDescription
data-disabledPresent when the button is disabled.

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*React.JSX.Element
Description

The content to render inside the transition container.

Type
React.JSX.Element
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-currentApplied to the direct child of the viewport when no transitions are present or the new content when it's entering.
data-navigation-directionIndicates the direction of the navigation (based on the month navigating to).
data-previousApplied to the direct child of the viewport that contains the exiting content when transitions are present.
data-starting-stylePresent when the day grid body is animating in.
data-ending-stylePresent when the day grid body is animating out.