Designing Motion Tokens for Web Interfaces
Choose motion timing and spring values while respecting reduced-motion preferences.
When adding animation to a web interface, start by asking what it helps people understand, not how many milliseconds it should last. Once the purpose is clear, you can manage timing and motion intensity with tokens and provide an alternative for people who prefer less movement.
Purpose of UI Motion
A brief color change after a button press or a panel opening can confirm the result of an action. Decorative animation that repeats without conveying useful information can pull attention away from the task.
For example, when a save button changes to a check mark, the important feedback is “saved,” not a dramatic spin. Color or an icon can communicate the result on its own, with a short motion as a secondary cue. The state should remain clear when motion is removed.
Duration and Easing Tokens
When components each use different transition times, the same product can feel uneven. A small set of purpose-based steps such as --duration-fast, --duration-base, and --duration-slow gives the team a shared starting point that is easy to adjust.
:root {
--duration-fast: 120ms;
--duration-base: 180ms;
--duration-slow: 260ms;
}
.button {
transition: background-color var(--duration-fast) ease-out;
}
.dialog {
transition: opacity var(--duration-base) ease-out,
transform var(--duration-base) ease-out;
}
These numbers are starting points, not rules. Keep a small color change brief; give a panel that changes the page context a little more time, then review it on real devices. A long travel distance or a large scale change can feel more intense even when the duration is the same.
Duration and easing are different decisions. Duration sets how long a transition takes; easing describes how its speed changes over that time. A simple curve may be enough for a button color change, while a panel appearing and disappearing may benefit from a curve that settles gently. Instead of treating every curve as ease-out, define a few named curves for the project and apply them consistently to components.
Spring Strength, Stiffness, and Damping
A spring animation expresses tension and damping as an element approaches its target. It can make a small interaction, such as selecting a star rating, easier to notice. More numbers do not automatically make motion more refined. If an interface exposes stiffness, damping, and strength controls, show how each value changes the result.
Quark’s theme preview is one example of this kind of exploration. You can adjust motion strength and spring values, then see the result in the star-rating and character-limit examples. These are Quark preview settings, not official motion tokens for the brands featured there. Nor does every Quark movement use the same spring settings: CSS transitions can use a separate duration and component-specific rules.
When exporting tokens, check the code that consumes them. A token name that is declared but never read by a component is not an adjustable system. Review each token with its behavior: which transitions change when --duration changes, and does setting strength to zero preserve the state change while making it immediate?
Reduced Motion and Accessibility
On the web, the operating system’s reduce-motion preference can be detected with the prefers-reduced-motion media feature. When the preference is enabled, reduce decorative movement or scaling, or replace it with a static presentation. If animation is essential to the information or function, preserve that information and function.
.panel {
opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
.panel {
transition: opacity var(--duration-base) ease-out;
}
}
This example applies the transition only when the user has not requested reduced motion. A tab change or an opened dialog should still be clear through text, a selected indicator, or focus position. prefers-reduced-motion is one way to respect a system preference; it does not solve accessibility by itself. Check keyboard operation, focus movement, and status announcements separately.
Motion Implementation Checklist
Before finishing, try common interactions such as buttons, menus, tabs, and dialogs. Confirm that token changes reach the intended views. Also check that setting strength or duration to zero does not hide content or block interaction.
Motion tokens are not just a table of numbers that controls movement. They encode repeated team decisions in code. Keep movements whose purpose you can explain, manage timing and easing consistently, and make sure the interface still communicates its result when motion is reduced. That makes the experience more predictable.