airbnb/lottie-web
Media & DesignRender Bodymovin-exported After Effects animations as JSON natively in web pages.
Overview
lottie-web parses JSON animations exported from Adobe After Effects with the Bodymovin plugin and renders them natively on the web. Designers can ship their AE compositions without an engineer rebuilding the motion by hand; the same format is also used by the Android, iOS, React Native and Windows ports. The player targets SVG, Canvas, or HTML rendering.
Main entry point is lottie.loadAnimation(), which accepts either inline animationData or a path to a JSON file, plus options such as container, renderer, loop, and autoplay. It returns an animation instance with playback controls (play, pause, setSpeed, goToAndStop, playSegments, destroy, etc.), and the library also exposes global methods like lottie.setQuality() and lottie.setLocationHref(). Events include onComplete, onLoopComplete, enterFrame, and data_ready; see the composition settings wiki for per-setting detail.
Quick start
For the browser player, install the package:
npm install lottie-web
Alternatively load lottie.js from build/player/ or use the CDN build. Include it in a page and load an exported JSON:
<script src="js/lottie.js" type="text/javascript"></script>
<div id="anim" style="width:400px;height:400px"></div>
<script>
lottie.loadAnimation({
container: document.getElementById('anim'),
renderer: 'svg',
loop: true,
autoplay: true,
path: 'data.json'
});
</script>
The JSON comes from the Bodymovin extension in After Effects: open the extension panel, select a composition, pick a destination, and click Render. A Codepen demo and the examples collection show working setups; a video walkthrough covers the export-to-load flow.
Usage notes
Renderers: svg (default), canvas, and html. When passing the same animation object to loadAnimation multiple times and the animation contains repeaters, deep-clone it first, per issues #1159 and #2151. Canvas rendering with an existing context requires clearing the canvas each frame; rendererSettings also supports accessibility title/description, progressiveLoad, and related options. You can also declare animations declaratively with a div carrying class lottie and a data-animation-path attribute, then call lottie.searchAnimations() after load.
AE feature support: precomps, shapes, solids, images, null objects, texts, masks, time remapping, and expressions are supported; image sequences, video, and audio are not, and negative layer stretching is unsupported. Images and unconverted AI layers are exported into an images folder, so avoid overwriting an existing folder at the destination. Real-time rendering means large shapes, excessive nodes, or huge masks cost performance; converting vector layers to shapes and gzipping both the JSON and the player reduce size and load cost.
The project is MIT-licensed. For the Bodymovin plugin, the recommended route is the aescripts distribution; other install options include the Adobe Exchange, the .zxp from build/extension, or Homebrew. After installation, enable "Allow Scripts to Write Files and Access Network" in After Effects' Scripting & Expressions preferences. In Safari, mask issues tied to <base> tags are addressed by calling lottie.setLocationHref() before animation creation.
HotRepo's take
A mature library: the repository dates back to 2015 and has accumulated roughly 32,000 stars. Its most recent recorded daily snapshot (16 November 2026, JavaScript language list) placed it 10th with 22 stars gained that day, so the project still shows steady activity even without a top-line all-language daily ranking on record. That long history and cross-platform sibling ports make it a stable choice for teams shipping motion design into web UIs; the main practical trade-off is keeping exported JSON lean for runtime performance.
Written by AI from the project's README, updated . The project's own docs are the source of truth.