React Calendar

The React Calendar component provides an intuitive interface for date selection and navigation. It offers a comprehensive set of features including multiple view modes, date range restrictions, custom rendering, and accessibility support for building robust date-picking experiences.

Getting started

To create a new Vite project, refer to the Vite documentation. Once that Vite project is ready to run with default settings, let's add the React Calendar component to the project.

Installing Syncfusion® React packages

To use the React Calendar component in this project, the @syncfusion/react-calendars package needs to be installed using the following command:

Adding CSS reference

In this article, the Material theme is applied using CSS styles, which are available in installed packages. The necessary Material CSS styles for the Calendar component and its dependents were imported into the src/App.css file.

Adding Calendar component

To include the Calendar component in your application, import the Calendar from the @syncfusion/react-calendars package in App.tsx.

Add the Calendar component in application as shown in below code example.

Run the project

To run the project, use the following command:

The Calendar component provides a simple and intuitive way to select dates. By default, it displays the current month and allows users to navigate between months and years.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Selected date: Tue Dec 16 2025

Views

The Calendar component supports multiple view modes including month, year, and decade views. Users can switch between different views using the start and depth properties to control the initial view and navigation depth.

Year picker

The Calendar component allows users to select a year by setting both the start and depth properties to Decade view. This configuration opens the calendar in decade view, displaying a range of years and able to pick a specific year directly from this view.

201920202021
202220232024
202520262027
202820292030

Month picker

The Calendar component allows users to select a month by setting both the start and depth properties to Year view. This configuration opens the calendar in year view, showing all months of the selected year and can choose a specific month directly.

JanFebMar
AprMayJun
JulAugSep
OctNovDec

Date Range

The minDate and maxDate properties used to control date selection by setting minimum and maximum selectable dates. This ensures users can only select dates within the specified range, making it ideal for booking systems and date-restricted scenarios.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Controlled Vs Uncontrolled

The Calendar component supports both controlled and uncontrolled modes. In controlled mode, the value prop manages the selected date externally, while uncontrolled mode uses the defaultValue prop for initial state with internal state management.

Controlled Calendar

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Uncontrolled Calendar

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Toolbar

The Calendar component includes a showToolBar property that displays a header section. Enabling this property improves the visual clarity of the calendar layout. The toolbar works with both Horizontal and Vertical orientations.

Horizontal orientation

When orientation is set to Horizontal, the calendar displays months side by side in a horizontal layout. This format is suitable for wider containers and provides a broader view of dates across months.

Tue, 16 Dec
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Vertical orientation

When orientation is set to Vertical, the calendar stacks months vertically. This layout is ideal for narrower spaces and offers a scrollable view that aligns with vertical content flow.

Tue, 16 Dec
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Disabled Dates

The cellTemplate property is used to customize the appearance of specific dates, allowing to disable those dates to prevent user selection. This is useful for blocking weekends, holidays, or unavailable dates in scheduling applications.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Special Dates

The cellTemplate property is used to customize the appearance of specific dates by highlighting important dates, events, or special occasions with custom styling, icons, or indicators.

SuMoTuWeThFrSa
1
2345678
9101112131415
16171819202122
23242526272829
30

Week numbers

The weekNumber property is used to display week numbers alongside the calendar dates. This feature is particularly useful for business applications that reference ISO week numbers for planning and reporting purposes.

SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

Week Days Format

The WeekDaysFormat property is used to display week days into a different formats alongside the calendar dates.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Multi Selection

The multiSelect property enable users to select multiple non-consecutive dates. This is useful for scheduling events, selecting date ranges, or marking multiple important dates.

SuMoTuWeThFrSa
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678
Selected date: Wed Jan 01 2025, Wed Jan 15 2025, Fri Jan 03 2025, Sat Jan 25 2025

Disabled Calendar

The disabled property is used to disable the entire calendar component. This prevents all user interactions while maintaining the visual display of the calendar.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Readonly Calendar

The readonly property is used in the calendar component to prevent users from selecting or altering dates. This guarantees that the displayed information remains stable and unchanged.

SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Accessibility

The Calendar component follows accessibility guidelines and standards, including ADA, Section 508, WCAG 2.2 standards, and WCAG roles that are commonly used to evaluate accessibility.

The accessibility compliance for the Calendar component is outlined below.

Accessibility CriteriaCompatibility
WCAG 2.2 Support
Section 508 Support
Screen Reader Support
Right-To-Left Support
Color Contrast
Mobile Device Support
Keyboard Navigation Support
Accessibility Validation

- All features of the component meet the requirement.

- Some features of the component do not meet the requirement.

- The component does not meet the requirement.

WAI-ARIA attributes

The Calendar component follows the WAI-ARIA patterns to meet accessibility requirements. The following ARIA attributes are used in the Calendar component:

AttributesPurpose
tabindexMakes the calendar focusable
roleSpecifies the role of the calendar dates table.
data-roleIdentifies the component's role
aria-atomicIndicates the entire title should be presented as a whole when changes occur
aria-liveAnnounces changes to the month/year title immediately to screen reader users
aria-labelProvides accessible names for calendar navigation and date cells.
aria-disabledIndicates disabled dates that cannot be selected.
aria-selectedIndicates the currently selected date(s).

Keyboard interaction

The Calendar component follows keyboard interaction guidelines, making it accessible for people who use assistive technologies (AT) and those who rely on keyboard navigation. The following keyboard shortcuts are supported:

WindowsmacOSAction
Arrow KeysArrow KeysNavigate between dates in the current view.
HomeFn + ←Focuses the first day of the month.
EndFn + →Focuses the last day of the month.
Page UpPage UpFocuses the same date of the previous month.
Page DownPage DownFocuses the same date of the next month.
EnterEnterSelects the currently focused date.
Shift + Page UpShift + Page UpFocuses the same date of the previous year.
Shift + Page DownShift + Page DownFocuses the same date for the next year.
Control + Upper ArrowCommand + Upper ArrowMoves to the inner level of view like month to year and year to decade.
Control + Down ArrowCommand + Down ArrowMoves out from the depth level view like decade to year and year to month.
Control + HomeCommand + Fn + ←Focuses the first date of the current year.
Control + EndCommand + Fn + →Focuses the last date of the current year.