Skip to content
UX PrinciplesChapter 47 / 57Advanced10 min read

Motion & Design Iteration

UI animation duration and easing rules, one duration scale, one curve with no bounce, reduced motion, and a way to compare design alternatives properly.

On this page

1. What is this practice?

This chapter has two parts. The first is motion: how long animations run, which curve to use, what to animate and what not to. The second is design iteration: how to create several design options for one screen, name them and compare them.

GroupRules
DurationOnly one scale: 115, 185, 300, 485, 785 ms. Exit is shorter than entrance
CurveOne curve everywhere, in both CSS and JS. No overshoot or bounce
What to animateOnly transform and opacity. Not width, height, top or left
BehaviorEvery animation shows cause and effect, can be interrupted midway, and respects reduced motion
ListsA clean clip, not a fade mask
DebuggingDo not guess, read the size, computed style and animations from the browser
IterationA new direction gets a number, a variation gets a letter (2a, 2b), compare at real size with the same data, match references exactly, variations come from a prop, not a copied file

2. Why does it matter?

Nielsen Norman Group's old but still valid research on response times says: about 0.1 second feels instant, and up to 1 second the user's flow is not broken. That is why animations of roughly 100 to 500 ms feel "responsive", and longer ones feel "slow".

The scale is built around 300 ms (about the length of a blink) and moves up and down by the golden ratio (1.618): divide 300 by 1.618 to get 185, then 115. Multiply to get 485, then 785. When every duration comes from one scale, the whole app feels made of one "material". If every component has its own timing and curve, it feels like four different products stuck on one screen.

Bounce and overshoot grab attention, feel like a toy and slow down work. Some users get dizzy or nauseous from motion, so respecting the operating system's "reduce motion" setting is part of accessibility.

There is a performance reason too: animating width or height makes the browser recalculate layout on every frame, and the animation stutters. transform and opacity run on the compositor and stay smooth.

Motion without a systemWith a scale and one curve
transition: all 0.2s in one file, 250ms ease-in-out in anotherEvery duration comes from a token
The card bounces, the toast is linearOne curve everywhere
The drawer's width is animated, scrolling stuttersThe drawer's transform is animated, smooth
Reduce motion is on, yet everything still spinsMovement stops when reduce motion is on
A gradient fade at the end of a listA clean clip, the last row is fully visible
dashboard-final-v3-new.html1, 2a, 2b, old ones in an archive
Decision made from three small screenshotsTwo options at 1440, with the same data

3. When to follow it

LevelHow importantWhy
Learning projectOnly transform and opacity, prefers-reduced-motion, and avoiding transition: allThese three habits protect both performance and accessibility
Production codeDuration and curve tokens, no hardcoded ms, short exitsWhen every developer adds their own timing, the product feels scattered
Senior levelDefine the motion scale, run the design options process, ask for measured numbers in reviewsA design system usually decays through small "just a little" changes

When to learn it: after learning CSS transitions and Tailwind, when you are animating your first drawer, dialog or dropdown. Learn the iteration process when you work on two design options for one screen.

4. Bad vs good code

Bad motion

css
.card {
  transition: all 0.2s ease-in-out;
}

.drawer {
  width: 0;
  transition: width 250ms cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.drawer.open {
  width: 400px;
}

.list {
  mask-image: linear-gradient(to bottom, black 80%, transparent);
}

Good motion

Tokens in one place:

css
:root {
  --duration-press: 115ms;
  --duration-quick: 185ms;
  --duration-blink: 300ms;
  --duration-glide: 485ms;
  --duration-drift: 785ms;
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer {
  width: 400px;
  transform: translateX(100%);
  transition: transform var(--duration-quick) var(--ease-standard);
}

.drawer[data-state="open"] {
  transform: translateX(0);
  transition-duration: var(--duration-blink);
}

.list {
  overflow: auto;
}

@media (prefers-reduced-motion: reduce) {
  .drawer {
    transition-property: opacity;
  }
}

--ease-standard is a curve like a critically damped spring: fast start, gentle stop, and it never goes past the target. The y values of the bezier never go above 1, so there is no overshoot.

The drawer takes 300 ms to open and 185 ms to close, because a transition always uses the duration of the new state. Exit should be shorter than entrance: the user has already closed it, so why make them wait. CSS transitions can be interrupted midway and reversed, so the user can close the drawer halfway through.

JS animations should read the same tokens, not their own values:

ts
export function slideIn(element: HTMLElement) {
  const styles = getComputedStyle(document.documentElement);
  const duration = Number.parseFloat(styles.getPropertyValue("--duration-blink"));
  const easing = styles.getPropertyValue("--ease-standard").trim();

  return element.animate(
    [{ opacity: 0, transform: "translateY(8px)" }, { opacity: 1, transform: "none" }],
    { duration, easing }
  );
}

In Tailwind too, use only the values from the scale: duration-115, duration-185, duration-300, duration-485, duration-785, and define the curve in the theme as --ease-standard and use it with the ease-standard utility. The motion-reduce: variant handles reduced motion.

What is the difference?

BadGoodRule
transition: all 0.2stransition: transform + tokenOne scale, only the needed property
Animating widthAnimating transformLayout is not rebuilt every frame
-0.55 and 1.55 in the beziery values between 0 and 1No bounce
Open and close at the same speedOpen 300, close 185Short exit
No mention of reduced motionOnly opacity in the media queryAccessibility
mask-image fadeoverflow: autoClean clip

5. How to apply it

How to add an animation
Ask: what cause is this motion showing the effect of?
Pick a duration from the scale: small element, short duration
Animate only transform and opacity
Apply the shared curve token
Keep the exit one step shorter
Check with reduce motion turned on
TokenDurationWhere
press115 msHover, button press feedback
quick185 msTooltip, small state change, exits
blink300 msOpening a drawer, dialog or panel
glide485 msPage transition, large surface
drift785 msRarely, large background movement or one turn of a spinner

When an animation does not run at all or something feels "off", measure first. In the DevTools console:

js
const drawer = document.querySelector("[data-drawer]");
const styles = getComputedStyle(drawer);

console.log(drawer.getBoundingClientRect());
console.log(styles.transitionDuration, styles.transitionTimingFunction);
console.log(drawer.getAnimations().map((animation) => animation.transitionProperty ?? animation.animationName));

A common cause is a typo in a custom property, like var(--duration-blinkk). The browser gives no error, the property falls back to its initial value of 0s, and the animation silently disappears. One getComputedStyle call shows this immediately, so you do not need to stare at a screenshot.

Design iteration rules

RuleDetail
Number and letterA new direction gets the next number (1, 2, 3). A variation of the same direction gets number + letter (2a, 2b). Numbers never change, even for archived ones. Archive, do not delete, unless the owner says so
Compare at real sizeOptions at the target viewport (1440 by 900 and 390 by 844), side by side, with the same data. Thumbnails only for navigation
Match references exactlyWhen working from a screenshot or design, spacing, type, color, icons and copy must match exactly. List what you deliberately changed in the PR
Variation from a propA variation is an option (flag or prop) of the base component, not a copied file. If the last variation is dropped, remove the option too

A layout that wins in a thumbnail often breaks the first viewport budget at real size. So the decision is always made at the real size.

A good way to do variations, one component and one prop:

tsx
export function Checklist({ steps, compact = false }: { steps: SetupStep[]; compact?: boolean }) {
  return (
    <ol data-compact={compact} className="group flex flex-col gap-3 data-[compact=true]:gap-2">
      {steps.map((step) => (
        <li key={step.id} className="text-sm group-data-[compact=true]:text-xs">{step.title}</li>
      ))}
    </ol>
  );
}

If Checklist.tsx and ChecklistCompact.tsx are two files with 80 copied lines, every bug fix must be made in two places, and the two files slowly drift apart. A component with one prop removes this problem.

6. Exceptions and common mistakes

SituationWhat to do
A spinner or continuous rotationThe rotation stays linear, but the duration of one turn comes from the scale
Header or dock blurOnly when the designer asks for it
Reduced motionRemove movement, a light opacity fade or an instant state change is enough

Mistake: Using transition: all

Why? Every changing property is animated, layout ones included, and things that should not animate start moving too.

Better: Write only the property you want to animate, usually transform and opacity, together with a duration token.

Mistake: Opening an accordion by animating height

Why? Layout is rebuilt on every frame, all the content below gets pushed, and the animation stutters.

Better: Use transform or opacity, or open the content without animation. Motion is not required, smoothness is.

Mistake: A curve with bounce or overshoot

Why? The interface feels like a toy, grabs attention every time, and mixed curves on one screen feel like different products.

Better: One shared curve token that stops at the target, across the whole app.

Mistake: Choosing a design from small screenshots

Why? What looks clean in a small image can break the first screen budget at real size.

Better: Open the options at the target size, with the same data, side by side, then decide.

7. What to learn before and after

Final quick revision

CheckWhat to remember
DurationOnly 115, 185, 300, 485, 785 ms, from tokens
CurveOne shared curve, no bounce or overshoot
PropertyOnly transform and opacity
ExitShorter than entrance
AccessibilityRespect prefers-reduced-motion
ListsClean clip, no fade mask
DebugginggetBoundingClientRect, getComputedStyle, getAnimations
Naming1, 2, 2a, 2b, archive, never delete
CompareReal size, side by side, same data
ReferenceExact match, or list the changes in the PR
VariationA prop or flag, not a copied file