DateRangePickerDay API
API reference docs for the React DateRangePickerDay component. Learn about the props, CSS, and other APIs of this exported module.
Demos
Import
import { DateRangePickerDay } from '@mui/x-date-pickers-pro/DateRangePickerDay';
// or
import { DateRangePickerDay } from '@mui/x-date-pickers-pro';Learn about the difference by reading this guide on minimizing bundle size.
Props of the native component are also available.
| Name | Type | Default | Description |
|---|---|---|---|
| day* | object | - | The date to show. |
| onDaySelect* | func | - | Callback fired when the day is selected. Signature: function(day: PickerValidDate) => void
|
| action | func | { current?: { focusVisible: func } } | - | A ref for imperative actions. It currently only supports |
| centerRipple | bool | false | If |
| classes | object | - | Override or extend the styles applied to the component. See CSS classes API below for more details. |
| disabled | bool | false | If |
| disableHighlightToday | bool | false | If |
| disableRipple | bool | false | If |
| disableTouchRipple | bool | false | If |
| draggable | bool | false | If |
| focusRipple | bool | false | If |
| focusVisibleClassName | string | - | This prop can help identify which element has keyboard focus. The class name will be applied when the element gains the focus through keyboard interaction. It's a polyfill for the CSS :focus-visible selector. The rationale for using this feature is explained here. A polyfill can be used to apply a |
| isAnimating | bool | false | If |
| isDayFillerCell | bool | false | If |
| isEndOfHighlighting | bool | - | Set to |
| isEndOfPreviewing | bool | - | Set to |
| isFirstVisibleCell | bool | false | If |
| isHighlighting | bool | - | Set to |
| isLastVisibleCell | bool | false | If |
| isPreviewing | bool | - | Set to |
| isStartOfHighlighting | bool | - | Set to |
| isStartOfPreviewing | bool | - | Set to |
| isVisuallySelected | bool | - | Indicates if the day should be visually selected. |
| nativeButton | bool | - | Whether the custom component is expected to render a native |
| onBlur | func | () => {} | Callback fired when the component is blurred. Signature: function(event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void
|
| onClick | func | () => {} | Callback fired when the component is clicked. Signature: function(event: MuiEvent<React.MouseEvent<HTMLButtonElement>>) => void
|
| onFocus | func | () => {} | Callback fired when the component is focused. Signature: function(event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void
|
| onFocusVisible | func | - | Callback fired when the component is focused with a keyboard. We trigger a |
| onKeyDown | func | () => {} | Callback fired when a key is pressed. Signature: function(event: React.KeyboardEvent<HTMLButtonElement>, day: PickerValidDate) => void
|
| onMouseDown | func | () => {} | Callback fired when the mouse button is pressed. Signature: function(event: React.MouseEvent<HTMLButtonElement>) => void
|
| onMouseEnter | func | () => {} | Callback fired when the mouse enters the component. Signature: function(event: React.MouseEvent<HTMLButtonElement>, day: PickerValidDate) => void
|
| outsideCurrentMonth | bool | false | If |
| selected | bool | false | If |
| showDaysOutsideCurrentMonth | bool | false | If |
| sx | Array<func | object | bool> | func | object | - | The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details. |
| today | bool | false | If |
| TouchRippleProps | object | - | Props applied to the |
| touchRippleRef | func | { current?: { pulsate: func, start: func, stop: func } } | - | A ref that points to the |
ref is forwarded to the root element.Theme default props
You can use MuiDateRangePickerDay to change the default props of this component with the theme.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
| Class name | Rule name | Description |
|---|---|---|
| .Mui-disabled | State class applied to the root element if isDayDisabled=true. | |
| .Mui-selected | State class applied to the root element if isDaySelected=true. | |
| .MuiDateRangePickerDay-dayOutsideMonth | dayOutsideMonth | Styles applied to the root element if isDayOutsideMonth=true and showDaysOutsideCurrentMonth=true. |
| .MuiDateRangePickerDay-draggable | draggable | Styles applied to the root element if isDayDraggable=true. |
| .MuiDateRangePickerDay-endOfMonth | endOfMonth | Styles applied to the root element if isDayEndOfMonth=true. |
| .MuiDateRangePickerDay-endOfWeek | endOfWeek | Styles applied to the root element if isDayEndOfWeek=true. |
| .MuiDateRangePickerDay-fillerCell | fillerCell | Styles applied to the root element if isDayOutsideMonth=true and showDaysOutsideCurrentMonth=false. |
| .MuiDateRangePickerDay-firstVisibleCell | firstVisibleCell | Styles applied to the root element if isDayFirstVisibleCell=true. |
| .MuiDateRangePickerDay-insidePreviewing | insidePreviewing | Styles applied to the root element if isDayInsidePreview=true. |
| .MuiDateRangePickerDay-insideSelection | insideSelection | Styles applied to the root element if isDayInsideSelection=true. |
| .MuiDateRangePickerDay-lastVisibleCell | lastVisibleCell | Styles applied to the root element if isDayLastVisibleCell=true. |
| .MuiDateRangePickerDay-previewed | previewed | Styles applied to the root element if isDayPreviewed=true. |
| .MuiDateRangePickerDay-previewEnd | previewEnd | Styles applied to the root element if isDayPreviewEnd=true. |
| .MuiDateRangePickerDay-previewStart | previewStart | Styles applied to the root element if isDayPreviewStart=true. |
| .MuiDateRangePickerDay-root | root | Styles applied to the root element. |
| .MuiDateRangePickerDay-selectionEnd | selectionEnd | Styles applied to the root element if isDaySelectionEnd=true. |
| .MuiDateRangePickerDay-selectionStart | selectionStart | Styles applied to the root element if isDaySelectionStart=true. |
| .MuiDateRangePickerDay-startOfMonth | startOfMonth | Styles applied to the root element if isDayStartOfMonth=true. |
| .MuiDateRangePickerDay-startOfWeek | startOfWeek | Styles applied to the root element if isDayStartOfWeek=true. |
| .MuiDateRangePickerDay-today | today | Styles applied to the root element if disableHighlightToday=false and isDayCurrent=true. |
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverridesproperty in a custom theme.
Source code
If you did not find the information in this page, consider having a look at the implementation of the component for more detail.