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

201
Vistas
Create components from sidebar Material UI that appear above all components

I'm creating a sidebar component using Material UI Drawer component.

I want to create components from the sidebar that sticks side by side to the sidebar component like this green box in the image below.

enter image description here

I tried to figure out the code but get something like this image below.

enter image description here

As we can see the sidebar component looks like it's located below the content page (that's why the orange boxes are cropped). Also, the sidebar component displays the horizontal scroll bar.

Here is the code: https://codesandbox.io/s/custom-sidebar-material-ui-4c05j

In this case, what I want is to create orange boxes that appear above all components (look like the first image above).

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Finally, I found the answer by myself.

For you who are wondering the solution, here are the general steps I used:

  1. To solve the position of the orang boxes, replace Drawer component with Container component in Sidebar component.
  2. To show the orange boxes only when the Sidebar is closed/minimized, add hoveredParent state, set the state to true when the mouse is entering the parent item (using onMouseEnter prop) and null when the mouse is leaving the parent item.
  3. Show the parent or children items inside the orange boxes.
  4. Fixed the styling of the orange boxes.

Here is the solution https://codesandbox.io/s/custom-sidebar-material-ui-forked-c47yk

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