Home > OS >  Change Color of Text Field from Text Field in Material UI v5
Change Color of Text Field from Text Field in Material UI v5

Time:02-02

I am Using MUI and did everything to change the Color of the Text in a MUI Text Field and/or its background Color.

I followed the Documentation and tried:

const CssTextField = styled(TextField)({

And also Things inside the Component, such as

InputProps={{
           style: { color: "red" }
           }}

or

InputProps={{
            color: "red"
           }}

Nothing works for me and I don´t know why.

I hope that you can help me.

CodePudding user response:

Can you try

InputProps={{
        backgroundColor: "red"
       }}

instead of

InputProps={{
        color: "red"
       }}

CodePudding user response:

Maybe

// Option 1
<TextField style ={{width: '100%'}} />

// Option 2
<TextField fullWidth />

  •  Tags:  
  • Related