Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

231
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda