Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Material Ui React Theme customization is not applying

I'm using Nextjs with Material UI React I want to change default primary color to other color. I have used below code in app.js

import Layout from '../components/layout'
import '../styles/global.css'
import { createTheme , ThemeProvider  } from "@material-ui/core/styles";

const theme = createTheme({
  palette: {
    primary: {
      main: '#00ab55',
    },
    secondary: {
      main: "#00ab55"
    }
  }
});

export default function MyApp({ Component, pageProps }) {
  return (
    <ThemeProvider  theme={theme}>
      <Layout>
        <Component {...pageProps} />
      </Layout>
    </ThemeProvider >
  )
}

and used it in another component like below in color props.

 <TextField className="num_input_field" color='primary' placeholder="phone number" inputProps={{ inputMode: 'numeric', pattern: '[0-9]*' }} />
 <Button variant="contained" color="primary">Go</Button>

But no any changes. I have done below multiple things to check

I have changed ThemeProvider to MuiThemeProvider

Also tried <ThemeProvider theme={theme}> to <ThemeProvider MuiTheme={theme}>

Also used createMuiTheme instead of createTheme. but here createMuiTheme is deprecated showing in visual studio code.

Also changed from "@material-ui/core/styles" to from "@material-ui/core"

Below is my package.json to see version.

{
  "name": "xyz",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@emotion/react": "^11.4.1",
    "@emotion/styled": "^11.3.0",
    "@material-ui/core": "^4.12.3",
    "@mui/icons-material": "^5.0.1",
    "@mui/material": "^5.0.2",
    "next": "11.1.2",
    "react": "17.0.2",
    "react-dom": "17.0.2",
    "react-flags-select": "^2.1.2",
    "sass": "^1.42.1"
  },
  "devDependencies": {
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.2"
  }
}

Please help. Thank you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!