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

230
Views
How can i make Drawer and AppBar side by side in Material UI?

I have following code in react:

import "./App.css";
import { dark_theme } from "./themes";
import { ThemeProvider, Toolbar } from "@mui/material";
import AppBar from "@mui/material/AppBar";
import Box from "@mui/material/Box";
import Drawer from "@mui/material/Drawer";
import Typography from "@mui/material/Typography";
import { Accordion, AccordionDetails, AccordionSummary } from "@mui/material";

function App() {
  return (
    <ThemeProvider theme={dark_theme}>
      <Box
        sx={{
          backgroundColor: "background.default",
          width: "100vw",
          height: "100vh",
        }}
        display={"flex"}
      >
        <AppBar>
          <Toolbar>
            <Typography>workspace</Typography>
          </Toolbar>
        </AppBar>
        <Drawer
          id={"left-drawer"}
          open={true}
          variant={"persistent"}
          anchor={"left"}
          sx={{
            color: "primary.main",
            backgroundColor: "background.default",
            "& .MuiDrawer-paper": {
              width: 200,
              boxSizing: "border-box",
              p: 2,
            },
          }}
        >
          <Accordion>
            <AccordionSummary>
              <Typography>objects</Typography>
            </AccordionSummary>
            <AccordionDetails>
              <Typography>objects</Typography>
            </AccordionDetails>
          </Accordion>
        </Drawer>
      </Box>
    </ThemeProvider>
  );
}

export default App;

even though AppBar and Drawer are parallel the Drawer extends above the AppBar and all the content below.

how can i make it so the Drawer pushes AppBar and all the contents below to right side when its extended, rather than covering everything rendered below?

btw dark_theme only has color and font.

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!