Elevation
A system of layers that says what sits above what, expressed visually and enforced in code.
Definition
Elevation is the apparent distance of a surface from the background. It is communicated through shadow, surface lightness or both, and it should map to a documented set of levels rather than to arbitrary z-index values.
Craft convention. True because the industry converged on it. Breaking it costs familiarity, not correctness.
On this plate
Reach for this when
- Defining overlay behaviour.
- Building a dark theme.
- Debugging stacking problems.
- Several layered surfaces exist and their stacking order has started to be argued about.
Common mistakes
- Ad hoc z-index values.
- Shadow-only elevation carried into dark mode.
- Too many elevation levels to distinguish.
A working elevation system
| Level | Used by | Light mode | Dark mode |
|---|---|---|---|
| 0 | Page background | Base surface | Base surface |
| 1 | Cards, raised panels | Very subtle shadow | Surface one step lighter |
| 2 | Sticky headers, dropdowns | Small shadow | Two steps lighter |
| 3 | Popovers, tooltips | Medium shadow | Three steps lighter |
| 4 | Modals and dialogs | Large shadow plus scrim | Four steps lighter plus scrim |
| 5 | Toasts and critical alerts | Large shadow | Highest surface |
Running an elevation system
Do
- Define a small number of levels, each with a stated meaning.
- Tie z-index to the same levels, so stacking and appearance agree.
- Express elevation with surface lightness in dark themes, where shadows barely read.
- Keep the light source consistent, which means shadows always fall the same way.
Do not
- Invent a z-index of 9999 to win a stacking argument.
- Give every card elevation, which flattens the hierarchy you were trying to build.
- Use elevation to indicate importance. It indicates layer.
In practice
- i.
Dark mode elevation by lightness
ThemingShadows are almost invisible against dark surfaces. Raising elevation by lightening the surface is the standard approach, and it needs to be defined per level rather than improvised.
- ii.
The z-index arms race
Why the scale mattersA dropdown at 100, a modal at 1000, a toast at 9999 and a cookie banner at 2147483647. Each value was chosen to beat the last, and the result is a stacking order nobody can reason about.
Local chart
FND·048 · Region II · Grid D2
This entry and the entries it is stated to connect with. Each line is labelled with what the connection means.
Continue from here
Each link says what the connection is, so you can tell a principle from an alternative from a thing people mix this up with.
Applied through
Where this shows up as a concrete interface decision.
- CardCMP·022 · Component
- Drawer and SheetCMP·011 · Component
- Modal DialogCMP·010 · Component
- PopoverCMP·012 · Component
Principles behind this
The reasoning this solution is an application of.
- Affordances and SignifiersPRIN·007 · Principle
Related concept
Connected closely enough to change how you apply this.
- Focus ManagementA11Y·004 · Accessibility
- Design TokensSYS·001 · Design system
- Common RegionFND·006 · UI foundation
- Dark ModeFND·027 · UI foundation
- Figure and GroundFND·009 · UI foundation
- NeutralsFND·025 · UI foundation
- ShadowsFND·049 · UI foundation
- ShapeFND·046 · UI foundation