Framework · Motion & interaction · 3 min read
Animation performance checklist
Six checks that keep motion smooth on a slow phone: animate transform and opacity, respect the frame budget, use will-change sparingly, keep the first frame of feedback immediate, count the weight of animation files and measure in the browser's developer tools.
Animate transform and opacity; they can skip layout and paint.
Slide, scale, fadeAbout 10 ms of each 16.7 ms frame is yours at 60 Hz.
Miss it and frames dropwill-change only where a real problem shows, removed after.
Layers cost memoryPaint flashing and a throttled recording, on a slow device.
Not the designer's laptop1,000 ms ÷ 60 frames = 16.7 ms per frame · about 10 ms of it is your work
Use it when
- You design a transition that moves, resizes or blurs something large.
- An animation judders on a phone and looks fine on your laptop.
- You review a motion spec or a pull request before it ships.
How to use it
- Check the properties. Slide, scale, rotate and fade with
transformandopacity. Avoid animatingwidth,height,topandleft; they make the browser lay out and paint again on every frame. Output: every row of the spec uses transform or opacity, or says why not. - Redesign the expensive ones. A panel that pushes content aside by changing its width becomes a panel that slides over it. An expanding card animates a scale or a clip, then settles the layout once at the end. Output: the same idea, with cheaper motion.
- Watch paint-heavy effects. Shadows, blurs and filters are paint. A small button's shadow is fine; a large blurred background animating every frame is not. Output: no large paint effect that animates continuously.
- Use will-change only for a real problem. It puts an element on its own layer in advance, and layers cost memory. Add it where you measured a problem, on elements that are about to change, and remove it after. Output: no
will-change"to make it faster". - Keep the first frame immediate and the files light. INP counts how long people wait before anything changes, so the press state can't wait for heavy script. Count Lottie or Rive files and their players in the page weight. Output: feedback on the next frame, and animation files inside the page budget.
- Measure on a slow device. In Chrome DevTools, turn on Paint flashing in the Rendering panel, then record in the Performance panel with CPU throttling and look for long frames. Output: a recording, not a hope.
Worked example
A task app for small teams opens the filters panel by animating its width from 0 to 360 px, which pushes the board aside. On the designer's laptop it's smooth. On a mid-range phone, recorded with CPU throttling, it drops frames and the board jumps, a layout shift people notice.
The designer and a developer go through the checklist. The panel now slides in over the board with transform: translateX(), the board doesn't move, and the backdrop fades with opacity instead of animating a blur. Paint flashing shows only the panel's first frame repainting. The same recording now has no long frames. The spec lists the two properties and a reduced-motion version: a fade of 150 ms.
Watch out for
- Testing on the designer's laptop. It hides almost every problem. Throttle the CPU, or use a real older phone.
- Animating height to open accordions. It's the most common layout animation. Animate a clip or a scale, or open it without motion.
- will-change everywhere. If a spec needs it on everything, the motion animates the wrong properties.
- Trusting an old lookup table. The cost of a property changes between browsers and versions. A measurement in your browser beats a list online.
Template
Paste this under the motion spec and tick it before handoff.
Pattern: ...
[ ] Animates only transform and opacity (or: ... because ...)
[ ] No layout properties animated (width, height, top, left, margin)
[ ] No large blur, shadow or filter animating every frame
[ ] will-change: none / only on ..., removed after
[ ] First frame of feedback is immediate (INP)
[ ] Animation files: ... KB, inside the page budget
[ ] Measured: Paint flashing + Performance recording, CPU throttled, on ...
[ ] Reduced-motion version: ...
- Designing Interface AnimationVal HeadBook · 2016 (Amazon)
- Rendering performanceweb.dev (external site)
- How to create high-performance CSS animationsweb.dev (external site)
- will-changeMDN (external site)
- Rendering performance in DevToolsChrome for Developers (external site)
"See on Amazon" links are affiliate links. As an Amazon Associate I earn from qualifying purchases, at no extra cost to you.