Elevation & motion
Elevation ladder & motion
Each shadow on a card in light and dark, plus every duration and easing token on a small transition you can replay. Values come straight from tokens/elevation.css.
Elevation
Depth is functional. A surface lifts only when it sits above the content around it: a menu over a page, a dialog over everything.
Name the element, not the shadow
Use an elevation role. Each one pairs a shadow with the layer it belongs on, so a surface cannot have a dialog's shadow and a menu's stacking order.
| Role | Used on | Shadow | Layer |
|---|---|---|---|
--elevation-flat | content on the page | none | --z-base |
--elevation-raised | resting cards, inputs | --shadow-sm | --z-base |
--elevation-overlay | menus, popovers, dropdowns | --shadow-md | --z-dropdown |
--elevation-toast | toasts | --shadow-lg | --z-toast |
--elevation-modal | dialogs, drawers | --shadow-xl | --z-modal |
The shadow primitives run --shadow-xs to --shadow-xl, with --shadow-inset for wells. Reach for a primitive only when no role fits.
Layering order
--z-base (0) › --z-sticky (100) › --z-dropdown (300) › --z-overlay (400) › --z-modal (500) › --z-toast (600) › --z-tooltip (700). Never write a raw z-index.
Dark themes
Shadows read poorly on a near-black background. In dark themes elevation is carried mostly by lighter surface fills and borders, and the same role tokens resolve to that treatment. Components need no dark-specific code.
One shadow model per theme
Every part a hand touches follows one model inside a theme, so a button, an icon button, a keypad key and a slider thumb sitting side by side behave alike. The model differs between themes; within a theme it never does.
| Theme | At rest | Under the pointer | While held |
|---|---|---|---|
| Default | a small contact shadow | a slightly larger shadow | flush: an inset press on a key; a thumb or knob returns to its contact shadow |
| Enterprise | a faint contact shadow | no change (colour carries hover) | the shadow is removed on a key; thumbs and the knob never change |
| Industry | a soft cast | a longer, wider cast | a short, tight, darker cast |
On the dark default face a larger shadow cannot be seen against near-black, so a hovered key or
clickable tile also takes --lift-edge: a brighter top edge and a hairline rim. The token is empty
on light faces and in Enterprise and Industry.
A clickable card or KPI tile lifts on hover and seats again when pressed, in every theme. A floating action button keeps a shadow while held: it lowers, it does not go flush. When you add a part that can be pressed or dragged, give it all three states from this table.
Themed depth
A theme can replace the whole material. Industry gives controls and cards physical depth from a single light source, with its own shadow recipes; see Theming & signatures. Components still ask for the same roles.
Motion
Motion explains a change. Every animation answers one of four questions:
- Where did this come from, or go? A menu grows from its trigger; a sheet rises from its edge.
- What changed? Press, toggle, selection, validation.
- Where should I look? At most one animated attention cue on a screen.
- What is the system doing? Skeletons and progress bars.
Anything that answers none of these is decoration, and is spent rarely.
Durations
| Token | Value | Used for |
|---|---|---|
--duration-instant | 80ms | press feedback |
--duration-fast | 140ms | hover, focus, colour changes |
--duration-normal | 220ms | state changes, most entrances |
--duration-settle | 260ms | a thumb, cap or pointer travelling to a new position |
--duration-slow | 340ms | large surfaces such as drawers |
Easings
| Token | Curve | Used for |
|---|---|---|
--ease-standard | cubic-bezier(0.2, 0, 0, 1) | most transitions |
--ease-emphasized | cubic-bezier(0.3, 0, 0, 1) | larger, more deliberate moves |
--ease-out | cubic-bezier(0, 0, 0.2, 1) | entrances, which decelerate |
--ease-exit | cubic-bezier(0.4, 0, 1, 1) | exits, which accelerate |
--ease-settle | cubic-bezier(0.2, 0.7, 0.2, 1) | a part coming to rest, with no overshoot |
Two ready-made transitions cover the common cases: --transition-colors (colour, background, border and shadow) and --transition-transform.
Settle
When a click or a key moves a slider thumb, a switch cap or a dial pointer, it travels with --duration-settle and --ease-settle: a long decelerating tail and no bounce. This is never applied while a pointer is dragging the part, which must follow the hand exactly.
Themes set the tempo
A theme may re-point the duration tokens to give a product a brisker or more measured feel. Because components use the tokens and never a number, the whole product changes tempo together.
Reduced motion
When a reader asks their system to reduce motion, Prism collapses every animation and transition to an instant state change. Content still arrives; it does not travel. This is applied globally in tokens/base.css, so components get it without doing anything.
Build your own animations so the end state is the base style and motion is only the route to it.
Rules
- Use the tokens. A hard-coded duration falls out of step when a theme changes tempo.
- Entrances and exits differ: entrances decelerate, exits accelerate and travel less.
- Animate
transformandopacity, not layout properties. - No animation makes the user wait. If it cannot be interrupted, shorten it.
- No infinite decorative loops. A spinner during a real wait is fine; an always-moving accent is not.
- When several items enter together, stagger them by 20 to 40ms and stop staggering after six.
Live specimen
Elevation in context