|
| 1 | +Calendar component |
| 2 | +[(code example)](https://github.com/wix/react-native-calendars/blob/master/example/src/screens/calendars.tsx) |
| 3 | +:::info |
| 4 | +This component extends **[CalendarHeader, BasicDay](https://github.com/wix/react-native-calendars/blob/master/src/calendar/header/index.tsx,https://github.com/wix/react-native-calendars/blob/master/src/calendar/day/basic/index.tsx)** props. |
| 5 | +::: |
| 6 | + |
| 7 | +<div style={{display: 'flex', flexDirection: 'row', overflowX: 'auto', maxHeight: '500px', alignItems: 'center'}}><img style={{maxHeight: '420px'}} src={'https://github.com/wix/react-native-calendars/blob/master/demo/assets/calendar.gif?raw=true'}/> |
| 8 | + |
| 9 | +</div> |
| 10 | + |
| 11 | +## API |
| 12 | + |
| 13 | +### theme |
| 14 | + |
| 15 | +Specify theme properties to override specific styles for calendar parts |
| 16 | +<span style={{color: 'grey'}}>Theme</span> |
| 17 | + |
| 18 | +### style |
| 19 | + |
| 20 | +Specify style for calendar container element |
| 21 | +<span style={{color: 'grey'}}>ViewStyle</span> |
| 22 | + |
| 23 | +### headerStyle |
| 24 | + |
| 25 | +Specify style for calendar header |
| 26 | +<span style={{color: 'grey'}}>ViewStyle</span> |
| 27 | + |
| 28 | +### customHeader |
| 29 | + |
| 30 | +Allow rendering a totally custom header |
| 31 | +<span style={{color: 'grey'}}>any</span> |
| 32 | + |
| 33 | +### initialDate |
| 34 | + |
| 35 | +Initially visible month |
| 36 | +<span style={{color: 'grey'}}>string</span> |
| 37 | + |
| 38 | +### minDate |
| 39 | + |
| 40 | +Minimum date that can be selected, dates before minDate will be grayed out |
| 41 | +<span style={{color: 'grey'}}>string</span> |
| 42 | + |
| 43 | +### maxDate |
| 44 | + |
| 45 | +Maximum date that can be selected, dates after maxDate will be grayed out |
| 46 | +<span style={{color: 'grey'}}>string</span> |
| 47 | + |
| 48 | +### firstDay |
| 49 | + |
| 50 | +If firstDay=1 week starts from Monday. Note that dayNames and dayNamesShort should still start from Sunday |
| 51 | +<span style={{color: 'grey'}}>number</span> |
| 52 | + |
| 53 | +### markedDates |
| 54 | + |
| 55 | +Collection of dates that have to be marked |
| 56 | +<span style={{color: 'grey'}}>MarkedDatesType</span> |
| 57 | + |
| 58 | +### displayLoadingIndicator |
| 59 | + |
| 60 | +Whether to display loading indicator |
| 61 | +<span style={{color: 'grey'}}>boolean</span> |
| 62 | + |
| 63 | +### showWeekNumbers |
| 64 | + |
| 65 | +Whether to show weeks numbers |
| 66 | +<span style={{color: 'grey'}}>boolean</span> |
| 67 | + |
| 68 | +### hideExtraDays |
| 69 | + |
| 70 | +Whether to hide days of other months in the month page |
| 71 | +<span style={{color: 'grey'}}>boolean</span> |
| 72 | + |
| 73 | +### showSixWeeks |
| 74 | + |
| 75 | +Whether to always show six weeks on each month (when hideExtraDays = false) |
| 76 | +<span style={{color: 'grey'}}>boolean</span> |
| 77 | + |
| 78 | +### disableMonthChange |
| 79 | + |
| 80 | +Whether to disable changing month when click on days of other months (when hideExtraDays is false) |
| 81 | +<span style={{color: 'grey'}}>boolean</span> |
| 82 | + |
| 83 | +### enableSwipeMonths |
| 84 | + |
| 85 | +Whether to enable the option to swipe between months |
| 86 | +<span style={{color: 'grey'}}>boolean</span> |
| 87 | + |
| 88 | +### disabledByDefault |
| 89 | + |
| 90 | +Whether to disable days by default |
| 91 | +<span style={{color: 'grey'}}>boolean</span> |
| 92 | + |
| 93 | +### allowSelectionOutOfRange |
| 94 | + |
| 95 | +Whether to allow selection of dates before minDate or after maxDate |
| 96 | +<span style={{color: 'grey'}}>boolean</span> |
| 97 | + |
| 98 | +### onDayPress |
| 99 | + |
| 100 | +Handler which gets executed on day press |
| 101 | +<span style={{color: 'grey'}}>(date: DateData) => void</span> |
| 102 | + |
| 103 | +### onDayLongPress |
| 104 | + |
| 105 | +Handler which gets executed on day long press |
| 106 | +<span style={{color: 'grey'}}>(date: DateData) => void</span> |
| 107 | + |
| 108 | +### onMonthChange |
| 109 | + |
| 110 | +Handler which gets executed when month changes in calendar |
| 111 | +<span style={{color: 'grey'}}>(date: DateData) => void</span> |
| 112 | + |
| 113 | +### onVisibleMonthsChange |
| 114 | + |
| 115 | +Handler which gets executed when visible month changes in calendar |
| 116 | +<span style={{color: 'grey'}}>(months: DateData[]) => void</span> |
| 117 | + |
| 118 | +### monthFormat |
| 119 | + |
| 120 | +Month format for the header's title. Formatting values: http://arshaw.com/xdate/#Formatting |
| 121 | +<span style={{color: 'grey'}}>string</span> |
| 122 | + |
| 123 | +### hideDayNames |
| 124 | + |
| 125 | +Whether to hide the days names |
| 126 | +<span style={{color: 'grey'}}>boolean</span> |
| 127 | + |
| 128 | +### hideArrows |
| 129 | + |
| 130 | +Whether to hide the arrows |
| 131 | +<span style={{color: 'grey'}}>boolean</span> |
| 132 | + |
| 133 | +### disableArrowLeft |
| 134 | + |
| 135 | +Whether to disable the left arrow |
| 136 | +<span style={{color: 'grey'}}>boolean</span> |
| 137 | + |
| 138 | +### disableArrowRight |
| 139 | + |
| 140 | +Whether to disable the right arrow |
| 141 | +<span style={{color: 'grey'}}>boolean</span> |
| 142 | + |
| 143 | +### renderArrow |
| 144 | + |
| 145 | +Replace default arrows with custom ones (direction: 'left' | 'right') |
| 146 | +<span style={{color: 'grey'}}>(direction: Direction) => ReactNode</span> |
| 147 | + |
| 148 | +### onPressArrowLeft |
| 149 | + |
| 150 | +Handler which gets executed when press left arrow. It receive a callback to go to the previous month |
| 151 | +<span style={{color: 'grey'}}>(method: () => void, month?: string) => void</span> |
| 152 | + |
| 153 | +### onPressArrowRight |
| 154 | + |
| 155 | +Handler which gets executed when press right arrow. It receive a callback to go to the next month |
| 156 | +<span style={{color: 'grey'}}>(method: () => void, month?: string) => void</span> |
| 157 | + |
| 158 | +### disabledDaysIndexes |
| 159 | + |
| 160 | +Whether to apply custom disable color to selected day indexes |
| 161 | +<span style={{color: 'grey'}}>number[]</span> |
| 162 | + |
| 163 | +### renderHeader |
| 164 | + |
| 165 | +Replace default title with custom one |
| 166 | +<span style={{color: 'grey'}}>(date?: string) => ReactNode</span> |
| 167 | + |
| 168 | +### customHeaderTitle |
| 169 | + |
| 170 | +Replace default title with custom element |
| 171 | +<span style={{color: 'grey'}}>JSX.Element</span> |
| 172 | + |
| 173 | +### dayComponent |
| 174 | + |
| 175 | +Replace default day with custom day rendering component |
| 176 | +<span style={{color: 'grey'}}>JSX.Element</span> |
| 177 | + |
| 178 | +### disableAllTouchEventsForDisabledDays |
| 179 | + |
| 180 | +Whether to disable all touch events for disabled days (can be override with 'disableTouchEvent' in 'markedDates') |
| 181 | +<span style={{color: 'grey'}}>boolean</span> |
| 182 | + |
| 183 | +### disableAllTouchEventsForInactiveDays |
| 184 | + |
| 185 | +Whether to disable all touch events for inactive days (can be override with 'disableTouchEvent' in 'markedDates') |
| 186 | +<span style={{color: 'grey'}}>boolean</span> |
0 commit comments