Basic usage
Props
The Calendar component extends both CalendarHeader and Day component props.Date configuration
Initially visible month in YYYY-MM-DD format. This prop is being deprecated - use
initialDate instead.Initially visible month in YYYY-MM-DD format. If changed, will reinitialize the calendar to this value.
Minimum date that can be selected in YYYY-MM-DD format. Dates before minDate will be grayed out.
Maximum date that can be selected in YYYY-MM-DD format. Dates after maxDate will be grayed out.
Allow selection of dates before minDate or after maxDate. Default is
false.Marking and styling
Collection of dates that have to be marked. Object with date strings as keys and marking objects as values.
Specify theme properties to override specific styles for calendar parts.
Specify style for calendar container element.
Style passed to the header.
Display options
Do not show days of other months in month page. Default is
false.Always show six weeks on each month (only when hideExtraDays = false). Default is
false.If
0, week starts from Sunday. If 1, week starts from Monday. Default is 0.Show week numbers on the left side of the calendar. Default is
false.Hide day names (Mon, Tue, etc.) at the top of the calendar. Default is
false.Display loading indicator when calendar data is being loaded. Default is
false.Event handlers
Handler which gets executed on day press.
Handler which gets executed on day long press.
Handler which gets executed when month changes in calendar.
Handler which gets executed when visible month changes in calendar.
Navigation
Disables changing month when clicking on days of other months (when hideExtraDays = false). Default is
false.Enable the option to swipe between months. Default is
false.Hide month navigation arrows. Default is
false.Disable left arrow. Default is
false.Disable right arrow. Default is
false.Replace default arrows with custom ones.
Handler which gets executed when press arrow icon left. It receives a callback to go back a month.
Handler which gets executed when press arrow icon right. It receives a callback to go forward a month.
Customization
Allow rendering a totally custom header.
Provide custom day rendering component.
Month format in the header. Default is
'MMMM yyyy'. Formatting values: http://arshaw.com/xdate/#FormattingDisabled dates
Disable all days by default. Default is
false.Disable specific days of the week (0 = Sunday, 6 = Saturday).
Apply custom disable color to selected day name indexes.
Accessibility
Whether the accessibility elements contained within this accessibility element are hidden (iOS only).
Controls if a view fires accessibility events and if it is reported to accessibility services (Android only).
Test identifier for automated testing.
Examples
Basic calendar with marked dates
Calendar with custom theme
Calendar with date range selection
Related components
- CalendarList - Horizontal or vertical scrollable calendar
- Agenda - Calendar with agenda/reservation list