Marcus Andrey Study
Ler em português Library

Motion and Interaction · For leads · 5 min read

Motion, performance and budgets

For leads: motion costs frames, main-thread time and page weight, and users pay for it on their slowest phone. How motion relates to Core Web Vitals (INP and CLS), what a performance budget is, and how to write and enforce a motion budget a team can check.

An animation that stutters on a cheap phone tells people the product is broken, however good it looked on the designer's laptop. Motion isn't free: every frame has to be computed, every animation file has to be downloaded, and every busy moment delays the next tap. A lead can't review every animation. What they can do is agree on a budget, write it as limits anyone can check, and make the checks automatic.

What you'll be able to do after reading:

  • Explain what motion costs, in terms a developer would use
  • Connect motion to INP and CLS, two of Google's Core Web Vitals
  • Write a motion budget as checkable limits
  • Build the checks into the team's process

1. A budget a team can check

Budget lineLimitWhyHow you check it
ResponsivenessINP of 200 ms or less, at the 75th percentileThe press state has to reach the next paint; a busy main thread delays itField data (Chrome UX Report, your RUM), web.dev thresholds
StabilityCLS of 0.1 or less, at the 75th percentileAnimating top or height moves the layout; transform doesn'tField data and Lighthouse
Propertiestransform and opacity only, unless the reason is written in the specThey can run on the compositor; layout and paint properties drop framesCode review; DevTools Performance panel
DurationUnder 150 ms for anything used dozens of times a day; 400 ms at most for transitionsAtlassian's ranges; long motion makes a fast product feel slowOnly tokens allowed; a lint rule for raw ms values
FocusOne focal animation at a timeCompeting motion splits attention and costs framesCritique
WeightExample: 50 KB compressed per Lottie or Rive file, and its player counted in the JavaScript budgetAnimation files and players are page weight like any image or scriptBundle size check in CI
Reduced motion100% of moving patterns have a fallbackWCAG 2.3.3 and 2.2.2; the people who need it mostThe spec card field is required; quarterly audit
A motion budget, written as limits a team can check. The first two lines are Google's published Core Web Vitals thresholds; the weight line is an example, set your own from your pages.Sheet: Marcus Andrey, CC BY 4.0. Thresholds: web.dev (INP, CLS). Duration ranges: Atlassian Design System, Motion.

A performance budget is "a set of limits imposed on metrics that affect site performance" (web.dev, Performance budgets 101). The article describes three kinds: limits on quantities, like file sizes; limits on timings, measured in the browser; and limits on scores from tools like Lighthouse. A motion budget uses all three. The figure is one, written for a product team.


2. What motion costs

To show a frame, the browser may have to work out the layout, paint the pixels and composite the layers. Animating transform and opacity can skip the first two; animating width, top or a shadow can't. The web.dev guide is direct: "restrict animations to opacity and transform to keep animations on the compositing stage" and "avoid any property that triggers layout or paint unless it's absolutely necessary" (web.dev, How to create high-performance CSS animations).

The same guide measures smoothness by dropped frames. In its example, moving a box with top and left dropped 50% of the frames; moving it with transform dropped 1%. That difference is invisible on a fast laptop and obvious on an old phone.

The rest of the cost is weight. A Lottie or Rive file, and the player that runs it, are downloaded like any image or script (see Lottie, Rive and handing off motion). Count them in the page's budget.


3. Motion and Core Web Vitals

Two of Google's Core Web Vitals touch motion directly:

  • Interaction to Next Paint (INP) measures how long the page takes to respond to clicks, taps and key presses, from the interaction until the browser can paint the next frame. 200 ms or less is good; over 500 ms is poor; sites are judged at the 75th percentile of page loads (web.dev, INP). INP doesn't measure your animation's duration. It measures how long people wait before anything changes, so the first frame of the press state counts. Heavy script running on a tap delays it.
  • Cumulative Layout Shift (CLS) measures unexpected movement of the layout. 0.1 or less is good; over 0.25 is poor. The CLS article says it plainly: the "transform property lets you animate elements without triggering layout shifts", so use transform: scale() instead of changing height and width, and translate() instead of top or left (web.dev, CLS).

So the two rules that keep animations smooth, transform and opacity and an immediate first frame, are also the rules that keep these metrics healthy. Designers and developers can argue for the same thing with the same numbers.


4. Write the budget

Start from the figure and adjust:

  1. Take the published thresholds as they are. INP 200 ms and CLS 0.1 at the 75th percentile are Google's; don't invent your own.
  2. Set the motion rules from your system. Durations from tokens, frequent feedback under 150 ms, transitions up to 400 ms, as in Atlassian's ranges (Atlassian, Motion). Properties limited to transform and opacity.
  3. Set weight limits from your own pages. Measure what animation files you ship today, and set a limit you can keep. The 50 KB in the figure is an example, not a standard.
  4. Write one line on reduced motion. Every moving pattern has a fallback (see Designing a reduced-motion version).

5. Make the checks automatic

A budget nobody checks is a wish. The performance budgets article suggests building checks into the build, with tools such as Lighthouse CI, and watching real-user data after launch (web.dev, Performance budgets 101). For motion:

  • A lint rule that rejects raw ms and cubic-bezier() values outside the token file.
  • A bundle size check in CI for animation files and players.
  • Field data for INP and CLS on the pages with the most motion.
  • A slow phone on the team's desk. Every new pattern is seen on it before it's accepted (see Motion in design system governance).
  • Critique for what tools can't see: one focal point, purpose, feel (see Reviewing motion in critique).

Lara Hogan's Designing for Performance makes the case that speed is part of design, not only engineering. Motion is where that's easiest to see.


6. Common mistakes

  • Reviewing motion only on fast laptops and new phones.
  • Treating performance as engineering's problem, after the design is approved.
  • Animating height, width or top because it was easier to build.
  • Heavy work on the main thread when someone taps, so the press state arrives late.
  • Animation files and players left out of the page weight.
  • A budget with invented thresholds, instead of the published ones.

7. Try it (no tools needed)

  1. Pick the animation in your product you're proudest of.
  2. Write down which properties it animates and how heavy it is.
  3. Check it against the budget in the figure. Which line does it break?

Reflection questions: What's the slowest device your users actually have? Has anyone on the team ever used your product on it?


Checklist

Learn more

Books, courses and videos to go deeper

Book links go to Amazon. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.

Motion performance · Motion in design system governance · Reviewing motion in critique · Lottie, Rive and handing off motion · Motion tokens · Animation performance checklist

Saved only on this device.

↑ ↓ to move · Enter to open · Esc to close