How to change the font family, font size and number of rows(height) of Mui TextField

Viewed 28

I want to change the font family of the label in Mui component TextField but the sx properly isnt working for font family, it works for changing the width. I tried the rows property for height, but that didnt work either.

<TextField 
          className="contactTextField"
          label="NAME"
          variant="outlined"
          sx={{
            fontFamily: ["Taviraj", "serif"].join(),
            width: "80%",
          }}
  />
1 Answers

you can see the example on this link

import "./styles.css";
import { TextField } from '@material-ui/core';

const styles = {
  fontFamily: 'Taviraj, serif',
  width: '80%'
}

export default function App() {
  return (
    <div className="App">
      <TextField 
          className="contactTextField"
          label="NAME"
          style={styles}
          variant="outlined"
          rows={4}
          multiline
      />
    </div>
  );
}
Related