Surfaces
Eight surface levels that nest. Components read their substrate from context and lift relative to it, so popovers, dropdowns, and dialogs stay visible at any depth — in both light and dark mode.
The problem
In light mode, we use shadow behind white surfaces to signify elevation. In dark mode, we use progressively lighter backgrounds instead.
But traditional components have a fixed background — a dropdown often ends up the same color as the dialog it sits in. That makes your interface look like this:
- Workspace ownerCan change workspace settings and invite new members
- MemberCan’t change workspace settings or invite new members
- Restricted memberCan only see and edit content they created
The solution
Three pieces: tokens, substrate context, and the primitive.
Tokens
Eight background and shadow pairs. Light mode flattens to white after step 2. Dark mode adds white opacity and layers the shadows.
Dark
Light
Substrate
Each container passes its own level to the controls it contains. The same role picker opens at a different level on the page, in a popover, and in a dialog.
Elevated
Wrap a panel to raise it above its parent. Background and shadow can be set independently.
Move through levels
Drag both knobs to choose which slice of the ladder to nest. Each layer lifts a single step off the one it sits in.
Examples
Invite dialog
The dialog uses surface 5. Its role picker opens at surface 7.
Color picker
The format dropdown sits above the picker panel.
Arrow keys adjust saturation and brightness. Shift uses larger steps.
Effect UI port notes
The native previews use explicit presentation props for nesting. The invite demo keeps its email and role selections local.