Sabil UI

Search documentation

Search for a command to run...

Motion · Foundations

Principles

Before animating anything, answer two questions: how often will people see it, and what is it for?

Frequency#

The more often something happens, the less it should move. Animation that delights once becomes friction the hundredth time.

SeenExamplesDecision
100+ times a dayCommand palette, keyboard shortcutsNo animation
Tens of times a dayHover, list navigation, tabsVery short or none
OccasionallyDialogs, drawers, toastsStandard animation
RarelyOnboarding, success statesRoom for delight

Purpose#

Every animation needs a reason. If the only reason is that it looks nice, and people see it often, leave it out.

Feedback

A button scales down on press. The interface heard you.

Spatial consistency

A toast leaves the way it came, so swiping it away feels natural.

State change

A label crossfades from Copy to Copied.

Continuity

A card grows into its detail view, so you never lose your place.

Preventing jumps

Content below a collapsing panel slides up instead of snapping.

Rules#

  1. 1Nothing appears from scale(0). Start at 0.95 with zero opacity.
  2. 2Never use ease-in for interface motion. It starts slow, exactly when the user is watching.
  3. 3Popovers grow from their trigger. Dialogs stay centered.
  4. 4Exit faster than you enter. The user already decided.
  5. 5Animate transform and opacity. Never transition: all.
  6. 6Use transitions, not keyframes, for things that can be interrupted. Transitions retarget, keyframes restart.
  7. 7Gate hover motion behind (hover: hover) and (pointer: fine).
  8. 8Never block input while an animation plays.