Motion
Short, quiet and only where it explains a change: where something came from, or where it went.
Animate only to show where something came from or went, keep it to 200ms at most, and leave it out for anyone who asked the system for less motion. In a tool used all day, motion that does not explain anything is waiting time.
Press Re-run all jobs. A Skeleton holds the place of the job that is running, and each job
that finishes fades and drops in from just above in 150ms, so the eye finds the row that changed.
With reduced motion turned on, the row fades in where it stands: @orz/ui's stylesheet takes the
drop out, as it does for its own overlays.
What moves, and how long#
The components already animate, and an app adds little to them. This is how the default style moves them; another style may move a part its own way.
| What | Motion | Duration |
|---|---|---|
| A menu, popover, select, hover card or tooltip | Fades in where it stands | 100ms |
| A dialog and its overlay | Fades in where it stands | 100ms |
| A sheet | Fades in and slides 12px in from its edge | 100ms |
A menu, FilterMenu or select on a phone | Fades in and slides 12px up from the bottom edge, as a sheet does; a submenu takes its place without moving, and one sheet handing over to another plays nothing | 100ms |
| An auto-hiding header, once scrolling stops | Settles fully in or out | 150ms |
A block a link jumps to (revealBlock) | A tint that fades out | 2s |
A Skeleton | Pulses until the content arrives | until then |
A DelayedSkeleton | Fades in once the wait has lasted 500ms; a quicker load shows nothing | 150ms |
Mail's thread toolbar. Hover Archive for its tooltip, open More actions for the menu,
Keyboard shortcuts for the dialog, and Folders for the sheet: each fades in, and none moves
further than it takes to show where it came from. The Skeleton is in the run above; the
auto-hiding header and revealBlock need a page that scrolls, and their Storybook pages show them.
Motion of your own stays in the same range: 100 to 150ms for something small appearing, up to 200ms for something that crosses the screen. Something entering eases out (fast, then settling); something leaving eases in. Leaving is quicker than entering, because nobody needs to watch a thing go.
When not to#
- Not while a finger drives it. A sheet dragged by a thumb, a header pulled by a scroll, a slider: the element follows the finger with no transition, and animates only to settle once the finger lets go. A transition there trails the finger and feels broken.
- Not on what the user is reading. A list that re-sorts, a log that appends, a value that updates in place: change it, do not slide it. Motion draws the eye, and the eye was busy.
- Not to fill a wait. A spinner or skeleton says something is coming; it does not make it arrive sooner. A result that comes back within a few hundred milliseconds needs no loading state at all.
- Not in a loop. Anything that moves on its own for more than five seconds needs a way to stop
it (WCAG 2.2.2); a
Skeletonstops by being replaced.
Put movement of your own behind motion-safe:, as in a chevron that turns with
motion-safe:transition-transform, so only people who have not asked for less see it.
- Retry design
- Release 0.4 checklist
- Job states
Animate layout (height, width, position of large areas) or loop an animation for attention. It costs frames on a phone and makes some readers dizzy.
Reduced motion#
People who get motion sick, or who find movement distracting, turn on Reduce motion in their
system settings, and the browser reports it as prefers-reduced-motion: reduce. Honouring it is
one of the rules on Accessibility.
@orz/ui's overlays already honour it. A menu, popover, select, hover card, tooltip, dialog or sheet keeps its fade and drops any zoom or slide its style gives it, and the auto-hiding header snaps instead of settling. It comes with@orz/ui/styles.css, with nothing to turn on, and covers any markup of your own drawn with the sameanimate-in/animate-outclasses (slide-in-from-*,zoom-in-*,spin-in-*,blur-in-*).- Reduced means a fade, not nothing. Opacity still changes, so something appearing reads as arriving rather than blinking in; translation, scale, rotation, blur and parallax go.
- Motion you add any other way is yours to gate. A transform transition, a keyframe of your
own or Tailwind's
animate-bouncegoes behindmotion-safe:(or is undone withmotion-reduce:); motion driven from script checksmatchMedia("(prefers-reduced-motion: reduce)")first, as@orz/ui-content's image viewer does before it eases its pane to a new height. - A spinner keeps spinning, because the motion is the status, and a small transition that
answers the hand directly, such as a
Switchthumb crossing its track, stays too.
On each platform#
- Pointer. Hover feedback is a colour change with
transition-colors, never a movement. - Touch. A press shows at once, with no transition to wait for, and nothing moves under the finger before it lifts.