Web animation

Web animation: a guide to motion on the web

How do you use web animation effectively without hurting performance or accessibility?

Web animation works best when it communicates state, guides attention, or confirms interaction rather than decorating a page. CSS transitions and animations handle most UI motion efficiently; JavaScript and the Web Animations API unlock sequence and physics. The critical discipline is pairing motion with purpose and always respecting prefers-reduced-motion.

Brief a project Find an agency

CSS animation versus JavaScript animation

Most interface motion should start in CSS. Transitions and keyframe animations are declarative, they run off the main thread for the properties that matter, and the browser optimizes them aggressively. A hover state, a panel sliding in, a color easing on focus: these are CSS work, and reaching for JavaScript to do them is usually adding complexity and cost for no benefit. The rule of thumb is that if a transition or a simple keyframe sequence can express the motion, CSS is the right tool.

JavaScript earns its place when the motion needs to be orchestrated, interrupted, or driven by something the browser cannot know in advance. Sequencing many elements with precise overlapping timing, animating to a value computed at runtime, springing toward a moving target, or tying motion to scroll or pointer position are all cases where a JavaScript approach or the Web Animations API gives you control that CSS cannot. The two are not rivals; a mature project uses CSS for the common cases and JavaScript for the few that genuinely need it.

Performance budgets and compositor-only properties

The single most important performance fact in web animation is that not all properties are equal. Animating transform and opacity can be handed to the compositor and run smoothly without forcing the browser to recalculate layout or repaint large areas. Animating properties like width, height, top, left, or margin forces layout work on every frame, which is expensive and janky once a few of them run at once. Knowing this distinction is most of what separates smooth motion from stuttering motion.

A practical animation budget means deciding in advance how much motion a screen can afford, then designing within it. Prefer transform and opacity. Animate the smallest area you can. Be skeptical of animating many elements at once, especially on long lists. And test on a mid-range phone rather than a fast laptop, because the laptop will hide problems that real users feel every day. Motion that looks effortless almost always reflects deliberate restraint about what is animated and how.

The principles of motion applied to UI

The animation principles developed for character animation translate surprisingly well to interfaces, with adjustments for the fact that users are waiting on the result rather than watching a film. Easing matters most: motion that starts and stops abruptly feels mechanical, while motion that accelerates and decelerates feels physical and calm. Things that are related should move together, and things that are causally linked should move in a way that shows the cause, so the user reads the relationship without thinking about it.

Timing is the other half. Interface motion has to be fast enough that it never makes the user wait, yet slow enough to be perceived and understood. Very short durations feel snappy and respectful of the user's time; longer ones are reserved for moments where the motion itself is carrying meaning, like a large transition that explains where you just went. The discipline is to keep functional motion brisk and save the expressive, slower motion for the rare moments that deserve it.

prefers-reduced-motion and accessibility

A meaningful number of people experience discomfort, dizziness, or nausea from large or unexpected motion, and some simply prefer a calmer interface. The prefers-reduced-motion media query lets them tell the system, and respecting it is not optional polish; it is a basic accessibility responsibility. When that preference is set, large parallax moves, sweeping transitions, and autoplaying motion should be reduced to something gentle or removed entirely, while essential feedback can remain in a quieter form.

Building this in is straightforward if you plan for it. Author the motion so that a reduced-motion branch is easy to provide, rather than bolting it on at the end. Crucially, reducing motion should not remove information: if an animation was the only thing communicating that something changed, the reduced version still has to communicate that change, just without the movement. Done well, the reduced-motion experience is not a degraded one; it is simply a calmer path to the same understanding.

SVG animation

SVG is uniquely suited to animation because it is resolution-independent and every part of the graphic is a real element you can target. You can animate a path drawing itself, morph one shape toward another, animate strokes and fills, and move pieces of an illustration independently, all while staying crisp at any size. For icons, logos, diagrams, and illustrative motion, SVG often gives you a quality and flexibility that raster approaches cannot match at a fraction of the file weight.

The techniques range from simple CSS transitions on SVG attributes to full timeline control with JavaScript libraries. Drawing a line by animating its stroke, revealing an illustration piece by piece, and looping a small ambient detail are all well within reach. The main caution is complexity: a very intricate SVG with many animated nodes can become a performance problem, so the same budget discipline applies. For most icon and illustration work, though, SVG animation is the cleanest tool available.

The animation library landscape

You do not always need a library, but a good one saves real time on complex work. GSAP is a long-established and widely used animation platform known for precise timeline control, broad browser handling, and a large ecosystem; it shines when you need to sequence many elements with exact, interruptible timing. The Web Animations API is built into modern browsers and gives you a native, dependency-free way to drive keyframe animations from JavaScript, which is attractive when you want control without adding weight.

Newer libraries such as Motion focus on a small, modern API and spring-based physics that feel natural with little tuning, and framework-specific animation tools bring motion into component models cleanly. The right choice depends on the project, not on fashion. Reach for a library when the orchestration is genuinely hard, prefer native tools when the need is simple, and evaluate any dependency by what it adds to your bundle and your maintenance burden. There is no single correct answer, only the one that fits the work in front of you.

Lottie for production workflows

Lottie is a format and set of players that render animations exported from professional motion-design tools as vector data the browser can play back. Its appeal is the workflow: a motion designer can craft something genuinely sophisticated in their own software, export it, and have a developer drop it into a page without rebuilding the animation by hand in code. That handoff is where a lot of time and faithfulness is usually lost, and Lottie closes much of that gap.

The trade-offs are worth knowing. A Lottie animation is only as light and performant as the source file; a complex composition with many layers and effects can be heavy to render, so the design has to be made with playback cost in mind. It is also less interactive than hand-coded motion, since it plays a pre-authored sequence rather than responding fluidly to live state, though players do expose ways to control and segment playback. For self-contained illustrative animations and onboarding moments, it is an excellent production tool.

What to know

Key things to weigh here

Work with us

Brief a project, or list your studio

Each option below is a clearly-marked placeholder until the operator wires it to a real system. Tell us what you want to build, or add your studio to the directory, and the right specialist follows up.

Showcase Interactive web animation showcase

Reserved for a live gallery of interactive work and demos. This static guide does not embed third-party showcases; this connects to a curated showcase feed once configured.

Showcase feed pending
Project brief Brief us on your web animation project

Self-hosted project-brief form. Tell us what you want to build and a specialist follows up. Placeholder endpoint until wired to the operator's CRM.

Open project brief →
Studio listing List your studio in the web animation directory

Self-hosted studio-listing form for agencies and freelancers. Placeholder endpoint until wired to the operator's CRM.

Open studio listing →

Project brief

This form is a placeholder until connected to Go Interactive's system; it does not yet deliver. No obligation. We do not sell your information. This is general information, not professional advice.

Studio listing

This form is a placeholder until connected to Go Interactive's system; it does not yet deliver. No obligation. We do not sell your information. This is general information, not professional advice.

Questions

Frequently asked questions

Does web animation slow down my site?
It can, but it does not have to. Animating compositor-friendly properties like transform and opacity is cheap, while animating layout properties is expensive and causes stutter. The bigger risks are large animation libraries that bloat your bundle and heavy autoplaying motion that competes for resources at load. Measured, purposeful animation on capable properties has a negligible effect; careless animation is one of the most common causes of jank.
Should I use a library or write animations by hand?
Write simple motion by hand in CSS, since libraries add weight you do not need for a hover or a fade. Use a library when the orchestration is genuinely difficult: many elements with precise overlapping timing, interruptible sequences, or physics-based motion. The decision is about the complexity of the work, not the prestige of the tool. Always weigh what the dependency adds to your bundle and your long-term maintenance.
What is prefers-reduced-motion and do I have to support it?
It is a system-level setting users enable when they want less motion, often because animation causes them discomfort. Browsers expose it as a media query you can respond to. Supporting it is a baseline accessibility responsibility, not an optional extra. The key is that reducing motion must not remove meaning: if an animation was the only signal that something changed, the calmer version still has to convey that change.
Why does my animation stutter on phones but not on my laptop?
Your laptop is far more powerful and hides problems that real devices feel. Stutter usually comes from animating expensive properties, running too many animations at once, or doing heavy work on each frame. Switch to transform and opacity, reduce the number of simultaneously animated elements, and profile on a mid-range phone. The fix is almost always doing less work per frame rather than a more powerful technique.
What is the difference between a transition and an animation in CSS?
A transition smoothly interpolates a property from one value to another when that value changes, which is perfect for state changes like hover or focus. A keyframe animation defines a sequence of states the element moves through and can loop or run on its own without a triggering change. Transitions are simpler and cover most interactive feedback; animations are for motion that is sequenced or self-driven.
Is Lottie better than coding animations directly?
Neither is better in general; they solve different problems. Lottie excels at carrying complex illustrative animation from a motion designer's tool into production without rebuilding it by hand, which preserves intent and saves time. Hand-coded animation excels when motion must respond fluidly to live application state. Many projects use both: Lottie for self-contained illustrative moments, code for interactive feedback that depends on what the user is doing.

Go Interactive publishes educational guides about interactive digital experiences and design. Content is for general information only and does not constitute professional advice. Tool recommendations and agency mentions are informational; verify capabilities and costs directly. We use clearly marked affiliate and partner placeholders.