Calendar API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
Calendar52 props7 callbacks0 methods
Props52
| Name | Type | Description |
|---|---|---|
monthRequired |
| Month currently displayed, expressed as a library ISO date string. |
focusedDateRequired |
| ISO date of the day that currently has keyboard focus. |
referenceDateOptional |
| Reference ISO date used for Today and relative calendar presentation. |
selectionOptional |
| Current selected date/range, or the selection mode where the declared type is a mode string. |
previewOptional |
| Date range currently previewed while the user chooses a selection. |
previewInvalidOptional | boolean | undefined | Marks the current preview as unavailable without changing selection. |
previewDescriptionOptional | string | undefined | Localized explanation, announced politely and linked to invalid preview days. |
selectedDatesOptional |
| Independent selected dates for a multiple-selection composition. |
calendarSystemOptional |
| Calendar system used for display; stored values retain the ISO date representation. |
dirOptional | "rtl" | "ltr" | undefined | Text direction used by the calendar layout. |
numberOfMonthsOptional | number | undefined | Number of months displayed simultaneously. |
pagedNavigationOptional | boolean | undefined | Moves by the number of visible months instead of by a single month. |
reverseMonthsOptional | boolean | undefined | Displays simultaneous months in reverse order. |
captionLayoutOptional | "label" | "dropdown" | "dropdown-months" | "dropdown-years" | undefined | Chooses a text caption or month/year selection dropdowns. |
startMonthOptional |
| Navigation bounds; unlike minDate/maxDate these do not disable day values. |
endMonthOptional |
| Latest month available through navigation; this does not disable individual date values. |
disableNavigationOptional | boolean | undefined | Disables navigation between calendar months or years. |
showWeekNumberOptional | boolean | undefined | Displays the week-number column. |
weekNumberingOptional | "iso" | "local" | undefined | Uses ISO week numbers or locale-based week numbering. |
formatWeekNumberOptional |
| Formats a numeric week number for display. |
footerOptional |
| Content rendered in the footer or after the main component content. |
presetsOptional |
| Predefined labeled date selections offered as quick actions. |
cellSizeOptional | number | undefined | Size of calendar day cells in pixels. |
referenceInstantOptional |
| Optional instant used only to resolve Today in the requested zone. ISO date values never shift. |
timeZoneOptional | string | undefined | Time zone used for resolving Today; ISO date values themselves do not shift zones. |
localeOptional | string | undefined | Locale identifier or localized label configuration used for formatting and accessible text. |
weekStartsOnOptional |
| First weekday of the week, from 0 (Sunday) through 6 (Saturday). |
minDateOptional |
| Earliest selectable calendar date in the library ISO date representation. |
maxDateOptional |
| Latest selectable calendar date in the library ISO date representation. |
isDateDisabledOptional |
| Return true to prevent selection of the supplied ISO date. |
showOutsideDaysOptional | boolean | undefined | Renders dates belonging to adjacent months in the current month grid. |
allowOutsideMonthSelectionOptional | boolean | undefined | Allows selecting visible dates from adjacent months. |
fixedWeeksOptional | boolean | undefined | Keeps a fixed six-week layout for every month. |
showTodayButtonOptional | boolean | undefined | Shows the action for selecting or navigating to Today. |
showHeaderOptional | boolean | undefined | Hides the complete month/year heading and navigation row. |
showNavigationOptional | boolean | undefined | Convenience switch for both previous and next actions. |
showPreviousButtonOptional | boolean | undefined | Shows the previous-period navigation action. |
showNextButtonOptional | boolean | undefined | Shows the next-period navigation action. |
showMonthLabelOptional | boolean | undefined | Displays the current month caption. |
showWeekdaysOptional | boolean | undefined | Displays weekday column labels. |
enableYearViewOptional | boolean | undefined | Allows the month/year heading to open a twelve-month overview. Defaults to true. |
viewsOptional |
| Available views. Defaults to month and year; supersedes `enableYearView`. |
defaultViewOptional |
| Initial calendar view, month or year. |
isMonthDisabledOptional |
| Return true to prevent selection of the supplied month. |
translationsOptional |
| Overrides any subset of the exported English calendar translations. |
classNameOptional | string | undefined | Additional CSS classes applied to the component root. |
dayClassNameOptional |
| Additional day-cell classes, optionally computed from the date and day state. |
renderDayOptional |
| Custom content renderer for a day, receiving its ISO date and selected/disabled/preview state. |
formatMonthOptional |
| Formats the month caption for the supplied locale. |
formatWeekdayOptional |
| Formats the weekday column label for the supplied date and locale. |
formatDayLabelOptional |
| Formats the accessible name for a calendar day. |
validateSelectionOptional |
| Validates a proposed selection. Return false or an explanatory string to reject it. |
Events and callbacks7
| Name | Type | Description |
|---|---|---|
onMonthChangeRequired |
| Receives the newly requested visible month; update month in controlled compositions. |
onFocusedDateChangeRequired |
| Receives the ISO date to which calendar keyboard focus moved. |
onSelectRequired |
| Called when the user selects an item. The signature identifies the selected value and any additional context. |
onPresetSelectOptional |
| Optional non-toggle handler for Today and date presets. |
onPreviewDateChangeOptional |
| Receives the date currently being previewed, or undefined when the preview clears. |
onInvalidSelectionOptional |
| Receives the rejection reason and the attempted date when selection validation fails. |
onViewChangeOptional |
| Receives the newly selected calendar view. |
Methods0
No component-specific imperative methods. Use props and callbacks to control this component.