- Docs
- Foundations
- 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
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
No motion: the change is immediate.
Hover and press feedback.
Small surfaces: tooltips, menus, toggles.
Dialogs, drawers, sheets.
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
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.
Enter
200msFades in and rises 4px, slowing to rest.Exit
100msFades 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.
| Change | Duration | Easing |
|---|---|---|
| Hover and press feedback | 100ms | |
| A size, a position or a colour changes | 200ms | |
| A tooltip, menu or toggle opens | 200ms | |
| It closes | 100ms | |
| A dialog, drawer or sheet opens | 300ms | |
| A full-screen transition | 400ms | |
| Progress and other continuous motion | Set by the work |
05
Springs
For native platforms; the web uses durations and curves.
| Export | Stiffness | Damping ratio | Overshoot | SwiftUI response |
|---|---|---|---|---|
| SPRING.gentle | 200 | 1 | None | 0.444s |
| SPRING.snappy | 400 | 0.9 | 0.15% | 0.314s |
06
In code
In CSS the tokens already honour reduced motion; in JavaScript, check it yourself.
/* 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. */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,
});