Skip to main content
  1. Docs
  2. Foundations
  3. 05 of 05

Motion

Quick, productive motion: nothing runs past 400ms, and every duration is 0ms under reduced motion.

Durations
50 to 400ms
Easings
5Standard, enter, exit and more
Longest
400msNothing runs past it
Reduced motion
0msEvery duration
Motion
Reduced is what people who ask their system for less motion get

01

Duration

How long a change takes, scaled to how much moves. Play runs every step at once.

Every duration is 400ms or less; the longest is 400ms

Scale
0ms · DURATION.instant
No motion: the change is immediate.
100ms · DURATION.fast
Hover and press feedback.
200ms · DURATION.normal
Small surfaces: tooltips, menus, toggles.
300ms · DURATION.slow
Dialogs, drawers, sheets.
400ms · DURATION.slower
Large or full-screen transitions.

02

Easing

How a change speeds up and slows down. All share one duration, so only the shape differs.

Curves
standardcubic-bezier(0.65, 0, 0.35, 1)Something that stays on screen changes: a size, a position, a colour.
entercubic-bezier(0.25, 1, 0.5, 1)Something arrives: decelerates to rest.
exitcubic-bezier(0.32, 0, 0.67, 0)Something leaves: accelerates away.
emphasizedcubic-bezier(0.16, 1, 0.3, 1)Large movements — drawers, page-level transitions.
linearlinearProgress and other continuous motion.

03

Enter and exit

A toast arrives at normal and decelerates; it leaves one step faster and accelerates.

Toast
Session expires in 5 minutes
Save your changes to keep them.
Enter200msFades in and rises 4px, slowing to rest.
Exit100msFades out and drops 4px, speeding away.

04

Which to use

Everyday changes and the duration and curve each takes. Closing is always a step faster than opening.

The duration and easing for everyday changes
ChangeDurationEasing
Hover and press feedback100ms
A size, a position or a colour changes200ms
A tooltip, menu or toggle opens200ms
It closes100ms
A dialog, drawer or sheet opens300ms
A full-screen transition400ms
Progress and other continuous motionSet by the work

05

Springs

For native platforms; the web uses durations and curves.

Springs
ExportStiffnessDamping ratioOvershootSwiftUI response
SPRING.gentle2001None0.444s
SPRING.snappy4000.90.15%0.314s

06

In code

In CSS the tokens already honour reduced motion; in JavaScript, check it yourself.

row-menu.css
/* A menu opens at normal and decelerates; it closes a step faster and accelerates. */
.row-menu {
  transition:
    opacity var(--qx-motion-duration-normal) var(--qx-motion-easing-enter),
    translate var(--qx-motion-duration-normal) var(--qx-motion-easing-enter);
}

.row-menu[data-closing] {
  transition-duration: var(--qx-motion-duration-fast);
  transition-timing-function: var(--qx-motion-easing-exit);
}

/* Nothing to add for reduced motion: the tokens are 0ms there already. */
panel.ts
import { DURATION, EASING } from "@qeetrix/tokens";

// The exported numbers don't follow the system setting: check it yourself.
const reduced = matchMedia("(prefers-reduced-motion: reduce)").matches;

panel.animate([{ opacity: 0, translate: "0 4px" }, { opacity: 1, translate: "0 0" }], {
  duration: reduced ? 0 : DURATION.normal,
  easing: EASING.enter,
});
Next — IconsIcons