If you're looking to easily customize a component, consider checking out the TimePicker
in the lab package. Styling the native time input can be challenging due to the lack of support. To change the icon color to green, you can use the following code snippet:
<TextField
sx={{
'& input[type="time"]::-webkit-calendar-picker-indicator': {
filter:
'invert(78%) sepia(66%) saturate(6558%) hue-rotate(84deg) brightness(127%) contrast(116%)',
},
}}
type="time"
{...}
/>
The filter value is based on this codepen example. Alternatively, if you opt for using the TimePicker
, the code would resemble this:
<TimePicker
label="Basic example"
components={{
OpenPickerIcon: (props) => (
<AccessTimeIcon {...props} sx={{ color: 'red' }} />
),
}}
renderInput={(params) => <TextField {...params} />}
/>
For a demo, you can visit this link.