DatePickerToolbar API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import { DatePickerToolbar } from '@mui/x-date-pickers-pro';
// or
import { DatePickerToolbar } from '@mui/x-date-pickers';Component name
The nameMuiDatePickerToolbar can be used when providing default props or style overrides in the theme.Props
| Name | Type | Default | Description |
|---|---|---|---|
| onViewChange* | func | Callback called when a toolbar is clicked Signature: function(view: TView) => voidview: The view to open | |
| view* | 'day' | 'month' | 'year' | Currently visible picker view. | |
| className | string | className applied to the root component. | |
| hidden | bool | `true` for Desktop, `false` for Mobile. | If true, show the toolbar even in desktop mode. |
| toolbarFormat | string | Toolbar date format. | |
| toolbarPlaceholder | node | "––" | Toolbar value placeholder—it is displayed when the value is empty. |
The component cannot hold a ref.
CSS
| Rule name | Global class | Description |
|---|---|---|
| root | .MuiDatePickerToolbar-root | Styles applied to the root element. |
| title | .MuiDatePickerToolbar-title | Styles applied to the title 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
styleOverridesproperty in a custom theme.