Skip to main content

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.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

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.

RoleUsed onShadowLayer
--elevation-flatcontent on the pagenone--z-base
--elevation-raisedresting cards, inputs--shadow-sm--z-base
--elevation-overlaymenus, popovers, dropdowns--shadow-md--z-dropdown
--elevation-toasttoasts--shadow-lg--z-toast
--elevation-modaldialogs, 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.

ThemeAt restUnder the pointerWhile held
Defaulta small contact shadowa slightly larger shadowflush: an inset press on a key; a thumb or knob returns to its contact shadow
Enterprisea faint contact shadowno change (colour carries hover)the shadow is removed on a key; thumbs and the knob never change
Industrya soft casta longer, wider casta 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:

  1. Where did this come from, or go? A menu grows from its trigger; a sheet rises from its edge.
  2. What changed? Press, toggle, selection, validation.
  3. Where should I look? At most one animated attention cue on a screen.
  4. What is the system doing? Skeletons and progress bars.

Anything that answers none of these is decoration, and is spent rarely.

Durations​

TokenValueUsed for
--duration-instant80mspress feedback
--duration-fast140mshover, focus, colour changes
--duration-normal220msstate changes, most entrances
--duration-settle260msa thumb, cap or pointer travelling to a new position
--duration-slow340mslarge surfaces such as drawers

Easings​

TokenCurveUsed for
--ease-standardcubic-bezier(0.2, 0, 0, 1)most transitions
--ease-emphasizedcubic-bezier(0.3, 0, 0, 1)larger, more deliberate moves
--ease-outcubic-bezier(0, 0, 0.2, 1)entrances, which decelerate
--ease-exitcubic-bezier(0.4, 0, 1, 1)exits, which accelerate
--ease-settlecubic-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 transform and opacity, 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

Live demo
Open ↗