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 change the fontSize of TextField

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
kennblvnpcommented, Apr 28, 2020

in 2020 this doesnt work:

InputProps={{ classes: { input: {fontSize:1}, }, ]}}

2reactions
lexparsimonetcommented, Nov 11, 2017

You must pass the correct properties to the component, if you are having trouble with the inputStyle prop causing your inputStyle 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 add hintStyle={{ height: 'some numerical value here' }} to line up the hintText. Material-ui renders a <div> root element wrapped around the <label> elements, each piece of the TextField 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 }} />

Read more comments on GitHub >

github_iconTop 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 >

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