Layering and Elevation: What Actually Works
How interfaces show depth with shadows, overlays and stacking order, so dialogs and menus appear above content.
On this page
What is at stake
Unplanned stacking creates menus behind headers and dialogs trapped under overlays.
The playbook
- Define elevation levels in the design system
- Use native dialog and popover features
- Keep z-index values in tokens
- Test overlays on mobile
- Check focus behavior for layered content
Where it goes wrong
Avoid:
- Arbitrary high z-index values
- Menus clipped by parent containers
- Overlays that trap focus incorrectly
- Shadows used inconsistently
The numbers behind it
| Measure | Figure |
|---|---|
| Elevation | design systems define levels of depth with shadows |
| Stacking context | CSS z-index works within stacking contexts |
| Top layer | modern browsers render dialogs and popovers in a top layer |
| Scrims | dimmed overlays separate dialogs from content |
Getting outside help
When to hand it over: Bring in help when overlays and menus behave unpredictably.
Where this comes from
- Material Design — Elevation
- MDN Web Docs — z-index
The figures and practices above come from the sources listed.
Working on something like this?
We take on UI & UX Design work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.
Where to go next
Spotted something wrong? Report an error on this page. We correct on the page and say what changed.