Getting StartedStateThemingCompositionDate FrameworksLocalizationAnimatedGroupAnimatedMonthGroupCalendarCalendarProviderClickOutsideExamplePropsDayDayOfWeekHeaderHomeMonthMonthGroupPopperRootWeekWeekHeaderuseCalendarDispatchuseCalendarPropsuseCalendarStateuseDateAPIuseDateInputuseDateRangeInput
Components
Hooks
ClickOutside
The ClickOutside component is used to detect when the mouse is clicked outside the calendar.
In the default implementation ClickOutside is used to determine when to close the Calendar when rendered inside a Popper.
Clicks within the Calender or on the associated inputs should not close the Calendar but everywhere else should.
Example
In this example when you click the buttons they log whether or not it considers it a click outside the rendered tree.
In addition an ignored list of refs can be provided which, when clicked, will not invoke onClickOutside.
Props
| Prop Name | Type | Is Required | Default Value | Description |
|---|---|---|---|---|
| children | node | optional | children to monitor for click outside events | |
| ignoreClickOutsideRefs | array | optional | Additional array of refs, will ignore click outside from | |
| onClickOutside | func | optional | Callback called when the mouse is clicked outside |