Skip to contentSkip to content

PickerDay API

API reference docs for the React PickerDay component. Learn about the props, CSS, and other APIs of this exported module.

Demos

Import

import { PickerDay } from '@mui/x-date-pickers/PickerDay';
// or
import { PickerDay } from '@mui/x-date-pickers';
// or
import { PickerDay } 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*object-

The date to show.

onDaySelect*func-

Callback fired when the day is selected.

Signature:function(day: PickerValidDate) => void
  • day The day to select.
actionfunc
| { current?: { focusVisible: func } }
-

A ref for imperative actions. It currently only supports focusVisible() action.

centerRippleboolfalse

If true, the ripples are centered. They won't start at the cursor interaction position.

classesobject-

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.

disableRippleboolfalse

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.

disableTouchRippleboolfalse

If true, the touch ripple effect is disabled.

focusRippleboolfalse

If true, the base button will have a keyboard focus ripple.

focusVisibleClassNamestring-

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.

isAnimatingboolfalse

If true, the day is being animated.

isDayFillerCellboolfalse

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

isFirstVisibleCellboolfalse

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

isLastVisibleCellboolfalse

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

isVisuallySelectedbool-

Indicates if the day should be visually selected.

nativeButtonbool-

Whether the custom component is expected to render a native <button> element when passing a React component to the component or slots prop.

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.
onFocusVisiblefunc-

Callback fired when the component is focused with a keyboard. We trigger a onFocus callback too.

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.

sxArray<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.

todayboolfalse

If true, today's day is highlighted.

TouchRipplePropsobject-

Props applied to the TouchRipple element.

touchRippleReffunc
| { current?: { pulsate: func, start: func, stop: func } }
-

A ref that points to the TouchRipple element.

The ref is forwarded to the root element.

Theme default props

You can use MuiPickerDay 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 disabled=true.
.Mui-selectedState class applied to the root element if selected=true.
.MuiPickerDay-dayOutsideMonthdayOutsideMonthStyles applied to the root element if outsideCurrentMonth=true and showDaysOutsideCurrentMonth=true.
.MuiPickerDay-fillerCellfillerCellStyles applied to the root element if outsideCurrentMonth=true and showDaysOutsideCurrentMonth=false.
.MuiPickerDay-rootrootStyles applied to the root element.
.MuiPickerDay-todaytodayStyles applied to the root element if disableHighlightToday=false and today=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.