Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we remove the calendar icon from the TextField (MUI)?

Here is my basic code to accomplish the task, but couldn't come up with any outcome

 <TextField
        sx={{
          '&::-webkit-calendar-picker-indicator': {
            display: 'none',
            '-webkit-appearance': 'none',
          },
        }}
        id="outlined-basic"
        variant="outlined"
        type="date"
        helperText="Please select the date"
      />

Also, I did a bit research on InputProps (endAdornment) within TextField to remove the icon, but that didn't work.

like image 956
user2824374 Avatar asked Oct 16 '25 19:10

user2824374


1 Answers

You can define in the components property the icon to be null for both cases.

<TimePicker
      label="Time"
      value={value}
      onChange={handleChange}
      renderInput={(params) => <TextField {...params} />}
      disableOpenPicker
    />
    <DateTimePicker
      label="Date&Time picker"
      value={value}
      onChange={handleChange}
      renderInput={(params) => <TextField {...params} />}
      disableOpenPicker
    />

Here is a working sandbox

like image 99
Akis Avatar answered Oct 19 '25 12:10

Akis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!