Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda