How to change mui textfield text color in react js?

Hi Friends 👋,

Welcome To aGuideHub! ❤️

To change the text color in mui textfield, set color: #580fce !important; in .MuiInputBase-root for text color.

Today, I am going to show you, how to change mui textfield text color in react js mui textfield.

I targeted MuiInputBase-root with the nested selector. Notice the spacing between the & and the class name. This means the selector is looking for a child or the root element.

To change the color of the text textfield do this

.MuiInputBase-root {
  color: #580fce !important;


Install the following packages to use mui textfield in react js.


npm install @mui/material @emotion/react @emotion/styled


yarn add @mui/material @emotion/react @emotion/styled

MUI material textfield change text color example

To change the color of the font, the class .MuiInputBase-root has to be used.


import * as React from 'react';
import Box from '@mui/material/Box';
import TextField from '@mui/material/TextField';
import "./App.css"

export default function CustomizedInputs() {
  return (
        display: 'grid',
        gridTemplateColumns: { sm: '1fr 1fr' },
        gap: 2,
      <TextField id="outlined-basic" label="Outlined" variant="outlined" />
      <TextField id="filled-basic" label="Filled" variant="filled"/>
      <TextField id="standard-basic" label="Standard" variant="standard"/>


.MuiInputBase-root {
  color: #580fce !important;

In the above code example, I have used the @mui/material TextField component and changed the color of the text of all types of MUI Textfield.

Check the output of the above code example.

React, Mui Textfield Text Color Final

All the best 👍

Premium Content

You can get all the below premium content directly in your mail when you subscribe us


Portfolio Template

View | Get Source Code

Cheat Sheets

Cheat Sheets Books are basically Important useful notes which we use in our day-to-day life.

I'm working on some more Cheat Sheets book on Jquery, TypeScript, React js and for other languages. I will send it once it's completed.

Related Posts