DateTimePickerToolbar API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import { DateTimePickerToolbar } from '@mui/x-date-pickers-pro';
// or
import { DateTimePickerToolbar } from '@mui/x-date-pickers';
Component name
The nameMuiDateTimePickerToolbar
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) => void view: The view to open | |
view* | 'day' | 'hours' | 'meridiem' | 'minutes' | 'month' | 'seconds' | 'year' | Currently visible picker view. | |
classes | object | Override or extend the styles applied to the component. See CSS API below for more details. | |
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 | .MuiDateTimePickerToolbar-root | Styles applied to the root element. |
dateContainer | .MuiDateTimePickerToolbar-dateContainer | Styles applied to the date container element. |
timeContainer | .MuiDateTimePickerToolbar-timeContainer | Styles applied to the time container element. |
timeDigitsContainer | .MuiDateTimePickerToolbar-timeDigitsContainer | Styles applied to the time (except am/pm) container element. |
timeLabelReverse | .MuiDateTimePickerToolbar-timeLabelReverse | Styles applied to the time container if rtl. |
separator | .MuiDateTimePickerToolbar-separator | Styles applied to the separator element. |
ampmSelection | .MuiDateTimePickerToolbar-ampmSelection | Styles applied to the am/pm section. |
ampmLandscape | .MuiDateTimePickerToolbar-ampmLandscape | Styles applied to am/pm section in landscape mode. |
ampmLabel | .MuiDateTimePickerToolbar-ampmLabel | Styles applied to am/pm labels. |
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.