How change the fontSize of TextField
See original GitHub issueI’m struggling to change this simple thing.
Changing by className is not enough as it didn’t get applied. For UX reason, I’m trying to increase the size because it’s too small. Already trying to get FormControl, InputLabel and Input to modify its classes by it’s hard because the elements itself get out of sync in your spacing calculations.
Somebody can help me out, please ??
Edit: I’m using the Material-UI 1.0-beta and redux-form-material-ui@next
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
Cannot change font size of text field in material ui
The most straight forward way to change the font size of both the input label and the input text is to use inline...
Read more >[TextField] Problems with changing the input label fontSize
I tried to change the fontsize of the lable using const theme = createTheme({ components: { MuiInputLabel: { defaultProps: { sx: { fontSize: ......
Read more >change font size of textfield material ui - Code Grepper
textfield font size material ui ; 1. <TextField ; 2. label="input label name here" ; 3. margin="normal" ; 4. inputProps={{style: {fontSize: 40}}} //...
Read more >Change the font size in a text box - XLineSoft
To change the font size in all text boxes placed on a page, use the following code in the JavaScript OnLoad event. $("input[type=text]").css('fontSize', ......
Read more >Typography - Material UI - MUI
To change the font-size of MUI you can provide a fontSize property. The default value is 14px . const theme = createTheme({ typography ......
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 Free
Top 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
in 2020 this doesnt work:
InputProps={{ classes: { input: {fontSize:1}, }, ]}}
You must pass the correct properties to the component, if you are having trouble with the
inputStyle
prop causing yourinputStyle
text to overlay the text labels and cause the alignment issues I think you are describing by saying out of ‘sync’ then it is just a matter of including the props from the Material-ui TextField page .Check the example below, prop values I picked are arbitrary but larger than the defaults for
TextField
. You probably need addhintStyle={{ height: 'some numerical value here' }}
to line up thehintText
. Material-ui renders a<div>
root element wrapped around the<label>
elements, each piece of theTextField
component has to be adjusted.<Field name="foo" component={TextField} style={{ height: '150px' }} inputStyle={{ fontSize: '1.5rem' }} props={{ floatingLabelText: 'Name', hintText: 'Your full name.', autoFocus: true }} />