Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

466
Views
How to change theme of calendar in TextField in Material Ui

I am using material ui and trying to change the theme of the calendar but the textbox had changed although the calendar is not affected by theme I am posting images as well and code snippets also here

dateIcon: {
  'input[type="date"]::-webkit-calendar-picker-indicator': {
    color: 'green',
  },
},
DateBackGround: {
  background: theme.palette.background.paper,
  color: theme.palette.text.primary,
  '& .MuiOutlinedInput-input': {
    paddingRight: 2,
  },
},

<Grid item xs={6}>
      <div>
        <OutlinedTextField
          variant="outlined"
          type="date"
          id="by-this-date"
          size="small"
          onChange={updateWhatIfDate}
          value={expiryDateFormatted}
          className={`${`textInput`} ${classes.DateBackGround} ${classes.dateIcon}`}
          style={{ width: '100%' }}
        />
      </div>
    </Grid>

Component:- enter image description here

Actual output:- enter image description here

Thanks in Advance

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

1st Sollution:

You can set sx property to component in order to overwrite default style properties:

const color = "#c44242";
...
return (
       <DatePicker
          renderInput={(params) => {
            return (
              <TextField
                {...params}
                sx={{
                  svg: { color },
                  input: { color },
                  label: { color }
                }}
              />
            );
          }}
          ...other props
        />
  )

2nd Solution:

You can also create a custom theme and overwrite colors inside it:

const theme = createTheme({
    components: {
      MuiIconButton: {
        styleOverrides: {
          sizeMedium: {
            color
          }
        }
      },
      MuiOutlinedInput: {
        styleOverrides: {
          root: {
            color
          }
        }
      },
      MuiInputLabel: {
        styleOverrides: {
          root: {
            color
          }
        }
      }
    }
  });
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!