How to style TextFields input color?
See original GitHub issueThere is no guidance on how to change the text colour of these inputs https://material-ui-next.com/demos/text-fields/
Do we just use external css to do this?
I also tried this but it doesn’t pass TypeScript checks:
<TextField
inputProps={{ style: { fontFamily: 'Arial', color: 'white'}}}
style={{ flex: 1, margin: '0 20px 0 0', color: 'white'}}
onChange={(e: ChangeEvent<HTMLInputElement>) => changeSearch(e.target.value)}
type="text"
value={reducerState.search}
/>
(50,11): error TS2339: Property 'inputProps' does not exist on type 'IntrinsicAttributes & TextFieldProps & { children?: ReactNode; }'.
This might be purely a TypeScript types issue
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:14 (5 by maintainers)
Top Results From Across the Web
How can I change the color of an string-input in a TextField?
In the example bellow, text is 'red' and the background of the TextField is 'orange'.
Read more >Change TextField Text Color in Flutter - The RIGHT Way [2022]
You can change TextField text color in Flutter, by adding style to the TextField widget. Basically, you provide the styling instructions by ...
Read more >How to style TextFields input color? · Issue #9574 - GitHub
There is no guidance on how to change the text colour of these inputs https://material-ui-next.com/demos/text-fields/.
Read more ><input type="color"> - HTML: HyperText Markup Language
<input> elements of type color provide a user interface element that lets a user specify a color, either by using a visual color...
Read more >How to Set MUI TextField Text Alignment, Text Color, and ...
Material-UI TextField Text Color can be customized using either the root level sx or with InputProps . I chose to use a selector...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@QuantumInformation I’m glad you found a solution. I would encourage people to do it this way:
https://codesandbox.io/s/1370v7y4zj
Notice that you can also target the global class names (
.MuiInputBase-root
and.MuiInputBase-input
).Does not work in
"@material-ui/core"