How can I remove the underline of TextField from Material-UI?

H.Zhao picture H.Zhao · Sep 12, 2019 · Viewed 45.9k times · Source

I want the TextField to be naked(no underline) when using material-ui TextField. I do know that using InputBase from material-ui can achieve this, but I kinda need to use TextField API to achieve this but i did not find the way to do it in the API guide.

Answer

Kofi Nartey picture Kofi Nartey · Apr 13, 2020

You can also use the InputProps prop on the TextField component to achieve this by setting the disableUnderline property to true.

<TextField
  fullWidth
  placeholder="Search..."
  InputProps={{ disableUnderline: true }}
 />