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

122
Visualizações
Change default material ui radio checked color

I have taken a look at other threads relating to this but unfortunately I am not able to change the material ui default red checked colour.

Here is my code below:

   return (
        <FormControl>
            <FormLabel>{label}</FormLabel>
            <RadioGroup row
                name={name}
                value={value}
                onChange={onChange}
                {
                    items.map(
                        item => (
                            <FormControlLabel key={item.id} value={item.id} control={<Radio />} label={item.title} />
                        )
                    )
                }
            </RadioGroup>
        </FormControl>
    )

I simply want to be able to change the checked radio color from red to blue.

I have tried the following but didn't work:

<Radio
  {...props}
  sx={{
    '&, &.Mui-checked': {
      color: 'blue',
    },
  }}
/>
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Because you use 2 selectors - & and &.Mui-checked you overwrite the color of your checkbox in an unchecked state. Therefore, you should get rid of & and everything will work fine:

      <Radio
        {...props}
        sx={{
          color: "red",
          "&.Mui-checked": {
            color: "green"
          }
        }}
      />

Demo

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