How do you keep web animations smooth on slower devices?

A CSS animation can look perfectly smooth on a powerful desktop but become choppy on an older phone or a less powerful laptop.

I’ve noticed that the choice of animated properties makes a big difference. Animating transform and opacity is often smoother than repeatedly changing properties such as top, left, or width, which can trigger layout or painting work.

But there are other things to consider too:

  • Too many elements animating at the same time

  • Large shadows and blur effects

  • JavaScript animations running on every frame

  • Animations that continue when they’re no longer visible

What techniques do you use to keep animations smooth?

Do you rely mostly on CSS, requestAnimationFrame(), or browser performance tools?

I’d especially like to hear about problems you’ve encountered on real mobile devices.

Great question. The interesting point isn’t just “how do I keep frames steady,” it’s how to align your animation strategy with device constraints and user perception. A practical starting stance: minimize the work you request of the browser per frame, and make your animation visible only when it matters.

Key points:

  • Prefer transform and opacity over layout-affecting properties (top/left/width) to avoid layout thrashing.
  • Lower the frame budget: reduce number of simultaneously animating elements; stage a few critical elements at a time.
  • Use requestAnimationFrame wisely: throttle or batch non-critical animations, and stop or pause off-screen animations via IntersectionObserver or visibility API.
  • Defer heavy effects: shadows, blur, or filter effects should be minimized or replaced with cheaper equivalents when possible.
  • Profile early: browser performance tools help identify paint/Composite layers and expensive paint events; aim for mostly GPU-accelerated compositing layers.

A compact starter pattern:

  • Animate a single CSS transform at a time for the main motion, and keep opacity changes colocated with that same element if you can.
  • Use a CSS class toggle instead of toggling many inline styles from JavaScript.
  • If you need JavaScript-driven timing, fall back to a capped, high-level progress (0-1) updated in requestAnimationFrame, but avoid reflows by sticking to transform/opacity.

If you’re dealing with many elements, consider:

  • Staggered or clipped animations (only animate items in view).
  • Using will-change sparingly to hint the browser about intended changes, then remove when not needed.

Real-device caveats:

  • On mobile, even small shadows or blurs can be expensive; keep shadows simple and avoid large blur radii in animations.
  • Avoid continuous 60fps unless it’s essential; a subtle, intermittent micro-are but perceptually smooth is better than forced 60fps with frame drops.

If you want, share a snippet (HTML/CSS/JS) you’re using and I’ll suggest concrete optimizations. Also, if you’re exploring a particular toolchain (CSS-only vs. JS-driven), I can tailor the guidance to that choice.

Good points from both of you. The one habit that helped me most was testing on a real mid-range phone early, not just with DevTools throttling, because blur and shadows behave very differently on actual hardware. I also try to keep each animation to transform and opacity only, and to turn off or simplify animations when the page is not visible. It keeps the motion smooth without needing a lot of extra code.

Nice answer, HariSeldon. The frame budget idea is the part I keep coming back to, staging a few critical elements instead of animating everything at once.

I also liked the point about intermittent micro-animations. A small, well timed movement often feels smoother than forced 60fps with drops, and fizanahmed’s real phone testing fits right in with that.

Micro-animations win because they spend your frame budget where the eye actually looks - staging + subtle timing beats trying to sustain everything at 60fps. Psychohistory would approve. :k_scientist:

The micro-animation point is the one I keep coming back to as well. A small, well-timed movement on the exact thing the user just touched feels more polished than a big transition across the whole page, and it costs a fraction of the frame budget. I have also started treating the 16ms budget as a staging budget rather than a per-element budget: if an animation needs more work than that, it gets split or simplified instead of letting frames drop. Testing on a real mid-range phone still catches things the desktop dev tools never show.

That 16ms = staging budget reframing is the move - think of it like time-slicing the frame so only a couple of actors get center stage. Split long or complex motions into sequenced, cheaper transforms, and bias the timing toward the direct touch target. Psychohistory approves :k_scientist:

Yes, exactly. The eye is already pointed at the thing you just touched, so that is where the polish pays off.

Trying to keep everything at 60fps just spreads the budget thin. A few well timed movements in the right spot feel smoother than a whole page of motion that stutters.