Anime.js - JavaScript Animation Engine
Research Date: January 31, 2026
Source URL: https://animejs.com
GitHub Repository: https://github.com/juliangarnier/anime
Documentation: https://animejs.com/documentation
npm Package: https://www.npmjs.com/package/animejs
Version at Research: v4.3.5
License: MIT
Overview
Anime.js is a fast, multipurpose, and lightweight JavaScript animation library with a simple yet powerful API. It works with CSS properties, SVG, DOM attributes, and JavaScript Objects. Version 4 introduces a complete API redesign with ES module imports, improved timeline controls, and enhanced performance.
Core Value Proposition: Enable declarative, chainable animations with minimal code while supporting complex staggering, timelines, and easing functions across any animatable web property.
Problem Addressed
| Problem |
How Anime.js Solves It |
| CSS animations lack programmatic control |
Full JavaScript API with play, pause, reverse, seek controls |
| Complex sequenced animations are hard to manage |
Timeline API with sequential and parallel composition |
| Staggered animations require manual delay calculations |
Built-in stagger utility with grid, from-center, and easing options |
| SVG animations require specialized knowledge |
Native SVG property support including path morphing and motion paths |
| Animation libraries are often heavyweight |
~17KB minified, zero dependencies, tree-shakeable ES modules |
| Coordinating animations across multiple elements is complex |
Target-based approach with CSS selectors, NodeLists, or JavaScript objects |
| Easing functions are limited in CSS |
30+ built-in easing functions plus custom cubic-bezier and spring physics |
Key Statistics (as of January 31, 2026)
| Metric |
Value |
| GitHub Stars |
66,288 |
| Forks |
4,435 |
| Open Issues |
86 |
| Primary Language |
JavaScript |
| Created |
March 2016 |
| Latest Release |
v4.3.5 (January 25, 2026) |
| npm Weekly Downloads |
487,588 |
| npm Monthly Downloads |
1,477,792 |
| License |
MIT |
Key Features
1. ES Module Architecture (v4)
- Tree-shakeable Imports: Import only what you need (
animate, stagger, createTimeline)
- Named Exports: Clean API surface with explicit function imports
- TypeScript Support: Full type declarations included
import { animate, stagger, createTimeline } from 'animejs';
2. Target-Based Animation
- CSS Selectors: Animate elements matching any valid selector
- DOM Elements: Direct element or NodeList references
- JavaScript Objects: Animate any numeric object properties
- Mixed Targets: Combine different target types in single animation
3. Property Animation
- CSS Properties: All animatable CSS including transforms, colors, dimensions
- SVG Attributes: Native SVG property support (path d, stroke-dasharray, etc.)
- DOM Attributes: Any numeric DOM attribute
- Object Properties: Arbitrary JavaScript object values
4. Stagger System
- Linear Stagger: Incremental delays across targets
- Grid Stagger: 2D staggering for grid layouts
- From Options: Start from first, last, center, or specific index
- Easing Integration: Apply easing curves to stagger distribution
animate('.item', {
translateX: 250,
delay: stagger(100, { from: 'center', ease: 'outQuad' })
});
5. Timeline API
- Sequential Composition: Chain animations with
add()
- Parallel Composition: Overlap animations with offset parameters
- Nested Timelines: Compose complex sequences from simpler ones
- Default Parameters: Shared properties across all timeline children
const tl = createTimeline({ defaults: { duration: 400, ease: 'outQuad' }});
tl.add('.el1', { translateX: 250 })
.add('.el2', { translateY: 100 }, '-=200');
6. Playback Controls
- play() / pause() / resume(): Standard playback control
- reverse(): Play animation backwards
- seek(time): Jump to specific time position
- restart(): Reset and play from beginning
- Playback Rate: Speed up or slow down animations
7. Easing Functions
- Built-in Easings: 30+ named easings (linear, quad, cubic, quart, quint, sine, expo, circ, back, elastic, bounce)
- Directional Variants: in, out, inOut for each easing type
- Custom Bezier: Define custom cubic-bezier curves
- Spring Physics: Physics-based spring animations
- Stepped Easing: Discrete step transitions
8. Callbacks and Promises
- Event Callbacks: onBegin, onUpdate, onLoop, onComplete
- Promise-based: Async/await support for animation completion
- Progress Values: Access current progress in callbacks
Technical Architecture
Application Code
|
v
+------------------------------------------+
| Anime.js Engine |
| +------------------------------------+ |
| | Target Resolution | |
| | - CSS selector parsing | |
| | - NodeList handling | |
| | - Object property mapping | |
| +------------------------------------+ |
| | |
| v |
| +------------------------------------+ |
| | Property Parser | |
| | - CSS value parsing | |
| | - Unit conversion | |
| | - Color interpolation (RGB/HSL) | |
| | - Transform decomposition | |
| +------------------------------------+ |
| | |
| v |
| +------------------------------------+ |
| | Animation Scheduler | |
| | - requestAnimationFrame loop | |
| | - Easing calculation | |
| | - Progress interpolation | |
| | - Stagger delay management | |
| +------------------------------------+ |
| | |
| v |
| +------------------------------------+ |
| | Value Renderer | |
| | - Style application | |
| | - SVG attribute updates | |
| | - Object mutation | |
| | - DOM batch updates | |
| +------------------------------------+ |
+------------------------------------------+
|
v
Animated DOM / Objects
Installation & Usage
Installation Options
# npm
npm install animejs
# yarn
yarn add animejs
# pnpm
pnpm add animejs
# CDN (UMD)
<script src="https://cdn.jsdelivr.net/npm/animejs@4/lib/anime.umd.min.js"></script>
Basic Usage (v4)
import { animate } from 'animejs';
// Simple animation
animate('.box', {
translateX: 250,
rotate: '1turn',
backgroundColor: '#FF0000',
duration: 800,
ease: 'outQuad'
});
// With keyframes
animate('.box', {
translateX: [
{ to: 100, duration: 500 },
{ to: 250, duration: 500 }
],
rotate: { from: -180, to: 180 },
ease: 'inOutSine'
});
Stagger Example
import { animate, stagger } from 'animejs';
animate('.grid-item', {
scale: [0, 1],
opacity: [0, 1],
delay: stagger(50, { grid: [10, 10], from: 'center' }),
ease: 'outBack'
});
Timeline Example
import { createTimeline } from 'animejs';
const tl = createTimeline({
defaults: { duration: 750, ease: 'outQuint' }
});
tl.add('.header', { translateY: [-50, 0], opacity: [0, 1] })
.add('.content', { translateY: [30, 0], opacity: [0, 1] }, '-=500')
.add('.footer', { translateY: [20, 0], opacity: [0, 1] }, '-=500');
v3 to v4 Migration Key Changes
| v3 Syntax |
v4 Syntax |
anime({ targets: 'div', ... }) |
animate('div', { ... }) |
easing: 'easeOutQuad' |
ease: 'outQuad' |
direction: 'alternate' |
alternate: true |
direction: 'reverse' |
reversed: true |
anime.timeline() |
createTimeline() |
endDelay: 1000 |
loopDelay: 1000 |
value: 100 |
to: 100 |
Relevance to Claude Code Development
Direct Applications
- AI-Generated Web Applications: When Claude generates frontend code with animations, anime.js provides a well-documented, declarative API that produces reliable results
- Code Example Generation: The consistent API patterns make it predictable for AI code generation with fewer hallucinations
- Documentation-to-Code Pattern: Anime.js demonstrates excellent API documentation that translates cleanly to working code
Patterns Worth Adopting
- Declarative Configuration: The object-based parameter pattern (
{ duration: 800, ease: 'outQuad' }) is highly readable and self-documenting
- Composable Building Blocks:
animate(), stagger(), createTimeline() compose naturally - similar to skill composition patterns
- Named Easing Functions: Semantic names like 'outQuad' vs numeric cubic-bezier values improve code readability
- From/To Explicit Syntax:
{ from: 0, to: 100 } pattern eliminates ambiguity about animation direction
- Tree-Shakeable Exports: ES module pattern that imports only needed functions reduces bundle size
Integration Opportunities
- Frontend Skills: Could inform a skill for generating animated web components
- Code Generation Patterns: The declarative API style can inspire how Claude structures generated animation code
- Documentation Standards: Anime.js documentation exemplifies API docs that work well for both human and AI consumption
Key Insight
Anime.js demonstrates that declarative, composable APIs with semantic naming conventions are both human-readable and AI-friendly. The explicit { from, to } pattern and named easings reduce ambiguity, making generated code more reliable. This principle applies to skill and agent API design: explicit, declarative configurations outperform imperative approaches for AI comprehension.
References
- Official Website: https://animejs.com (accessed 2026-01-31)
- GitHub Repository: https://github.com/juliangarnier/anime (accessed 2026-01-31)
- Documentation: https://animejs.com/documentation (accessed 2026-01-31)
- npm Package: https://www.npmjs.com/package/animejs (accessed 2026-01-31)
- v3 to v4 Migration Guide: https://github.com/juliangarnier/anime/wiki/Migrating-from-v3-to-v4 (accessed 2026-01-31)
- CodePen Examples: https://codepen.io/collection/b392d3a52d6abf5b8d9fda4e4cab61ab/ (accessed 2026-01-31)
Related Tools
| Tool |
Relationship |
| GSAP |
More feature-rich animation platform (commercial) |
| Motion One |
Modern alternative with Web Animations API |
| Framer Motion |
React-specific animation library |
| Popmotion |
Functional animation library |
| Lottie |
After Effects animation player for web |
Freshness Tracking
| Field |
Value |
| Last Verified |
2026-01-31 |
| Version at Verification |
v4.3.5 |
| GitHub Stars at Verification |
66,288 |
| npm Weekly Downloads |
487,588 |
| Next Review Recommended |
2026-04-30 (3 months) |
Change Detection Indicators:
- Monitor npm for new version releases (v4.x active development)
- Check GitHub releases for changelog updates
- Watch for new easing functions or timeline features
- Track browser compatibility updates
- Review documentation for API additions
1---2name: anime-js-javascript-animation-engine3description: Anime.js is a fast, multipurpose, and lightweight JavaScript animation library with a simple yet powerful API. It works with CSS properties, SVG, DOM attributes, and JavaScript Objects.4---5# Anime.js - JavaScript Animation Engine67**Research Date**: January 31, 20268**Source URL**: <https://animejs.com>9**GitHub Repository**: <https://github.com/juliangarnier/anime>10**Documentation**: <https://animejs.com/documentation>11**npm Package**: <https://www.npmjs.com/package/animejs>12**Version at Research**: v4.3.513**License**: MIT1415---1617## Overview1819Anime.js is a fast, multipurpose, and lightweight JavaScript animation library with a simple yet powerful API. It works with CSS properties, SVG, DOM attributes, and JavaScript Objects. Version 4 introduces a complete API redesign with ES module imports, improved timeline controls, and enhanced performance.2021**Core Value Proposition**: Enable declarative, chainable animations with minimal code while supporting complex staggering, timelines, and easing functions across any animatable web property.2223---2425## Problem Addressed2627| Problem | How Anime.js Solves It |28| ----------------------------------------------------------- | ----------------------------------------------------------------------------- |29| CSS animations lack programmatic control | Full JavaScript API with play, pause, reverse, seek controls |30| Complex sequenced animations are hard to manage | Timeline API with sequential and parallel composition |31| Staggered animations require manual delay calculations | Built-in stagger utility with grid, from-center, and easing options |32| SVG animations require specialized knowledge | Native SVG property support including path morphing and motion paths |33| Animation libraries are often heavyweight | ~17KB minified, zero dependencies, tree-shakeable ES modules |34| Coordinating animations across multiple elements is complex | Target-based approach with CSS selectors, NodeLists, or JavaScript objects |35| Easing functions are limited in CSS | 30+ built-in easing functions plus custom cubic-bezier and spring physics |3637---3839## Key Statistics (as of January 31, 2026)4041| Metric | Value |42| ------------------- | ---------------------------- |43| GitHub Stars | 66,288 |44| Forks | 4,435 |45| Open Issues | 86 |46| Primary Language | JavaScript |47| Created | March 2016 |48| Latest Release | v4.3.5 (January 25, 2026) |49| npm Weekly Downloads| 487,588 |50| npm Monthly Downloads| 1,477,792 |51| License | MIT |5253---5455## Key Features5657### 1. ES Module Architecture (v4)5859- **Tree-shakeable Imports**: Import only what you need (`animate`, `stagger`, `createTimeline`)60- **Named Exports**: Clean API surface with explicit function imports61- **TypeScript Support**: Full type declarations included6263```javascript64import { animate, stagger, createTimeline } from 'animejs';65```6667### 2. Target-Based Animation6869- **CSS Selectors**: Animate elements matching any valid selector70- **DOM Elements**: Direct element or NodeList references71- **JavaScript Objects**: Animate any numeric object properties72- **Mixed Targets**: Combine different target types in single animation7374### 3. Property Animation7576- **CSS Properties**: All animatable CSS including transforms, colors, dimensions77- **SVG Attributes**: Native SVG property support (path d, stroke-dasharray, etc.)78- **DOM Attributes**: Any numeric DOM attribute79- **Object Properties**: Arbitrary JavaScript object values8081### 4. Stagger System8283- **Linear Stagger**: Incremental delays across targets84- **Grid Stagger**: 2D staggering for grid layouts85- **From Options**: Start from first, last, center, or specific index86- **Easing Integration**: Apply easing curves to stagger distribution8788```javascript89animate('.item', {90 translateX: 250,91 delay: stagger(100, { from: 'center', ease: 'outQuad' })92});93```9495### 5. Timeline API9697- **Sequential Composition**: Chain animations with `add()`98- **Parallel Composition**: Overlap animations with offset parameters99- **Nested Timelines**: Compose complex sequences from simpler ones100- **Default Parameters**: Shared properties across all timeline children101102```javascript103const tl = createTimeline({ defaults: { duration: 400, ease: 'outQuad' }});104tl.add('.el1', { translateX: 250 })105 .add('.el2', { translateY: 100 }, '-=200');106```107108### 6. Playback Controls109110- **play() / pause() / resume()**: Standard playback control111- **reverse()**: Play animation backwards112- **seek(time)**: Jump to specific time position113- **restart()**: Reset and play from beginning114- **Playback Rate**: Speed up or slow down animations115116### 7. Easing Functions117118- **Built-in Easings**: 30+ named easings (linear, quad, cubic, quart, quint, sine, expo, circ, back, elastic, bounce)119- **Directional Variants**: in, out, inOut for each easing type120- **Custom Bezier**: Define custom cubic-bezier curves121- **Spring Physics**: Physics-based spring animations122- **Stepped Easing**: Discrete step transitions123124### 8. Callbacks and Promises125126- **Event Callbacks**: onBegin, onUpdate, onLoop, onComplete127- **Promise-based**: Async/await support for animation completion128- **Progress Values**: Access current progress in callbacks129130---131132## Technical Architecture133134```text135Application Code136 |137 v138+------------------------------------------+139| Anime.js Engine |140| +------------------------------------+ |141| | Target Resolution | |142| | - CSS selector parsing | |143| | - NodeList handling | |144| | - Object property mapping | |145| +------------------------------------+ |146| | |147| v |148| +------------------------------------+ |149| | Property Parser | |150| | - CSS value parsing | |151| | - Unit conversion | |152| | - Color interpolation (RGB/HSL) | |153| | - Transform decomposition | |154| +------------------------------------+ |155| | |156| v |157| +------------------------------------+ |158| | Animation Scheduler | |159| | - requestAnimationFrame loop | |160| | - Easing calculation | |161| | - Progress interpolation | |162| | - Stagger delay management | |163| +------------------------------------+ |164| | |165| v |166| +------------------------------------+ |167| | Value Renderer | |168| | - Style application | |169| | - SVG attribute updates | |170| | - Object mutation | |171| | - DOM batch updates | |172| +------------------------------------+ |173+------------------------------------------+174 |175 v176Animated DOM / Objects177```178179---180181## Installation & Usage182183### Installation Options184185```bash186# npm187npm install animejs188189# yarn190yarn add animejs191192# pnpm193pnpm add animejs194195# CDN (UMD)196<script src="https://cdn.jsdelivr.net/npm/animejs@4/lib/anime.umd.min.js"></script>197```198199### Basic Usage (v4)200201```javascript202import { animate } from 'animejs';203204// Simple animation205animate('.box', {206 translateX: 250,207 rotate: '1turn',208 backgroundColor: '#FF0000',209 duration: 800,210 ease: 'outQuad'211});212213// With keyframes214animate('.box', {215 translateX: [216 { to: 100, duration: 500 },217 { to: 250, duration: 500 }218 ],219 rotate: { from: -180, to: 180 },220 ease: 'inOutSine'221});222```223224### Stagger Example225226```javascript227import { animate, stagger } from 'animejs';228229animate('.grid-item', {230 scale: [0, 1],231 opacity: [0, 1],232 delay: stagger(50, { grid: [10, 10], from: 'center' }),233 ease: 'outBack'234});235```236237### Timeline Example238239```javascript240import { createTimeline } from 'animejs';241242const tl = createTimeline({243 defaults: { duration: 750, ease: 'outQuint' }244});245246tl.add('.header', { translateY: [-50, 0], opacity: [0, 1] })247 .add('.content', { translateY: [30, 0], opacity: [0, 1] }, '-=500')248 .add('.footer', { translateY: [20, 0], opacity: [0, 1] }, '-=500');249```250251### v3 to v4 Migration Key Changes252253| v3 Syntax | v4 Syntax |254| --------- | --------- |255| `anime({ targets: 'div', ... })` | `animate('div', { ... })` |256| `easing: 'easeOutQuad'` | `ease: 'outQuad'` |257| `direction: 'alternate'` | `alternate: true` |258| `direction: 'reverse'` | `reversed: true` |259| `anime.timeline()` | `createTimeline()` |260| `endDelay: 1000` | `loopDelay: 1000` |261| `value: 100` | `to: 100` |262263---264265## Relevance to Claude Code Development266267### Direct Applications2682691. **AI-Generated Web Applications**: When Claude generates frontend code with animations, anime.js provides a well-documented, declarative API that produces reliable results2702. **Code Example Generation**: The consistent API patterns make it predictable for AI code generation with fewer hallucinations2713. **Documentation-to-Code Pattern**: Anime.js demonstrates excellent API documentation that translates cleanly to working code272273### Patterns Worth Adopting2742751. **Declarative Configuration**: The object-based parameter pattern (`{ duration: 800, ease: 'outQuad' }`) is highly readable and self-documenting2762. **Composable Building Blocks**: `animate()`, `stagger()`, `createTimeline()` compose naturally - similar to skill composition patterns2773. **Named Easing Functions**: Semantic names like 'outQuad' vs numeric cubic-bezier values improve code readability2784. **From/To Explicit Syntax**: `{ from: 0, to: 100 }` pattern eliminates ambiguity about animation direction2795. **Tree-Shakeable Exports**: ES module pattern that imports only needed functions reduces bundle size280281### Integration Opportunities2822831. **Frontend Skills**: Could inform a skill for generating animated web components2842. **Code Generation Patterns**: The declarative API style can inspire how Claude structures generated animation code2853. **Documentation Standards**: Anime.js documentation exemplifies API docs that work well for both human and AI consumption286287### Key Insight288289Anime.js demonstrates that declarative, composable APIs with semantic naming conventions are both human-readable and AI-friendly. The explicit `{ from, to }` pattern and named easings reduce ambiguity, making generated code more reliable. This principle applies to skill and agent API design: explicit, declarative configurations outperform imperative approaches for AI comprehension.290291---292293## References2942951. **Official Website**: <https://animejs.com> (accessed 2026-01-31)2962. **GitHub Repository**: <https://github.com/juliangarnier/anime> (accessed 2026-01-31)2973. **Documentation**: <https://animejs.com/documentation> (accessed 2026-01-31)2984. **npm Package**: <https://www.npmjs.com/package/animejs> (accessed 2026-01-31)2995. **v3 to v4 Migration Guide**: <https://github.com/juliangarnier/anime/wiki/Migrating-from-v3-to-v4> (accessed 2026-01-31)3006. **CodePen Examples**: <https://codepen.io/collection/b392d3a52d6abf5b8d9fda4e4cab61ab/> (accessed 2026-01-31)301302---303304## Related Tools305306| Tool | Relationship |307| ------------------------------------------------------------- | ------------------------------------------------------ |308| [GSAP](https://greensock.com/gsap/) | More feature-rich animation platform (commercial) |309| [Motion One](https://motion.dev/) | Modern alternative with Web Animations API |310| [Framer Motion](https://www.framer.com/motion/) | React-specific animation library |311| [Popmotion](https://popmotion.io/) | Functional animation library |312| [Lottie](https://airbnb.design/lottie/) | After Effects animation player for web |313314---315316## Freshness Tracking317318| Field | Value |319| ---------------------------- | --------------------- |320| Last Verified | 2026-01-31 |321| Version at Verification | v4.3.5 |322| GitHub Stars at Verification | 66,288 |323| npm Weekly Downloads | 487,588 |324| Next Review Recommended | 2026-04-30 (3 months) |325326**Change Detection Indicators**:327328- Monitor npm for new version releases (v4.x active development)329- Check GitHub releases for changelog updates330- Watch for new easing functions or timeline features331- Track browser compatibility updates332- Review documentation for API additions