Custom opening button
The date picker lets you customize the button to open the views.
Set a custom opening icon
If you want to change the icon opening the picker without changing its behavior, you can use the openPickerIcon
slot:
Press Enter to start editing
You can also change the icon rendered based on the current status of the picker:
Press Enter to start editing
Pass props to the opening button
If you want to customize the opening button without redefining its whole behavior, you can use either:
- the
openPickerButton
slot to target theIconButton
component. - the
inputAdornment
slot to target theInputAdornment
component.
Press Enter to start editing
Add an icon next to the opening button
If you want to add an icon next to the opening button, you can use the inputAdornment
slot.
In the example below, the warning icon will be visible anytime the current value is invalid:
Press Enter to start editing
To add the same behavior to a picker that do not have an input adornment (e.g: Date Range Picker),
you need to use the textField
slot to add one:
–