Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

170
Vistas
How to Style specific/single Item or a Component using Custom Css in React Js?

I have been trying to style the search bar which is the TextFiled component used from react Material Ui library. However, I tried to do using External and Inline CSS but no results.

I tried to do using Withstyle, it does work but it is also affecting other TextFiled on another components. The issue is how can only target one specific item?

The real Search bar/TextFiled image is below in black border by default I want to make it white.

enter image description here

The code I tried:

   const TextFiledStyle = withStyles({
    root: {
        '& .MuiOutlinedInput-root': {
            '& fieldset': {
              borderColor: 'white',
            },
            '&:hover fieldset': {
                borderColor: '#356E44',
              },
            '&.Mui-focused fieldset': {
                borderColor: 'gray',
              },
        },
    },
})(TextField);

Any Help or suggestions would be really appriciated.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I think you should just be able to add a class name to the component as you use it.

<TextField className="custom-class">some text</TextField>

Then just adjust the css as you need. e.g.

.custom-class .MuiOutlinedInput-root fieldset {
  borderColor: white;
}

See more in the docs. https://mui.com/customization/how-to-customize/#overriding-styles-with-class-names

about 4 years ago · Juan Pablo Isaza Denunciar

0

Thanks for the help I have to twist around a little bit but found the answer which is as below:

const useStyles = makeStyles (theme => ({
    textbox:{
        '& .MuiOutlinedInput-root': {
            color: 'white',
            border: '1px solid white'
        }
    },

}))
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda