Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

468
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda