joseph smith
joseph smith

Reputation: 143

How to change material input text style react js

I'm using material ui TextField I want to change style of the part that I mentioned in text field (see image)

or

font of the text that user writes

enter image description here

I've tried to use material API but it shows same result

 const useStyles = makeStyles((theme) => ({
    root: {
      "&. input":{
        fontFamily:'roboto'
      }
    )
  }

Upvotes: 0

Views: 305

Answers (1)

kiranvj
kiranvj

Reputation: 34117

For MUI TextField try this

<TextField inputProps={{ style: { 'fontFamily' : 'roboto'} }} id="standard-basic" label="Standard" />

OR

const useStyles = makeStyles((theme) => ({
    root: {  fontFamily: 'roboto' }
    }));

<TextField classes={{ input: classes.root }} id="standard-basic" label="Standard" />

Either one of these should work.

Upvotes: 1

Related Questions