JavaScript animation libraries

Updated Nov 2026

JavaScript animation libraries change values over time to move, fade, and transform elements on a page. These libraries let apps show a change, such as a menu opening or an item being added, as motion rather than an instant jump.

Popularity

Motion has the most monthly downloads in this comparison, at 123.2M.

LibraryMonthly downloadsStarsLast releaseLicense
d3-transition
201.2M
226Nov 2026ISC
Motion
134.5M
35.1KNov 2026MIT
Tween.js
90.1M
10.2KJul 2024MIT
lottie-web
39.4M
32.4KMay 2025MIT
GSAP
32.1M
30.5KNov 2026Standard 'no charge' license: https://gsap.com/standard-license.
dotLottie Web
9.2M
951Nov 2026MIT
AutoAnimate
9.0M
14.0KNov 2026MIT
Anime.js
4.5M
74.9KJun 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryLottie asset playbackBefore/after DOM layoutDirect object tween targets
d3-transitionUnsupportedUnsupportedUnsupported
MotionUnsupportedBuilt-inBuilt-in
Tween.jsUnsupportedUnsupportedBuilt-in
lottie-webBuilt-inUnsupportedUnsupported
GSAPUnsupportedVia pluginBuilt-in
dotLottie WebBuilt-inUnsupportedUnsupported
AutoAnimateUnsupportedBuilt-inUnsupported
Anime.jsUnsupportedBuilt-inBuilt-in
Built-inVia pluginNot supported

Libraries and code examples

d3-transition animates changes to a selection of DOM elements instead of applying them at once. Calling transition on a selection, then style or attr, interpolates each element from its current state to the target over a duration. Built-in interpolators detect colors, numbers, transforms, and strings with numbers inside them, such as paths and font sizes. attrTween, styleTween, and tween take a custom interpolator. A transition supports most selection methods, and remove deletes the elements when it ends.

Downloads / mo
201.2M
Stars
226
Last release
3.0.2
License
ISC

Limitations

  • Elements must exist first. Appending elements or binding data happens before the transition starts.

Quickstart

From transition docs
$ npm install d3-selection d3-transition
import { select } from "d3-selection";
import "d3-transition";

select("body").transition().style("background-color", "red");

d3-transition examples

From open-source projects on GitHub

Motion animates elements in plain JavaScript, React, and Vue, and was called Framer Motion before it took its current name. In JavaScript, animate takes an element or a selector and the values to animate to. In React, a motion.div component animates whatever its animate prop sets. The engine combines JavaScript with the browser's native animation APIs, and the library includes springs, gestures, layout transitions, scroll-linked effects, and timelines. React imports come from motion/react in place of the old framer-motion package.

Downloads / mo
134.5M
Stars
35.1K
Last release
14.14.0
License
MIT

Strengths

  • Uses physics-based spring motion. Configure springs with stiffness, damping, and mass.
  • Links animation to scroll progress. Bind animation progress to the window or a scrollable element.

Limitations

  • Content resizing delays scroll updates. Content-size changes update scroll progress on the next scroll event by default.

Quickstart

From animate docs
$ npm install motion
import { animate } from "motion"

animate("li", { opacity: 0 })

Motion examples

From open-source projects on GitHub

Tween.js is a tweening engine: a Tween changes the numeric properties of a plain object from start values to end values over a duration. to sets the targets and the time, easing picks a curve from Robert Penner's easing equations, and onUpdate runs after each change, where code applies the new values to an element or a canvas. The engine moves only when update runs, so an app calls it from a requestAnimationFrame loop.

Downloads / mo
90.1M
Stars
10.2K
Last release
25.0.0
License
MIT

Limitations

  • Needs an update loop. Tweens move only when the app calls update, usually from a requestAnimationFrame loop.

Quickstart

From user_guide.md
$ npm install @tweenjs/tween.js
import {Tween} from '@tweenjs/tween.js'
const position = {x: 100, y: 0}
const tween = new Tween(position)
tween.to({x: 200}, 1000)
tween.start()

function animate() {
  requestAnimationFrame(animate)
  tween.update()
}
animate()

Tween.js examples

From open-source projects on GitHub

lottie-web plays animations designed in Adobe After Effects and exported as JSON with the Bodymovin plugin. lottie.loadAnimation loads a file into a container and renders it as SVG, canvas, or HTML. The returned animation object plays, pauses, changes speed, and jumps to a frame. Each renderer supports a different set of After Effects features, and the project lists them per renderer.

Downloads / mo
39.4M
Stars
32.4K
Last release
5.13.0
License
MIT

Strengths

  • Controls exported animation playback. Play, pause, change speed, and seek through animation frames.
  • Offers several browser renderers. Choose SVG, Canvas, or HTML rendering for an animation.

Limitations

  • Repeaters need cloned animation data. Deep-clone shared animation data before loading repeater animations multiple times.

Quickstart

From README.md
$ npm install lottie-web
import lottie from 'lottie-web';
const element = document.getElementById('animation');
lottie.loadAnimation({
  container: element, // the dom element that will contain the animation
  renderer: 'svg',
  loop: true,
  autoplay: true,
  path: 'data.json' // the path to the animation json
});

lottie-web examples

From open-source projects on GitHub

GSAP animates any property JavaScript can reach, including CSS, SVG, canvas, WebGL values, colors, and strings. It runs in plain pages and inside React and Vue apps. gsap.to animates a target to new values, and a timeline sequences many tweens and controls them as one. Plugins add scroll-driven animation with ScrollTrigger, text splitting, SVG morphing, and motion along a path, and gsap.matchMedia changes animations by screen size. The whole library, plugins included, is free for commercial use and has no dependencies.

Downloads / mo
32.1M
Stars
30.5K
Last release
3.15.1
License
Standard 'no charge' license: https://gsap.com/standard-license.

Strengths

  • Coordinates complex animation sequences. Combine tweens on a timeline and control their timing together.
  • Collects animation cleanup in contexts. Revert grouped animations when the associated view is removed.

Limitations

  • Contexts handle cleanup, not playback. Use timelines to control animation playback instead of a cleanup context.

Quickstart

From gsap.to.md
$ npm install gsap
import gsap from 'gsap';

gsap.to('.box', { x: 100 });

GSAP examples

From open-source projects on GitHub

dotLottie Web renders Lottie animations and .lottie files in browsers and Node.js. A .lottie file bundles one or more Lottie animations and their assets into one compressed archive, with support for interactivity and theming. The DotLottie class loads a file and plays, pauses, and controls it. Rendering runs in a WebAssembly engine that downloads from a CDN when the first player is created, and DotLottie.preload starts that download early.

Downloads / mo
9.2M
Stars
951
Last release
0.83.2
License
MIT

Limitations

  • Engine loads from a CDN. The WebAssembly engine downloads from a CDN when the first player is created.

Quickstart

From README.md
$ npm install @lottiefiles/dotlottie-web
import { DotLottie } from '@lottiefiles/dotlottie-web';

const player = new DotLottie({
  canvas: document.getElementById('animation'),
  src: '/animation.lottie',
  autoplay: true,
});

dotLottie Web examples

From open-source projects on GitHub

AutoAnimate adds transitions when a child of a parent element is added, removed, or moved, with no animation code. Passing the parent to autoAnimate turns it on. React and Preact use the useAutoAnimate hook, and Vue uses the v-auto-animate directive. Options set the duration and easing of the transitions.

Downloads / mo
9.0M
Stars
14.0K
Last release
0.10.2
License
MIT

Quickstart

From intro.jsx
$ npm install @formkit/auto-animate
import { useAutoAnimate } from '@formkit/auto-animate/react'

function MyList () {
  const [animationParent] = useAutoAnimate()
  return (
    <ul ref={animationParent}>
      {/* 🪄 Magic animations for your list */}
    </ul>
  )
}

AutoAnimate examples

From open-source projects on GitHub
(node: HTMLTableSectionElement | null) => {
    if (node && !autoAnimateInitialized.current) {
      autoAnimate(node);
      autoAnimateInitialized.current = true;
    }
  }

Anime.js animates CSS properties, SVG, DOM attributes, and plain JavaScript objects. The current version imports functions as ES modules, so animate and stagger come in separately. animate takes targets and an object of properties, duration, delay, and easing. stagger spreads delays across many targets, for example outward from the center. Timers, timelines, and animations can also follow scroll position through scroll observers.

Downloads / mo
4.5M
Stars
74.9K
Last release
4.5.0
License
MIT

Strengths

  • Triggers animations from scroll. Connect timers, animations, and timelines to scroll observers.
  • Calculates spring easing curves. Use spring parameters to create a physics-based easing curve.

Limitations

  • Spring settling overrides animation duration. The spring settling duration replaces the animation duration parameter.

Quickstart

From README.md
$ npm install animejs
import {
  animate,
  stagger,
} from 'animejs';

animate('.square', {
  x: 320,
  rotate: { from: -180 },
  duration: 1250,
  delay: stagger(65, { from: 'center' }),
  ease: 'inOutQuint',
  loop: true,
  alternate: true
});

Anime.js examples

From open-source projects on GitHub

FAQ

To sequence many animations and drive them from scroll, use GSAP. In React, use Motion, which animates components through props and handles layout changes. To animate a list as items come and go, use AutoAnimate, and to play designer files from After Effects, use lottie-web.

Motion is built for React and exposes motion components that animate through props. GSAP also animates React apps, and AutoAnimate ships a useAutoAnimate hook for React.

Framer Motion is now called Motion. Motion animates React components through props such as animate, with layout transitions built in. GSAP runs in any framework through gsap.to and timelines, and its plugins add scroll-driven animation, text splitting, and SVG morphing.

ScrollTrigger is a GSAP plugin that ties animations to scroll position. Like every GSAP plugin, it is free, including for commercial use.

lottie-web plays Lottie animations exported from After Effects as JSON and renders them as SVG, canvas, or HTML. dotLottie Web plays the same animations plus .lottie files, which bundle animations and assets into one compressed archive, and renders through a WebAssembly engine.

Motion and Anime.js animate DOM elements and JavaScript objects with springs, timelines, and scroll effects. Tween.js tweens the values of plain objects inside an update loop the app runs.

For coding agents

Found your animation library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official