Skip to contentSkip to content

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

Props of the native component are also available.

NameTypeDefaultDescription
day*{}-

The date to show.

onDaySelect*func-

Callback fired when the day is selected.

Signature:function(day: PickerValidDate) => void
  • day The day to select.
classesPartial-

Override or extend the styles applied to the component.

See CSS classes API below for more details.

disabledboolfalse

If true, the day is disabled.

disableHighlightTodayboolfalse

If true, today's day is not highlighted.

draggableboolfalse

If true, the day can be dragged to change the current date range.

isAnimatingboolfalse

If true, the day is being animated.

isDayFillerCellboolfalse

If true, the day is a filler day (its content is hidden).

isEndOfHighlightingbool-

Set to true if the day is the end of a highlighted date range.

isEndOfPreviewingbool-

Set to true if the day is the end of a previewing date range.

isFirstVisibleCellboolfalse

If true, the day is the first visible cell of the month.

isHighlightingbool-

Set to true if the day is in a highlighted date range.

isLastVisibleCellboolfalse

If true, the day is the last visible cell of the month.

isPreviewingbool-

Set to true if the day is in a preview date range.

isStartOfHighlightingbool-

Set to true if the day is the start of a highlighted date range.

isStartOfPreviewingbool-

Set to true if the day is the start of a previewing date range.

isVisuallySelectedbool-

Indicates if the day should be visually selected.

onBlurfunc() => {}

Callback fired when the component is blurred.

Signature:function(event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void
  • event The event object.
  • day The day.
onClickfunc() => {}

Callback fired when the component is clicked.

Signature:function(event: MuiEvent<React.MouseEvent<HTMLButtonElement>>) => void
  • event The event object.
onFocusfunc() => {}

Callback fired when the component is focused.

Signature:function(event: React.FocusEvent<HTMLButtonElement>, day: PickerValidDate) => void
  • event The event object.
  • day The day.
onKeyDownfunc() => {}

Callback fired when a key is pressed.

Signature:function(event: React.KeyboardEvent<HTMLButtonElement>, day: PickerValidDate) => void
  • event The event object.
  • day The day.
onMouseDownfunc() => {}

Callback fired when the mouse button is pressed.

Signature:function(event: React.MouseEvent<HTMLButtonElement>) => void
  • event The event object.
onMouseEnterfunc() => {}

Callback fired when the mouse enters the component.

Signature:function(event: React.MouseEvent<HTMLButtonElement>, day: PickerValidDate) => void
  • event The event object.
  • day The day.
outsideCurrentMonthboolfalse

If true, the day is outside the current month.

selectedboolfalse

If true, renders as selected.

showDaysOutsideCurrentMonthboolfalse

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.

todayboolfalse

If true, today's day is highlighted.

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.

CSS classes

These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.

Class nameRule nameDescription
.Mui-disabledState class applied to the root element if `isDayDisabled=true`.
.Mui-selectedState class applied to the root element if `isDaySelected=true`.
.MuiDateRangePickerDay-dayOutsideMonthdayOutsideMonthStyles applied to the root element if `isDayOutsideMonth=true` and `showDaysOutsideCurrentMonth=true`.
.MuiDateRangePickerDay-draggabledraggableStyles applied to the root element if `isDayDraggable=true`.
.MuiDateRangePickerDay-endOfMonthendOfMonthStyles applied to the root element if `isDayEndOfMonth=true`.
.MuiDateRangePickerDay-endOfWeekendOfWeekStyles applied to the root element if `isDayEndOfWeek=true`.
.MuiDateRangePickerDay-fillerCellfillerCellStyles applied to the root element if `isDayOutsideMonth=true` and `showDaysOutsideCurrentMonth=false`.
.MuiDateRangePickerDay-firstVisibleCellfirstVisibleCellStyles applied to the root element if `isDayFirstVisibleCell=true`.
.MuiDateRangePickerDay-insidePreviewinginsidePreviewingStyles applied to the root element if `isDayInsidePreview=true`.
.MuiDateRangePickerDay-insideSelectioninsideSelectionStyles applied to the root element if `isDayInsideSelection=true`.
.MuiDateRangePickerDay-lastVisibleCelllastVisibleCellStyles applied to the root element if `isDayLastVisibleCell=true`.
.MuiDateRangePickerDay-previewedpreviewedStyles applied to the root element if `isDayPreviewed=true`.
.MuiDateRangePickerDay-previewEndpreviewEndStyles applied to the root element if `isDayPreviewEnd=true`.
.MuiDateRangePickerDay-previewStartpreviewStartStyles applied to the root element if `isDayPreviewStart=true`.
.MuiDateRangePickerDay-rootrootStyles applied to the root element.
.MuiDateRangePickerDay-selectionEndselectionEndStyles applied to the root element if `isDaySelectionEnd=true`.
.MuiDateRangePickerDay-selectionStartselectionStartStyles applied to the root element if `isDaySelectionStart=true`.
.MuiDateRangePickerDay-startOfMonthstartOfMonthStyles applied to the root element if `isDayStartOfMonth=true`.
.MuiDateRangePickerDay-startOfWeekstartOfWeekStyles applied to the root element if `isDayStartOfWeek=true`.
.MuiDateRangePickerDay-todaytodayStyles 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:

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.