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

206
Views
React Material UI wrap every component with AppBar without overlay

I'm trying to create an AppBar which will be used on each page putting it in one place. So I created a custom header component, used the answer from here to avoid overlaying AppBar overlaps with other elements but it doesn't work for me - still, the header overlays on elements wrapped inside. How to add a navbar in react in one place for every page?

Header component:

import { AppBar, Typography, Box } from '@material-ui/core';

const styles = (theme) => ({
    appBarSpacer: theme.mixins.toolbar,
});

const style = withStyles(styles);

function Header({ children, classes }) {
    return (
        <div>
            <AppBar>SMC</AppBar>
            <div className={classes.appBarSpacer}></div>
            <Box>{children}</Box>
        </div>
    );
}

export default style(Header);

And it's usage

export default function Home() {
    return (
        <Header>
            <DashboardComponent />
        </Header>
    );
}
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!