Calendar

Calendar

August 2024

28293031123
45678910
11121314151617
18192021222324
25262728293031

A calendar consists of a grouping element containing one or more date grids (e.g. months), and a previous and next button for navigating between date ranges. Each calendar grid consists of cells containing button elements that can be pressed and navigated to using the arrow keys to select a date.

API Reference

PropertyTypeDescriptionDefault
valueDateValue | nullThe current value (controlled).-
defaultValueDateValue | nullThe default value (uncontrolled).-
minValueDateValueThe minimum allowed date that a user may select.new CalendarDate(1900, 1, 1)
maxValueDateValueThe maximum allowed date that a user may select.new CalendarDate(2099, 12, 31)
visibleMonthsnumberThe number of months to display at once. Up to 3 months are supported.1
focusedValueDateValueControls the currently focused date within the calendar.-
defaultFocusedValueDateValueThe date that is focused when the calendar first mounts (uncountrolled).-
weekdayStylenarrow |short | long | undefinedThe style of weekday names to display in the calendar grid header, e.g. single letter, abbreviation, or full day name.short
withPickerbooleanChange the month label to picker for interactivefalse
pickerHeightnumberThe calendar height when the calendar picker is open. Prefer choose minimum height when the calendar picker is not open278
pickerEmptyItemnumberNumber of empty item to display in the month picker to force list scrollable3
pickerOpenbooleanOpen the calendar picker.-
defaultPickerOpenbooleanOpen the calendar picker for default - (uncountrolled).-
onPickerOpenChange(open: boolean) => void;Trigger when pickerOpen State Change-
isDisabledbooleanWhether the calendar is disabled.false
isReadOnlybooleanWhether the calendar value is immutable.false
isInvalidbooleanWhether the current selection is invalid according to application logic.false
headerLayoutapart | left | rightThe layout of the headerapart
headerReactNodeElement to be rendered in the top of the calendar-
footerReactNodeElement to be rendered in the bottom side of the calendar-
classNamesCalendarClassNamesClassName for each components in the calendar-
stylesCalendarStylesStyles for each components in the calendar-

Usage

To use the Calendar component, import it from the library and include it in your JSX code:

import { Calendar } from 'react-calendar-kit';
 
<Calendar />;