# JavaScript animation libraries

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](#motion) rather than an instant jump.

## Popularity

| Library | Monthly downloads | Stars | Last release | License |
| --- | --- | --- | --- | --- |
| [d3-transition](#dthree-transition) | 201.2M | 226 | Nov 2026 | ISC |
| [Motion](#motion) | 134.5M | 35.1K | Nov 2026 | MIT |
| [Tween.js](#tweenjs-tween-js) | 90.1M | 10.2K | Jul 2024 | MIT |
| [lottie-web](#lottie-web) | 39.4M | 32.4K | May 2025 | MIT |
| [GSAP](#gsap) | 32.1M | 30.5K | Nov 2026 | Standard 'no charge' license: https://gsap.com/standard-license. |
| [dotLottie Web](#lottiefiles-dotlottie-web) | 9.2M | 951 | Nov 2026 | MIT |
| [AutoAnimate](#formkit-auto-animate) | 9.0M | 14.0K | Nov 2026 | MIT |
| [Anime.js](#anime-js) | 4.5M | 74.9K | Jun 2026 | MIT |

Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

[Motion](#motion) has the most monthly downloads in this comparison, at 123.2M.

## Capabilities

| Library | Lottie asset playback | Before/after DOM layout | Direct object tween targets |
| --- | --- | --- | --- |
| [d3-transition](#dthree-transition) | No | No | No |
| [Motion](#motion) | No | Yes | Yes |
| [Tween.js](#tweenjs-tween-js) | No | No | Yes |
| [lottie-web](#lottie-web) | Yes | No | No |
| [GSAP](#gsap) | No | Via plugin | Yes |
| [dotLottie Web](#lottiefiles-dotlottie-web) | Yes | No | No |
| [AutoAnimate](#formkit-auto-animate) | No | Yes | No |
| [Anime.js](#anime-js) | No | Yes | Yes |

## Libraries

### d3-transition

[GitHub](https://github.com/d3/d3-transition) · [npm](https://www.npmjs.com/package/d3-transition) · [Docs](https://d3js.org/d3-transition/)

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
- Capabilities: [From the d3-transition docs](https://d3js.org/d3-transition/)

**Watch out for**

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

```sh
npm install d3-selection d3-transition
```

**d3plus/d3plus** (1.6K stars)

[d3plus/d3plus](https://github.com/d3plus/d3plus) 

```javascript
export default function (selector: string, p?: ElemParams): D3Selection {
  // overrides default params
  const params = Object.assign(
    {},
    {
      condition: true,
      enter: {},
      exit: {},
      duration: 0,
      parent: select("body") as unknown as D3Selection,
      update: {},
    },
    p,
  );

  const className = /\.([^#]+)/g.exec(selector),
    id = /#([^.]+)/g.exec(selector),
    t = transition().duration(params.duration),
    tag = /^([^.^#]+)/g.exec(selector)![1];

  const elem = params.parent
    .selectAll(selector.includes(":") ? selector.split(":")[1] : selector)
    .data(params.condition ? [null] : []);

  const enter = elem.enter().append(tag).call(attrize, params.enter);

  if (id) enter.attr("id", id[1]);
  if (className) enter.attr("class", className[1]);

  if (params.duration)
    elem
      .exit()
      .transition(t)
      .call(attrize as never, params.exit)
      .remove();
  else elem.exit().call(attrize, params.exit).remove();

  const update = enter.merge(elem);
  if (params.duration)
    update.transition(t).call(attrize as never, params.update);
  else update.call(attrize, params.update);

  return update as unknown as D3Selection;
}
```

[packages/dom/src/elem.ts](https://github.com/d3plus/d3plus/blob/b442ddf8c0ff08a11f2a32465010734234add916/packages/dom/src/elem.ts#L24-L67) · [More projects using d3-transition →](https://dashboard.exa.ai/playground/search?q=d3-transition%20GitHub%20projects)

**Quickstart**

```javascript
import { select } from "d3-selection";
import "d3-transition";

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

```

From [transition docs](https://d3js.org/d3-transition)

### Motion

[GitHub](https://github.com/motiondivision/motion) · [npm](https://www.npmjs.com/package/motion) · [Docs](https://github.com/motiondivision/motion#readme)

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
- Capabilities: [From the Motion docs](https://github.com/motiondivision/motion#readme)

**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.

**Watch out for**

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

```sh
npm install motion
```

**DestinyItemManager/DIM** (2.2K stars)

[DestinyItemManager/DIM](https://github.com/DestinyItemManager/DIM) 

```javascript
export default function AnimatedNumber({
  value,
  className,
}: {
  value: number;
  className?: string;
}) {
  const val = useMotionValue(value);
  const transformedVal = useTransform(val, (v) => Math.floor(v));

  useEffect(() => {
    animate(val, value, spring);
  }, [val, value]);

  return <motion.span className={className}>{transformedVal}</motion.span>;
}

```

[src/app/dim-ui/AnimatedNumber.tsx](https://github.com/DestinyItemManager/DIM/blob/a7ddf5c4e8c615aa71c9ae812b5b13e8a215b087/src/app/dim-ui/AnimatedNumber.tsx#L13-L28) · [More projects using Motion →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20motion&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import { animate } from "motion"

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

```

From [animate docs](https://motion.dev/docs/animate)

### Tween.js

[GitHub](https://github.com/tweenjs/tween.js) · [npm](https://www.npmjs.com/package/@tweenjs/tween.js)

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
- Capabilities: [From the Tween.js docs](https://github.com/tweenjs/tween.js)

**Watch out for**

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

```sh
npm install @tweenjs/tween.js
```

**eva-engine/eva.js** (1.8K stars)

[eva-engine/eva.js](https://github.com/eva-engine/eva.js) 

```javascript
init() {
    this.checkFinishFunc = this.checkFinish.bind(this);

    this.timelines.forEach((timeline, i) => {
      let lastTween;
      for (let j = 0; j < timeline.values.length - 1; j++) {
        const frame = timeline.values[j];
        const nextFrame = timeline.values[j + 1];

        const tween = new Tween({ value: frame.value }, this.tweenGroup)
          .to({ value: nextFrame.value })
          .duration(nextFrame.time - frame.time)
          .easing(easingMap[frame.tween] || easingMap.linear)
          .onUpdate(props => {
            this.doAnim({
              component: timeline.component,
              name: timeline.name,
              value: props.value,
            });
            this.emit('update', props.value);
          });

        if (j === 0) {
          this.tweens[i] = tween;
        } else {
          lastTween.chain(tween);
        }

        lastTween = tween;
      }
      lastTween && lastTween.onComplete(() => this.checkFinishFunc());
    });
  }
```

[packages/plugin-transition/lib/Animation.ts](https://github.com/eva-engine/eva.js/blob/792ede99108c5af56ff724c2e136747406895d02/packages/plugin-transition/lib/Animation.ts) · [More projects using Tween.js →](https://dashboard.exa.ai/playground/search?q=%40tweenjs/tween.js%20GitHub%20projects)

**Quickstart**

```javascript
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()

```

From [user_guide.md](https://raw.githubusercontent.com/tweenjs/tween.js/main/docs/user_guide.md)

### lottie-web

[GitHub](https://github.com/airbnb/lottie-web) · [npm](https://www.npmjs.com/package/lottie-web) · [Docs](https://github.com/airbnb/lottie-web#readme)

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
- Capabilities: [From the lottie-web docs](https://github.com/airbnb/lottie-web#readme)

**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.

**Watch out for**

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

```sh
npm install lottie-web
```

**LottieFiles/lottie-player** (1.7K stars)

[LottieFiles/lottie-player](https://github.com/LottieFiles/lottie-player) 

```javascript
public seek(value: number | string): void {
    if (!this._lottie) {
      return;
    }

    // Extract frame number from either number or percentage value
    const matches = /^(\d+)(%?)$/.exec(value.toString());

    if (!matches) {
      return;
    }

    // Calculate and set the frame number
    const frame =
      matches[2] === "%"
        ? (this._lottie.totalFrames * Number(matches[1])) / 100
        : Number(matches[1]);

    // Set seeker to new frame number
    this.seeker = frame;

    // Send lottie player to the new frame
    if (this.currentState === PlayerState.Playing) {
      this._lottie.goToAndPlay(frame, true);
    } else {
      this._lottie.goToAndStop(frame, true);
      this._lottie.pause();
    }
  }
```

[src/lottie-player.ts](https://github.com/LottieFiles/lottie-player/blob/12ae7ac306bb8f80e5b8f2d136f2e993426027a5/src/lottie-player.ts#L386-L414) · [More projects using lottie-web →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20lottie-web&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
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
});

```

From [README.md](https://raw.githubusercontent.com/airbnb/lottie-web/master/README.md)

### GSAP

[GitHub](https://github.com/greensock/GSAP) · [npm](https://www.npmjs.com/package/gsap) · [Docs](https://gsap.com)

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.
- Capabilities: [From the GSAP docs](https://gsap.com)

**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.

**Watch out for**

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

```sh
npm install gsap
```

**DavidHDev/react-bits** (51.8K stars)

[DavidHDev/react-bits](https://github.com/DavidHDev/react-bits) 

```javascript
const reveal = (initial, vars) => {
        const accent = liveRef.current.accentColor;
        const tl = gsap.timeline(vars);
        tl.fromTo(
          pieces,
          { ...fromVars, willChange: 'transform, opacity' },
          { ...toVars, duration, ease: easing, stagger: order, immediateRender: initial },
          0
        );
        if (accent) {
          tl.fromTo(
            pieces,
            { color: accent },
            {
              color: getComputedStyle(el).color,
              duration: duration * 0.7,
              ease: 'power1.inOut',
              stagger: order,
              immediateRender: initial
            },
            duration * 0.3
          );
        }
        tl.set(pieces, { clearProps: accent ? `${settle},color` : settle });
        return tl;
      };

```

[src/content/TextAnimations/SplitText/SplitText.jsx](https://github.com/DavidHDev/react-bits/blob/9d9c687dc4f55b23539aa5417b703078047efa74/src/content/TextAnimations/SplitText/SplitText.jsx#L162-L187) · [More projects using GSAP →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20gsap&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
import gsap from 'gsap';

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

```

From [gsap.to.md](https://gsap.com/docs/v3/GSAP/gsap.to%28%29.md)

### dotLottie Web

[GitHub](https://github.com/LottieFiles/dotlottie-web) · [npm](https://www.npmjs.com/package/@lottiefiles/dotlottie-web) · [Docs](https://docs.lottiefiles.com/en/runtimes/distributions/js?utm_source=npm&utm_medium=package)

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
- Capabilities: [From the dotLottie Web docs](https://docs.lottiefiles.com/en/runtimes/distributions/js?utm_source=npm&utm_medium=package)

**Watch out for**

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

```sh
npm install @lottiefiles/dotlottie-web
```

**walterlow/freecut** (2.3K stars)

[walterlow/freecut](https://github.com/walterlow/freecut) 

```javascript
private applySlots(slots: Record<string, LottieSlotValue> | undefined): void {
    if (!slots) return
    for (const [id, value] of Object.entries(slots)) {
      try {
        // `getSlotType` reports position slots as 'vector'; `setVectorSlot`
        // handles both.
        const type = this.dotLottie.getSlotType(id)
        if (type === 'scalar' && typeof value === 'number') {
          this.dotLottie.setScalarSlot(id, value)
        } else if (type === 'vector' && Array.isArray(value)) {
          this.dotLottie.setVectorSlot(id, value)
        }
      } catch {
        // ignore a single bad slot — the rest still apply
      }
    }
  }
```

[src/infrastructure/lottie/lottie-frame-provider.ts](https://github.com/walterlow/freecut/blob/5ceeeb388eef5423640b7db157706274bf1b8165/src/infrastructure/lottie/lottie-frame-provider.ts) · [More projects using dotLottie Web →](https://dashboard.exa.ai/playground/search?q=%40lottiefiles/dotlottie-web%20GitHub%20projects)

**Quickstart**

```javascript
import { DotLottie } from '@lottiefiles/dotlottie-web';

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

```

From [README.md](https://raw.githubusercontent.com/LottieFiles/dotlottie-web/main/packages/web/README.md)

### AutoAnimate

[GitHub](https://github.com/formkit/auto-animate) · [npm](https://www.npmjs.com/package/@formkit/auto-animate) · [Docs](https://github.com/formkit/auto-animate#readme)

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
- Capabilities: [From the AutoAnimate docs](https://github.com/formkit/auto-animate#readme)

```sh
npm install @formkit/auto-animate
```

**icflorescu/mantine-datatable** (1.3K stars)

[icflorescu/mantine-datatable](https://github.com/icflorescu/mantine-datatable) 

```tsx
(node: HTMLTableSectionElement | null) => {
    if (node && !autoAnimateInitialized.current) {
      autoAnimate(node);
      autoAnimateInitialized.current = true;
    }
  }
```

[app/examples/using-with-auto-animate/UsingWithAutoAnimateExample.tsx](https://github.com/icflorescu/mantine-datatable/blob/59ebb3a96648ae38a007a77d7e8ab9af6b6147c1/app/examples/using-with-auto-animate/UsingWithAutoAnimateExample.tsx) · [More projects using AutoAnimate →](https://dashboard.exa.ai/playground/search?q=%40formkit/auto-animate%20GitHub%20projects)

**Quickstart**

```tsx
import { useAutoAnimate } from '@formkit/auto-animate/react'

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

```

From [intro.jsx](https://github.com/formkit/auto-animate/blob/fc43d3030b8adc8df0c4d78fd4297122753e9765/docs/src/examples/intro/intro.jsx)

### Anime.js

[GitHub](https://github.com/juliangarnier/anime) · [npm](https://www.npmjs.com/package/animejs) · [Docs](https://animejs.com)

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
- Capabilities: [From the Anime.js docs](https://animejs.com)

**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.

**Watch out for**

- **Spring settling overrides animation duration.** The spring settling duration replaces the animation duration parameter.

```sh
npm install animejs
```

**moeru-ai/airi** (51.6K stars)

[moeru-ai/airi](https://github.com/moeru-ai/airi) 

```javascript
export function createFadeAnimator(options: CreateAnimatorOptions): Animator {
  return (elements: HTMLElement[]) => {
    if (elements.length === 0) {
      // NO DIV0
      return () => {}
    }

    const timeline = createTimeline({ loop: options.loop })
      .set(elements, {
        opacity: 0,
      })
      .add(elements, {
        opacity: [0, 1],
        ...options,
        delay: (_: unknown, i = 0) => options.duration / elements.length * (i + 1),
      })

    return () => {
      timeline.remove(elements)
    }
  }
}
```

[packages/stage-ui/src/components/widgets/poppin-text/animators/fade.ts](https://github.com/moeru-ai/airi/blob/b3a6d60718e52785eedcc1f96c6f1ab398741286/packages/stage-ui/src/components/widgets/poppin-text/animators/fade.ts) · [More projects using Anime.js →](https://dashboard.exa.ai/playground/search?q=JavaScript%20projects%20that%20use%20animejs&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D)

**Quickstart**

```javascript
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
});

```

From [README.md](https://github.com/juliangarnier/anime/blob/01b81be1df6843ccfe0a71c0699a746bf740dd77/README.md)

## FAQ

### Which JavaScript animation library should I use?

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

### Which animation library works with React?

[Motion](#motion) is built for React and exposes `motion` components that animate through props. [GSAP](#gsap) also animates React apps, and [AutoAnimate](#formkit-auto-animate) ships a `useAutoAnimate` hook for React.

### GSAP vs Framer Motion: which should I use?

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

### What is GSAP ScrollTrigger?

ScrollTrigger is a [GSAP](#gsap) plugin that ties animations to scroll position. Like every GSAP plugin, it is free, including for commercial use.

### lottie-web vs dotLottie: what is the difference?

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

### What are the alternatives to GSAP?

[Motion](#motion) and [Anime.js](#anime-js) animate DOM elements and JavaScript objects with springs, timelines, and scroll effects. [Tween.js](#tweenjs-tween-js) tweens the values of plain objects inside an update loop the app runs.

## How this page was built

Data checked Nov 19, 2026.

Reproduce it with the Exa API:

```json
{
  "endpoint": "/search",
  "body": {
    "query": "JavaScript animation libraries GSAP Motion Anime.js Lottie playback SVG scroll springs code examples",
    "numResults": 5
  }
}
```

Docs: https://exa.ai/docs/reference/search
