PickersCalendarHeader API
API reference docs for the React PickersCalendarHeader component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import { PickersCalendarHeader } from '@mui/x-date-pickers/PickersCalendarHeader';
// or
import { PickersCalendarHeader } from '@mui/x-date-pickers';
// or
import { PickersCalendarHeader } from '@mui/x-date-pickers-pro';
Name | Type | Default | Description |
---|---|---|---|
classes | object | - | Override or extend the styles applied to the component. See CSS API below for more details. |
format | string | `${adapter.formats.month} ${adapter.formats.year}` | Format used to display the date. |
slotProps | object | {} | The props used for each component slot. |
slots | object | {} | Overridable component slots. See Slots API below for more details. |
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. |
The component cannot hold a ref.
Slot name | Class name | Default component | Description |
---|---|---|---|
switchViewButton | .MuiPickersCalendarHeader-switchViewButton | IconButton | Button displayed to switch between different calendar views. |
switchViewIcon | .MuiPickersCalendarHeader-switchViewIcon | ArrowDropDown | Icon displayed in the SwitchViewButton. Rotated by 180° when the open view is 'year'. |
previousIconButton | IconButton | Button allowing to switch to the left view. | |
nextIconButton | IconButton | Button allowing to switch to the right view. | |
leftArrowIcon | ArrowLeft | Icon displayed in the left view switch button. | |
rightArrowIcon | ArrowRight | Icon displayed in the right view switch button. |
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 |
---|---|---|
.MuiPickersCalendarHeader-label | label | Styles applied to the label element. |
.MuiPickersCalendarHeader-labelContainer | labelContainer | Styles applied to the label container element. |
.MuiPickersCalendarHeader-root | root | Styles applied to the root element. |
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.