DateRangePickerDay API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import { DateRangePickerDay } from '@mui/x-date-pickers-pro/DateRangePickerDay';
// or
import { DateRangePickerDay } from '@mui/x-date-pickers-pro';
Component name
The nameMuiDateRangePickerDay
can be used when providing default props or style overrides in the theme.Props
Name | Type | Default | Description |
---|---|---|---|
day* | any | The date to show. | |
isEndOfHighlighting* | bool | false | Set to true if the day is the end of a highlighted date range. |
isEndOfPreviewing* | bool | false | Set to true if the day is the start of a previewing date range. |
isHighlighting* | bool | false | Set to true if the day is in a highlighted date range. |
isPreviewing* | bool | false | Set to true if the day is in a preview date range. |
isStartOfHighlighting* | bool | false | Set to true if the day is the start of a highlighted date range. |
isStartOfPreviewing* | bool | false | Set to true if the day is the end of a previewing date range. |
outsideCurrentMonth* | bool | false | If true , day is outside of month and will be hidden. |
action | func | { current?: { focusVisible: func } } | A ref for imperative actions. It currently only supports focusVisible() action. | |
centerRipple | bool | false | If true , the ripples are centered. They won't start at the cursor interaction position. |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
disabled | bool | false | If true , renders as disabled. |
disableHighlightToday | bool | false | If true , today's date is rendering without highlighting with circle. |
disableMargin | bool | false | If true , days are rendering without margin. Useful for displaying linked range of days. |
disableRipple | bool | false | If true , the ripple effect is disabled.⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure to highlight the element by applying separate styles with the .Mui-focusVisible class. |
disableTouchRipple | bool | false | If true , the touch ripple effect is disabled. |
focusRipple | bool | false | If true , the base button will have a keyboard focus ripple. |
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 focus-visible class to other components if needed. | |
isVisuallySelected | bool | false | Indicates if the day should be visually selected. |
onFocusVisible | func | Callback fired when the component is focused with a keyboard. We trigger a onFocus callback too. | |
selected | bool | false | If true , renders as selected. |
showDaysOutsideCurrentMonth | bool | false | If true , days outside the current month are rendered:- if fixedWeekNumber is defined, renders days to have the weeks requested.- if fixedWeekNumber is not defined, renders day to fill the first and last week of the current month.- ignored if calendars equals more than 1 on range pickers. |
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 true , renders as today date. |
TouchRippleProps | object | Props applied to the TouchRipple element. | |
touchRippleRef | func | { current?: { pulsate: func, start: func, stop: func } } | A ref that points to the TouchRipple element. |
The
ref
is forwarded to the root element.CSS
Rule name | Global class | Description |
---|---|---|
root | .MuiDateRangePickerDay-root | Styles applied to the root element. |
rangeIntervalDayHighlight | .MuiDateRangePickerDay-rangeIntervalDayHighlight | Styles applied to the root element if isHighlighting=true and outsideCurrentMonth=false . |
rangeIntervalDayHighlightStart | .MuiDateRangePickerDay-rangeIntervalDayHighlightStart | Styles applied to the root element if isStartOfHighlighting=true . |
rangeIntervalDayHighlightEnd | .MuiDateRangePickerDay-rangeIntervalDayHighlightEnd | Styles applied to the root element if isEndOfHighlighting=true . |
rangeIntervalPreview | .MuiDateRangePickerDay-rangeIntervalPreview | Styles applied to the preview element. |
rangeIntervalDayPreview | .MuiDateRangePickerDay-rangeIntervalDayPreview | Styles applied to the root element if isPreviewing=true and outsideCurrentMonth=false . |
rangeIntervalDayPreviewStart | .MuiDateRangePickerDay-rangeIntervalDayPreviewStart | Styles applied to the root element if isStartOfPreviewing=true or day is the start of the month. |
rangeIntervalDayPreviewEnd | .MuiDateRangePickerDay-rangeIntervalDayPreviewEnd | Styles applied to the root element if isEndOfPreviewing=true or day is the end of the month. |
day | .MuiDateRangePickerDay-day | Styles applied to the day element. |
dayOutsideRangeInterval | .MuiDateRangePickerDay-dayOutsideRangeInterval | Styles applied to the day element if isHighlighting=false . |
dayInsideRangeInterval | .MuiDateRangePickerDay-dayInsideRangeInterval | Styles applied to the day element if selected=false and isHighlighting=true . |
notSelectedDate | .MuiDateRangePickerDay-notSelectedDate | Styles applied to the day element if selected=false . |
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
styleOverrides
property in a custom theme.