React Calendar Component API

Calendar API

Rocket
New Year sale. Skyrocket your business in 2025!
Extra 25% off for all sale items + Free CoreUI Icons PRO with every order!
Limited-time offer for the first 100 customers in 2025. Use code 2025SKY25 at checkout.

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

On this page

CCalendar#

import { CCalendar } from '@coreui/react-pro'
// or
import CCalendar from '@coreui/react-pro/src/components/calendar/CCalendar'
PropertyDefaultType
ariaNavNextMonthLabel#5.5.0+Next monthstring

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#5.5.0+Next yearstring

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.

ariaNavPrevMonthLabel#5.5.0+Previous monthstring

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#5.5.0+Previous yearstring

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.

calendarDate#startDate || endDate || nullstring, Date

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#1number

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#4.3.0+numeric'numeric', '2-digit', ((date: Date) => string | number)

Sets the format for day names. 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.

endDate#-string, Date

Defines the initially selected ending date (applicable when using range selection). Accepts both Date objects and valid date strings.

firstDayOfWeek#1number

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#defaultstring

Indicates the locale for the React Calendar component. If not explicitly provided, it inherits the locale settings from the browser.

maxDate#-string, Date

The maximum date that can be selected. Any date beyond this value will be disabled within the calendar. This is often used to restrict future selections.

minDate#-string, Date

The minimum date that can be selected. Any date before this value will be disabled in the calendar. Useful for preventing selection of past dates or creating limited booking windows.

navigation#trueboolean

Toggles display of arrow-based navigation (previous/next controls) in the React Calendar component. If set to false, you can build custom navigation or handle the navigation programmatically.

navNextDoubleIcon#-ReactNode

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.

navNextIcon#-ReactNode

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.

navPrevDoubleIcon#-ReactNode

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.

navPrevIcon#-ReactNode

Customizes the icon for navigating to the previous view in the calendar. Accepts any valid ReactNode to provide flexible styling or theming.

navYearFirst#4.3.0+falseboolean

Reorders the year and month navigation, rendering the year selector first. This offers a different layout for users, particularly useful if you want to prioritize quick year changes.

onCalendarDateChange#-(date: string | Date) => 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.

onDateHover#-(date: string | Date) => void

Callback fired when the user hovers over a calendar cell. The argument is the date of the cell that the user is currently hovering.

onEndDateChange#-(date: string | Date, formatedDate?: string) => void

Callback triggered when the end date of the selection changes. Handy for synchronizing the selected date range with external states or components.

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: string | Date, formatedDate?: string) => 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.

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.

selectAdjacementDays#4.11.0+falseboolean

Sets whether days from adjacent months (shown at the start/end of the current view) are selectable. This only applies if showAdjacementDays is set to true.

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#5.0.0+daySelectionTypes

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
  • year: Select an entire year
showAdjacementDays#4.11.0+trueboolean

Controls whether the calendar should display dates from previous or next months (non-selectable if selectAdjacementDays is false). This can make the calendar visually continuous.

showWeekNumber#5.0.0+falseboolean

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

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#2number, 'long', 'narrow', 'short', ((date: Date) => string | number)

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#5.0.0+-string

Defines the label that appears above the week numbers column. For example, you might label it 'WK' or 'Week #'.