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

133
Views
Not able to override the default color of the material ui appbar
import React from 'react';
import { AppBar,Typography,Toolbar, makeStyles } from '@mui/material';

const useStyles = makeStyles({
  appbar:{
    backgroundColor:'#000000',
  }
})
const Navbar = () => {
  const classes = useStyles();
  return (
    <AppBar className={classes.appbar}>
      <Toolbar>

      </Toolbar>
    </AppBar>
  );
}
export default Navbar;

I am trying to change the default color of the appbar but this is not working , i tried using the char value of the color in place of the hex but that was also not working . Can anyone tell me whats wrong in this ? And yes , i am using the v5.4.3 of material-ui in this

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do a one-off customization of a component with the sx-prop:

import * as React from "react";
import AppBar from "@mui/material/AppBar";

export default function ButtonAppBar() {
  return (
    <AppBar position="static" sx={{ color: "red", bgcolor: "black" }}>
      Content
    </AppBar>
  );
}

mui AppBar with colors manually set

You may also be interested in MUI's color system.

about 4 years ago · Juan Pablo Isaza Report
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!