question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to make TextField defaults to filled variant?

See original GitHub issue

I’m trying to use the https://material-ui.com/customization/themes/#properties method to make all the TextField instances of my app to use the filled variant.

Is it supported? I think that it might not work because it only composes other component (FormControl, Input, etc).

Is there another way to do so?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
joshwoodingcommented, Feb 22, 2019

#14252 was released in @material-ui/core@v4.0.0-alpha.0. This should now be possible.

0reactions
ValentinHcommented, Feb 10, 2022

You should be able to use this: https://mui.com/customization/theme-components/#default-props.

Replace MuiButtonBase by MuiTextField and set the variant to be outlined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I us a theme to style all material-ui inputs as if they ...
Using my own OutlinedTextField component (where I override the default variant and pass all other props to TextField isn't an option, since I ......
Read more >
React Text Field component - Material UI - MUI
The TextField wrapper component is a complete form control including a label, input, and help text. It comes with three variants: outlined (default),...
Read more >
Text fields - Material Design
This demo lets you preview the text field component, its variations, and configuration ... A mobile UI for a contacts app form with...
Read more >
Text in Compose - Jetpack - Android Developers
The textAlign parameter allows to set the alignment of the text within a Text composable surface area. By default, Text will select the...
Read more >
How to use Reactjs Material-UI TextField component
defaultValue props is used to give a default value to a TextField. It gives a default text to show in the TextField. <TextField...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found