Does ChatGPT recommend your website?Run the free GEO check
Book a call
Motion · 7 min read

UI animation for websites: micro-interactions, loading and scroll animation

UI animation is motion in an interface that tells the visitor something: a button responds, content is loading, a section changes as you scroll. It helps when it gives feedback or explains a change. It hurts when it delays content, drops frames or ignores visitors who ask for less motion.

Pavlo Zhydkykh, Co-founder and product designer at OrangeOrange

Co-founder and product designer at OrangeOrange.

About the author
Three UI animation cards, a button press, a loading skeleton and a scroll progress bar, beside a reduce motion switch

The short answer

Animate when the motion answers a question the visitor has. Did my click work? Is the page still loading? Where am I in this story? Motion that answers none of these is decoration, and it can go.

Three kinds of UI animation cover most websites: micro-interactions, loading animations and scroll animations. Each has a job, a cost and a way to go wrong. Two rules apply to all of them. Move only the properties a browser can move cheaply. And give visitors who ask for less motion a calmer page.

The short answer
AnimationHelps whenHurts when
Hover and press states.It shows that a control reacts.The next click has to wait for it.
Toggles, form and status feedback.It shows what changed after an action.It replaces a clear text message.
Spinner or skeleton.Content takes a moment, and the visitor needs to know it is coming.It loops beside content with no way to stop it.
Full-page preloader.Nothing on the page can work until it loads.It covers content that could show already.
Scroll reveal.It marks a new section or a new step.Text starts hidden and shows up late.
Parallax and scroll-linked motion.It ties a story to the scroll.Layers move at different speeds and make some people feel sick.
Lottie loop.A feature needs a short drawn demo.It plays beside text with no pause.
Rive hero.The product idea is best shown by trying it.The message only lands after the visitor plays.

Every animation should answer a question the visitor already has.

Micro-interactions: small feedback, not decoration

A micro-interaction is a small response to one action. A button sinks on press. A switch slides. A tick appears when a form is sent. A field shakes when the value is wrong.

These help because they confirm cause and effect. The visitor acts, and the page answers at once. Keep them short. Never make the visitor wait for the motion to end before the next click.

Build them from transform and opacity. A button that sinks on press uses transform: scale(). A tick that fades in uses opacity. web.dev warns that moving an element with anything other than transform is likely to be slow. The reason sits in the section on speed below.

Loading animations: when a loader helps and when it hides the page

A loading animation tells the visitor that something is on its way. That is useful for a search result, a form submit or a chart that waits for data. Put the indicator where the wait is: a spinner on the button, a skeleton where the list will appear.

A full-page preloader is a different case. It covers the whole page until it is done, even the parts that could show now. Google measures how fast the main content appears with Largest Contentful Paint. A good score is 2.5 seconds or less, at the 75th percentile of page loads. Chromium browsers, such as Chrome, skip elements with an opacity of 0 when they pick that main element. So a hero that waits behind a loader, or fades in from zero, counts only once it shows.

A real loader is still allowed. The W3C notes on Pause, Stop, Hide treat a preload animation as essential when no one can use the page during that phase. The rule is stricter for motion that plays beside content. If it starts on its own and lasts more than five seconds, the visitor needs a way to pause, stop or hide it.

Scroll animations: reveal, progress and parallax

Scroll animation ties motion to where the visitor is on the page. A section fades in as it enters. A progress bar fills. A product turns as you read about it.

CSS can do much of this on its own. CSS scroll-driven animations move property values along a scroll timeline instead of a clock. You pick what drives the timeline with the scroll() or view() functions. Check browser support on MDN before a key effect depends on it, and keep a plain version for browsers without it.

Scroll motion hurts in two ways. First, text that starts at zero opacity can leave a reader looking at a blank space. Second, parallax. The W3C notes that parallax, where backgrounds move at a different rate to foregrounds, is often not needed. For people with inner ear problems, this kind of motion can cause dizziness, nausea and headaches.

Motion and clear content can live on one page. OrangeOrange built the mediaman PXP page as a scroll story with complex GSAP animation. Clean markup under the motion keeps the story easy to read for search engines and AI tools.

Keep animation fast: transform and opacity

The web.dev guide to fast CSS animations says to keep animations to opacity and transform where you can. That keeps them on the compositing stage, the last step of drawing a page. It also says to avoid any property that triggers layout or paint unless you truly need it.

These two are the compositor-only properties. The compositor can change them alone, with no new layout and no new paint. web.dev says that only two properties work this way today.

The will-change property moves an element to its own layer. Use it rarely, and only to fix a real problem. Each layer needs memory. On devices with little memory, the cost can be bigger than the gain.

  • Safe to move: transform to shift, scale or turn things, and opacity to fade them.
  • Use with care: any property that makes the browser paint again.
  • Avoid unless you must: any property that triggers layout.

Respect the reduced motion setting

Some people get sick from motion on screens. They can switch on a reduce motion option on their phone or laptop. On an iPhone, it sits in Settings, then Accessibility, then Motion. On Android 9 and up, its name is Remove animations. The browser then tells the page, through the prefers-reduced-motion media query.

MDN says the setting asks for an interface that removes, reduces or replaces motion. Reduced does not have to mean none. Keep a fade, but remove the slide, the zoom and the parallax. MDN names scaling or panning large objects as common triggers.

In CSS, put motion inside a media query for no-preference, or turn it off under reduce. Motion in JavaScript needs more care. The web.dev article on reduced motion shows how to listen for the setting. It also shows how to stop animations that are already playing.

The W3C criterion 2.3.3 Animation from Interactions asks that motion started by an action can be turned off, unless it is essential. It sits at Level AAA, the highest level. The W3C lists the prefers-reduced-motion query as one way to meet it.

Lottie and Rive: files for richer motion

Some motion is too rich for CSS: a drawn feature demo, an onboarding screen, a hero the visitor can play with. Two file formats handle most of it.

Lottie: loops that play the same way each time.

Lottie is a JSON-based file format for motion. It plays on the web, iOS, Android and more. Work made in After Effects is exported with Bodymovin and played by a library such as lottie-web. The .lottie format packs one or more animations and their assets into a single file. Lottie is built from vectors, so it scales without blur.

The Lottie examples on the OrangeOrange site are two concept sets, with no client behind them. Fieldnote has four feature loops for an AI meeting notes app, with key states drawn in Figma first. Sprout has four onboarding loops for a plant care app. Each loop runs 10 seconds at 60 fps. Each weighs 9 to 45 KB as a .lottie file. The page shows a still frame first and starts the player after the page loads.

Rive: motion with logic inside.

Rive puts logic into the file. A state machine links timelines with logic, and that is what makes the graphic react. Listeners respond to the pointer and the keyboard. With data binding, the site can change a value, and the state machine responds. The Rive runtimes are open-source libraries. They run on the web, in React, on iOS and Android, in Flutter, Unity and Unreal.

OrangeOrange built three Rive concept heroes, again with no client behind them. Moss is a habit tracker: a 20-second ghost-cursor demo plays until a visitor takes over. Its desktop state machine holds 28 layers. Patchbay turns agent permissions into patch cables, with a 139-line Luau script for drag and snap. Slice splits a $96.40 bill between 2 to 6 people, with a tip from 0 to 25%. A Luau script rounds every share. All three are on the motion work page.

Pick Lottie for a loop that plays the same way each time. Pick Rive when the motion must react to the visitor or to data. See Lottie animation and Rive animation for how OrangeOrange makes each one.

A checklist before motion ships

Run through this list for every animation on a page:

  1. Name what the animation tells the visitor. If it tells nothing, cut it.
  2. Move only transform and opacity, and stay away from properties that force a new layout.
  3. Never hide the main content behind a loader or a start at zero opacity.
  4. Give loops that play beside content for more than five seconds a pause or stop control.
  5. Test with reduce motion turned on, and remove each move that is not needed.
  6. Load Lottie and Rive players after the page content, and show a still frame until they start.
  7. Check the page on a mid-range phone, not only on a fast laptop.

For motion planned together with the rest of a site, see motion design.

Key takeaways

4 key takeaways from UI animation for websites

Pavlo ZhydkykhBy , co-founder and product designer (LinkedIn). Checked .

  1. Feedback first

    A micro-interaction earns its place when it confirms an action. Motion that only decorates can go.

  2. Do not hide content.

    A full-page loader or a start at zero opacity delays the main content. Show a small loader where the wait is.

  3. Compositor only

    The browser can change these two on the compositor alone. Move them, not properties that force new layout or paint.

  4. Reduced motion

    Respect the reduce motion setting: keep fades, drop the movement. Long loops next to content need a pause button.

Pros and cons

Lottie and Rive pros and cons for website animation

FAQ

Questions about UI animation, with short answers.

A micro-interaction is a small animated response to one action, such as a button press, a toggle or a sent form. It confirms that the action worked. Keep it short, and never make the visitor wait for it.

A small loader where content is on its way does no harm. A full-page preloader that hides the page delays the moment the main content shows, and Largest Contentful Paint measures that moment. Show the page as soon as it can render.

Lottie suits loops that play the same way every time, such as feature demos and onboarding screens. Rive suits animation that reacts to the visitor or to data, because its state machine holds the logic. Both need a player on the page and a calmer version for reduced motion.

Reviews

What OrangeOrange clients say, in their own words.

  • “OrangeOrange is really communicative, easy to collaborate with, and consistently delivers on time (often early).”

    Upwork client Webflow build for a mental health website
  • “OrangeOrange were able to get quality work out quickly and on time, despite changing timelines, budgets, and priorities.”

    Quinn Osha, CEO, TopmarqQuinn Osha CEO, Topmarq
  • “Everything was delivered on time or even ahead of time.”

    Remi Labelle, COO, Accolade ProRemi Labelle COO, Accolade Pro
  • “They didn’t miss any meetings or deadlines, and I can warmly recommend them for any future Webflow work.”

    Upwork client Webflow templates for PPC landing page tests

In their words

What MDN, web.dev, the W3C, Rive and LottieFiles say about motion on the web.

“The setting is used to convey to the browser on the device that the user prefers an interface that removes, reduces, or replaces motion-based animations.”

MDN Web Docs, prefers-reduced-motion CSS media feature - CSS | MDN.

“Avoid any property that triggers layout or paint unless it's absolutely necessary.”

web.dev, How to create high-performance CSS animations.

“Parallax scrolling occurs when backgrounds move at a different rate to foregrounds.”

W3C, Understanding Success Criterion 2.3.3: Animation from Interactions.

“A state machine connects your timelines with logic.”

Rive, State Machine Overview - Rive.

“A Lottie is a JSON-based animation file format that lets you ship animations on any platform as easily as shipping static assets.”

LottieFiles, What is a Lottie animation? - LottieFiles.

Sources

Sources this note cites, and further reading.

SourcePublisher
Largest Contentful Paint (LCP).web.dev
Understanding Success Criterion 2.2.2: Pause, Stop, Hide.W3C
CSS scroll-driven animations - CSS | MDN.MDN Web Docs.
How to create high-performance CSS animations.web.dev
Stick to compositor-only properties and manage layer count.web.dev
prefers-reduced-motion CSS media feature - CSS | MDN.MDN Web Docs.
prefers-reduced-motion: Sometimes less movement is more.web.dev
Understanding Success Criterion 2.3.3: Animation from Interactions.W3C
What is a Lottie animation? - LottieFiles.LottieFiles
JSONWikipedia
GitHub - airbnb/lottie-web: Render After Effects animations natively on Web, Android and iOS, and React Native.Airbnb
State Machine Overview - Rive.Rive
Getting Started with the Rive Runtimes - Rive.Rive

More notes

Keep reading.

Start a project

Let’s start a project

Tell OrangeOrange where your website stalls. A senior designer replies within one working day with a practical plan.

Contact OrangeOrange