3

I what to change color of label and text in TextField component.

I am using material-ui@next.

and docs from 0.15 does not work ( I have checked it) .

Can someone give me short example how to override floating label? ( not changing general theme ! )

thanks

1 Answer 1

6

From the documentation, when you have a TextField it is, in fact, an abstraction component of several smaller components

Advanced Configuration

It's important to understand that the text field is a simple abstraction on top of the following components:

FormControl - InputLabel

  • List item

  • Input

  • FormHelperText

  • Blockquote

If you wish to alter the properties applied to the native input, you can do as follow:...

In your TextField you can pass props for the Input and Label as follow:

<TextField defaultValue="react-bootstrap" label="Bootstrap" InputProps={{ disableUnderline: true, classes: { root: classes.textFieldRoot, input: classes.textFieldInput, }, }} InputLabelProps={{ shrink: true, className: classes.textFieldFormLabel, }} /> 

this is taken from the last example given in this page.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.