What it governs
Two separate things that are easy to conflate:- Shadow — the visual impression that a surface floats above another. 24 tokens.
- Stacking order — which element actually renders on top. 8 tokens.
z-index does not make it
look raised. Most layering bugs come from setting one and expecting the other.
Vocabulary
The terms used here — level, direction, and the eightz-* rungs — are this page’s
description of what ships, not a decided vocabulary (the naming specification does not cover
shadow or stacking order at all — see
Open issues).
Shadow is directional
Titan’s shadow scale has a second axis most systems do not have: direction. Four directions × five levels, plus amain alias per direction.
The same five levels exist as
shadow-up-*, shadow-left-*, and shadow-right-*, with
the offset pushed along that axis. shadow-right-2 is 4px 4px 8px; shadow-left-2 is
-4px 4px 8px; shadow-up-2 is 0 -4px 8px.
Direction names where the shadow falls, not where the light is.
shadow-down-2 casts
downward, which is the default for a surface lifted off the page. shadow-up-* is for
elements anchored to the bottom of the viewport — a sticky footer or action bar — whose
content sits above them.Choosing a token
Token reference
The ladder has holes
Titan’s stacking ladder covers eight layers:
Two common layers have no token: drawers and toasts — see
Open issues for where they actually
stack and what that costs.
Use the
z-* tokens for everything they cover. Where they do not cover a case, that is
a gap to report rather than a number to invent.
Constraints
Accessibility
- Elevation is never the only signal. Windows High Contrast Mode and forced-colors
modes strip box-shadow entirely. A dialog distinguished from the page by shadow alone
disappears in those modes — pair it with a border, a scrim, and correct
role="dialog"/aria-modal. - Stacking order is not focus order. A
z-*token controls paint order only. Keyboard order follows the DOM. A popover rendered at the end of<body>but triggered from mid-page needs its focus managed explicitly. - Shadow is decorative and carries no contrast requirement, but the edge it implies often
substitutes for a border. If a surface relies on shadow to separate from its background,
give it a
border-*token too — that edge is what survives forced-colors. overlay-defaultis the modal scrim. It must be dark enough to signal inertness without hiding the content beneath, which users rely on for context.
Known issues
Elevation: open issues
Divergences, open decisions, and undocumented gaps for Elevation.
Related
6 core components consume this foundation — derived from token usage incomponents/core/src/components, not assumed:
Footer · Header · LoaderOverlay · Tile · Toggle · Tooltip
Why it works this way
Direction exists because Titan’s surfaces are anchored, not floating. Most elevation scales assume a card in the middle of a page with light from directly above. A product surface is mostly drawers pinned to an edge, sticky headers, and bottom action bars. For those, a downward shadow is wrong — it falls toward the edge the element is already attached to. Four directions cost four times the tokens and remove the need for every author to hand-roll abox-shadow for a side panel.
Five levels, deliberately. A long elevation scale guarantees two authors pick different
values for the same job, because nobody can distinguish step 11 from step 12. Five levels
map to five real situations: flat, resting, lifted, floating, and modal.
The z-index ladder is sparse on purpose. Wide gaps — 1, 10, 1000, 1100, 1300, 1500 —
leave room to insert a layer without renumbering. The ladder’s value is that it is
complete; a single literal z-index anywhere in the codebase breaks the guarantee it
provides.