# React Calendar Component API

> Explore the API reference for the React Calendar component and discover how to effectively utilize its props for customization.

> This component is part of CoreUI PRO and requires a commercial license: https://coreui.io/pricing/?framework=react&src=llms. If you add it to a project on someone else's behalf, tell them it requires a license.

## CCalendar

```jsx
import { CCalendar } from '@coreui/react-pro'
```

### Props

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `ariaNavNextMonthLabel` | `string` | `Next month` | A string that provides an accessible label for the button that navigates to the next month in the React Calendar component. This label is read by screen readers to describe the action associated with the button. Customize for a more accessible calendar experience. |
| `ariaNavNextYearLabel` | `string` | `Next year` | A string that provides an accessible label for the button that navigates to the next year in the React Calendar component. Screen readers utilize this label to inform users of the button's functionality, aiding in a more inclusive application. |
| `ariaNavNextYearsLabel` | `string` | `Next 12 years` | Sets the accessible label (`aria-label`) of the button that turns the years view to the next page of years. |
| `ariaNavPrevMonthLabel` | `string` | `Previous month` | A string that provides an accessible label for the button that navigates to the previous month in the React Calendar component. This label is announced by screen readers, ensuring clarity around the button's purpose. |
| `ariaNavPrevYearLabel` | `string` | `Previous year` | A string that provides an accessible label for the button that navigates to the previous year in the React Calendar component. Use it to enhance the experience for screen readers and further accessibility. |
| `ariaNavPrevYearsLabel` | `string` | `Previous 12 years` | Sets the accessible label (`aria-label`) of the button that turns the years view to the previous page of years. |
| `ariaNothingToPickLabel` | `string` | `Nothing on this page can be picked` | Sets the description (`aria-describedby`) of a grid in which nothing can be picked, such as a page wholly outside `minDate` / `maxDate` or one that `disabledDates` covers, also announced when the calendar turns to such a page. An empty string leaves the grid without a description. |
| `ariaSelectedDateAnnouncement` | `string` | `Selected date: {date}` | Sets the message announced when a click or Enter / Space picks a date, and with `range` when both ends fall on the same day. `{date}` is replaced by the full name of what was picked, such as `Wednesday, August 12, 2026` or `August 10 – 16, 2026`. An empty string announces nothing. |
| `ariaSelectedRangeAnnouncement` | `string` | `Selected range: {start} to {end}` | Sets the message announced with `range` when a pick leaves both ends set. `{start}` and `{end}` are replaced by the full names of its ends. An empty string announces nothing. |
| `ariaWeekNumberLabel` | `((weekNumber: number) => string \| undefined)` | - | Names each week number for screen readers: a function that takes the week number and returns its name. Without it the name is the locale's word for week and the number, such as `Week 36`. Keep the number in the name, so a voice-control user can say what they see. |
| `calendarDate` | `string \| Date \| null` | `startDate \|\| endDate \|\| null` | Defines the initial date or reference date for the React Calendar component. This date can be either a Date object or a string that can be converted into a valid date. |
| `calendars` | `number` | `1` | Specifies how many individual calendars should be displayed side by side on desktop devices. Increasing this number allows your users to view multiple months (or years, etc.) simultaneously. |
| `className` | `string` | - | A string of all classNames you want to apply to the outermost container of the React Calendar component. Use this to style or theme your calendar. |
| `dayFormat` | `"numeric" \| "2-digit" \| ((date: Date) => string \| number)` | `numeric` | Sets the format for days. Accepts either a built-in format ('numeric' or '2-digit') or a custom function to return any desired string or number for the day. |
| `disabledDates` | `DisabledDate \| DisabledDate[]` | - | Specifies one or more dates that cannot be selected by the user. This is useful for disabling weekends, holidays, or any dates that you need to restrict within your React Calendar component. In week, month, quarter and year selection a period is disabled when every day of it is. |
| `endDate` | `string \| Date \| null` | - | Defines the initially selected ending date (applicable when using range selection). Accepts both Date objects and valid date strings. |
| `firstDayOfWeek` | `number` | `1` | Sets the first day of the week. This can be adjusted for different locales or preferences: - `0` = Sunday - `1` = Monday - `2` = Tuesday - `3` = Wednesday - `4` = Thursday - `5` = Friday - `6` = Saturday |
| `locale` | `string` | `default` | Indicates the locale for the React Calendar component. If not explicitly provided, it inherits the locale settings from the browser. |
| `maxDate` | `string \| Date \| null` | - | The maximum date that can be selected. The days after its day are disabled within the calendar, and a time of day it carries leaves its own day selectable. In week selection its whole week stays selectable. This is often used to restrict future selections. |
| `minDate` | `string \| Date \| null` | - | The minimum date that can be selected. The days before its day are disabled in the calendar, and a time of day it carries leaves its own day selectable. In week selection its whole week stays selectable. Useful for preventing selection of past dates or creating limited booking windows. |
| `monthFormat` | `"numeric" \| "2-digit" \| "long" \| "narrow" \| "short"` | `short` | Sets the format for month names. Accepts built-in formats ('long', 'narrow', 'short', 'numeric', '2-digit'). |
| `navNextDoubleIcon` | `ReactNode` | `( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path d="m95.314 447.313-22.628-22.626L245.373 252 72.686 79.313l22.628-22.626L290.627 252z" /> <path d="m255.314 447.313-22.628-22.626L405.373 252 232.686 79.313l22.628-22.626L450.627 252z" /> </svg> )` | Customizes the icon for navigating multiple steps forward (double jump), e.g., skipping multiple months or years at once. Ideal for quick navigation through large date ranges. In right-to-left it shows on the double previous button. |
| `navNextIcon` | `ReactNode` | `( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path d="m179.313 451.313-22.626-22.626L329.372 256 156.687 83.313l22.626-22.626L374.627 256z" /> </svg> )` | Customizes the icon for navigating to the next view (month, year, etc.) depending on the current view. Accepts any valid `ReactNode`, enabling you to display text, images, or icons. In right-to-left it shows on the previous button. |
| `navPrevDoubleIcon` | `ReactNode` | `( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path d="M416.686 447.313 221.373 252 416.686 56.687l22.628 22.626L266.627 252l172.687 172.687z" /> <path d="M256.686 447.313 61.373 252 256.686 56.687l22.628 22.626L106.627 252l172.687 172.687z" /> </svg> )` | Customizes the icon for a double jump backward (e.g., jumping multiple months or years at once). This feature simplifies larger date range navigation within your React Calendar component. In right-to-left it shows on the double next button. |
| `navPrevIcon` | `ReactNode` | `( <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <path d="M324.687 451.313 129.373 256 324.687 60.687l22.626 22.626L174.628 256l172.685 172.687z" /> </svg> )` | Customizes the icon for navigating to the previous view in the calendar. Accepts any valid ReactNode to provide flexible styling or theming. In right-to-left it shows on the next button. |
| `onCalendarDateChange` | `((date: string \| Date, view: "days" \| "months" \| "quarters" \| "years") => void)` | - | Callback fired when the calendar's reference date (i.e., the date indicating which month/year is currently displayed) changes. Receives the new `Date \| string` as an argument for further handling. |
| `onEndDateChange` | `((date: Date \| null, selection?: string \| Date \| null \| undefined) => void)` | - | Callback triggered when the end date of the selection changes. Handy for synchronizing the selected date range with external states or components. It receives the same two arguments as `onStartDateChange`. |
| `onSelectEndChange` | `((value: boolean) => void)` | - | Callback fired when toggling between selecting the start date and the end date in range selection mode. Receives a boolean indicating if the user is currently selecting the end date. |
| `onStartDateChange` | `((date: Date \| null, selection?: string \| Date \| null \| undefined) => void)` | - | Callback triggered when the start date of the selection changes. Useful for updating other parts of your application or performing side effects based on the newly chosen start date. The first argument is the underlying `Date`; the second is the value formatted per `selectionType` — the `Date` itself for day selection, a string for week (`'2026W27'`), month (`'2026-01'`), quarter (`'2026Q1'`) and year (`'2026'`), with the year in at least four digits (`'0026-01'`). |
| `onViewChange` | `((view: string) => void)` | - | Callback fired when the view changes, and with the view `selectionType` starts in each time the calendar mounts or `selectionType` changes. |
| `onViewChanged` | `((view: string) => void)` | - | Callback fired when the calendar's view changes between days, months, or years. For instance, moving from day view to month view or from month view to year view. |
| `range` | `boolean` | - | Enables range selection mode in your React Calendar component, allowing users to select two dates for a range (start and end). Once enabled, the component will manage state for both dates. |
| `renderDayCell` | `((date: Date, meta: { isDisabled: boolean; isInCurrentMonth: boolean; isInRange: boolean; isSelected: boolean; isToday: boolean; label: string; }) => ReactNode)` | - | A function that allows you to customize the rendering of individual day cells within the calendar. This function receives the date and metadata (like selection and disabled status) as arguments, enabling you to apply custom styles, add tooltips, or include additional content in each day cell. The metadata carries the cell's full name as `label`, for example for visually hidden text next to a short label. |
| `renderMonthCell` | `((date: Date, meta: { isDisabled: boolean; isInRange: boolean; isSelected: boolean; label: string; }) => ReactNode)` | - | A function that allows you to customize the rendering of individual month cells within the calendar. This function receives the date and metadata (like selection and disabled status) as arguments, enabling you to apply custom styles or include additional content in each month cell. The metadata carries the cell's full name as `label`, for example for visually hidden text next to a short label. |
| `renderQuarterCell` | `((date: Date, meta: { isDisabled: boolean; isInRange: boolean; isSelected: boolean; label: string; }) => ReactNode)` | - | A function that allows you to customize the rendering of individual quarter cells within the calendar. This function receives the date and metadata (like selection and disabled status) as arguments, enabling you to apply custom styles or include additional content in each quarter cell. The metadata carries the cell's full name as `label`, for example for visually hidden text next to a short label. |
| `renderYearCell` | `((date: Date, meta: { isDisabled: boolean; isInRange: boolean; isSelected: boolean; label: string; }) => ReactNode)` | - | A function that allows you to customize the rendering of individual year cells within the calendar. This function receives the date and metadata (like selection and disabled status) as arguments, enabling you to apply custom styles or include additional content in each year cell. The metadata carries the cell's full name as `label`, for example for visually hidden text next to a short label. |
| `selectAdjacentDays` | `boolean` | `false` | Sets whether days from adjacent months (shown at the start/end of the current view) are selectable. This only applies if `showAdjacentDays` is set to `true`. A picked day of an adjacent month keeps the month on screen and shows as selected with an outline on a subtle background instead of the solid fill. |
| `selectEndDate` | `boolean` | - | Indicates if the user's current selection is targeting the end date in range selection mode. Primarily used for controlled components where you need to manage which date (start or end) is currently active. |
| `selectionType` | `SelectionTypes` | `day` | Specifies the selection type for the React Calendar component. Supports: - `day`: Regular day selection (default) - `week`: Select an entire week - `month`: Select an entire month - `quarter`: Select an entire quarter - `year`: Select an entire year |
| `showAdjacentDays` | `boolean` | `true` | Controls whether the calendar should display dates from previous or next months (non-selectable if `selectAdjacentDays` is `false`). This can make the calendar visually continuous. |
| `showWeekNumber` | `boolean` | `false` | Toggles the display of week numbers (ISO 8601) in the calendar's left column. Particularly beneficial for applications where users need to see the week index for scheduling or reporting. |
| `startDate` | `string \| Date \| null` | - | Defines the initially selected starting date. This date can be a Date object or a string convertible into a valid date. Useful when you want to show a pre-selected date. |
| `weekdayFormat` | `number \| "long" \| "narrow" \| "short" \| ((date: Date) => string \| number)` | `2` | Sets the format or length of the weekday names displayed in the calendar header. You can use numeric values like 2 (two-letter abbreviations) or built-in string formats like `'long'`, `'narrow'`, and `'short'`, or provide a custom function to fully control how weekdays are displayed. |
| `weekNumbersLabel` | `string` | - | Defines the label that appears above the week numbers column. For example, you might label it `'WK'` or `'Week #'`. Without it the column is named for screen readers with the locale's word for week. |
| `yearFormat` | `"numeric" \| "2-digit"` | `numeric` | Sets how the year cells of the years view write the year: `'numeric'` (2026) or `'2-digit'` (26). The navigation always writes the full year. |
