Lottie animations on websites: what they are and how to use them
What a Lottie animation is, how it compares with GIF and video, where it fits on a website, and how to keep the files small, fast and accessible.
Design, web and motion studio in Dubai
A Lottie animation is a lightweight vector animation saved as a data file (JSON, a plain-text format) and drawn live in the browser or app by a small player. Because it is made of shapes rather than pixels, it stays sharp at any size and is often much smaller than a GIF or video of the same simple graphic. It is ideal for animated icons, loaders, success messages and small illustrations, and the wrong tool for photographs, footage or effects-heavy scenes.
This guide explains how Lottie works, how it compares with GIF, video and CSS animation, where it fits on a business website, how to keep it fast and accessible, and how to brief one.
Key takeaways
- Lottie is a vector animation format: the animation is stored as data and drawn live by a small player, so it stays sharp at any size.
- It suits icons, loaders, small illustrations and interface feedback; it is the wrong choice for photos, footage and heavy effects.
- File size depends on complexity, not length alone: embedded images and thousands of shapes make files heavy.
- Respect reduced-motion settings, and give long-running or looping animations a way to pause.
How Lottie works
A designer builds the animation, traditionally in Adobe After Effects, and exports it with a plugin (Bodymovin is the best known) or from a tool with Lottie export built in. The export describes every shape, colour and keyframe (a point where something changes) as data. On your site, a player script reads that data and draws the animation, either as SVG or on a canvas element.
Lottie began at Airbnb and is open source, with players for the web, iOS, Android and other platforms. There is also a packaged format, dotLottie (.lottie files), which compresses the data and can bundle several animations and their images into one file, usually smaller than the plain JSON.
Lottie vs GIF vs video vs CSS
Each format has a job it does best. Choosing the right one matters more than optimising the wrong one.
| Format | Best for | Sharpness | Weak spots |
|---|---|---|---|
| Lottie | Icons, loaders, illustrations, interface feedback | Sharp at any size | Needs a player script; complex scenes can strain phones |
| GIF | Quick shares, and email where video won't play | Blurry when scaled; limited colours | Large files for their quality; no sound |
| Video (MP4, WebM) | Footage, photographic or effects-heavy motion | Fixed resolution | Not interactive; heavy for simple graphics |
| CSS animation | Simple moves: fades, slides, hover effects | Sharp | Impractical for illustrated or complex motion |
| Animated SVG | Simple logo or icon motion coded by a developer | Sharp | Slow to build by hand |
Lottie can be interactive
A Lottie animation can play on hover, follow the scroll position, or jump to a particular frame when someone clicks. That makes it useful for interface details a video cannot handle, such as a menu icon that morphs into a close button.
Where Lottie fits on a business website
Character loops can work too, if they are built from flat shapes. Our guide to character animation for brands covers designing characters that can be reused like this.
- Animated icons in feature or service lists, playing once as they scroll into view.
- Loading and progress indicators that match your brand.
- Success and error feedback after a form submission or payment.
- Empty states: the friendly illustration shown when a list or basket is empty.
- Small hero or section illustrations with a gentle loop.
- Onboarding steps in an app or web app; our guide to app onboarding covers that pattern.
- Toggles, menu icons and buttons that change shape when pressed.
Where to avoid it
If an animation must look exactly the same everywhere, test it in the player your site will actually use, on real devices, before you approve it.
- Photographs and filmed footage: use video.
- Effects-heavy scenes: many After Effects effects, blurs and third-party plugins don't export to Lottie, or play differently in different players.
- Large, layered full-screen scenes: they can make phones stutter and drain batteries.
- The main hero visual, if the page depends on it appearing instantly: the player script must load before anything draws, so a still image often appears sooner.
- Several animations playing at once: pick one focal movement per screen.
File size and performance
Lottie files are often small, but not automatically. Size depends on complexity, not just running time. The player library also adds weight to every page it loads on, so if you only need one tiny animation, CSS or a short video may be lighter overall.
Lottie performance checklist
- Keep photos and other raster images out of the animation; embedded images make files heavy.
- Simplify shapes and delete hidden or unused layers before export.
- Trim the timeline and loop a short section rather than exporting a long one.
- Use the dotLottie format where your player supports it.
- Load animations further down the page only as they approach the screen (lazy loading).
- Pause animations when they scroll out of view or the browser tab is hidden.
- Limit how many animations play at the same time.
- Test on a mid-range phone, not only a fast laptop.
- Measure the page before and after adding animations.
Measure the whole page
Animations are one part of page speed. Our guides to Core Web Vitals and image optimisation cover the wider picture and the scores Google uses.
Reduced motion and accessibility
Some visitors set their device to reduce motion, often because movement on screen makes them dizzy or distracted. Websites can detect this setting, called prefers-reduced-motion, and show a still frame or a gentler version instead. The web.dev guide to prefers-reduced-motion shows developers how.
The Web Content Accessibility Guidelines (WCAG) also ask that moving content which starts automatically, lasts more than five seconds and sits alongside other content can be paused, stopped or hidden; the W3C explanation of Pause, Stop, Hide has the detail. In practice: play once rather than looping forever, or add a pause control. Hide purely decorative animations from screen readers, and give meaningful ones a text alternative. Our website accessibility basics cover the rest.
Adding Lottie to your site
How you add an animation depends on your platform. Plugins and features change, so check the current documentation for your setup.
- WordPress: Lottie blocks and plugins are available, and some page builders include a Lottie widget. Upload the file, then set size, loop and trigger.
- Webflow: supports Lottie files as a built-in element, with scroll and hover interactions.
- Shopify: usually added through a custom code section that loads a player and points to the file.
- React and Next.js: official and community player packages let developers control playback in code.
- Hosting: serve the file from your own site or CDN (a network that delivers files from servers near each visitor), not a third-party link that could disappear.
How to brief a Lottie animation
Dawnwire designs animations through its motion graphics service and builds sites through web design and development, so the animation and the code that plays it can be planned together. If your current site already feels slow, run a free website check before adding anything.
- Where it sits, and its size on screen on desktop and phone.
- Trigger: on load, on scrolling into view, on hover or on click.
- Loop forever, loop a set number of times, or play once and hold.
- The backgrounds it will sit on, light and dark.
- A file size budget, agreed up front.
- A still fallback frame for reduced motion.
- Deliverables: .json or .lottie, the fallback as SVG or PNG, and the source project.
Frequently asked questions
Is Lottie better than GIF?
For vector graphics such as icons, illustrations and interface animations, usually yes: Lottie stays sharp at any size, supports full colour and transparency, and is often smaller. GIF still has a place where scripts can't run, such as many email programs. For photographs or footage, neither is ideal; use video instead.
Does Lottie slow down a website?
It can if used carelessly. The player script adds weight, and complex animations with many layers or embedded images can strain phones. Keep files simple, lazy-load animations further down the page, pause them off-screen and limit how many play at once. Measure the page before and after adding them.
Can I make a Lottie animation without After Effects?
Yes. Several web-based animation tools and design-app plugins export Lottie files directly, and they suit simple icons and interface animations. After Effects remains common for more complex work. Whatever the tool, test the exported file in the player your site will use, because not every feature exports.
Is Lottie free to use?
The format and the main players are open source and free to use. Some services built around it, such as hosting platforms and editors, charge for advanced features. Animations bought from marketplaces come with their own licences, so check that commercial use is allowed before putting one on a business website.
The Dawnwire Agency Deck
Our process, what each service includes, how we price and hand over, and a selection of real client work, in one free deck.