DEV Community

Oleksandr Sachuk
Oleksandr Sachuk

Posted on

2 1

How to style helperText in the TextField material-ui component

Add custom styles to the “material-ui” component may be a challenge sometimes.

For example, I need to add additional custom styles to the “TextField” component.

helperText

I tried different solutions and spent a lot of time to find the most simple one.

In the end, I found that it is a possible just pass “FormHelperTextProps” property with “className” key.

<TextField
FormHelperTextProps={{
className: classes.helperText
}}
/>
view raw helperText hosted with ❤ by GitHub

Hope, this solution saves you time!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay