
Product
Announcing Precomputed Reachability Analysis in Socket
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Anime.js is a lightweight JavaScript animation library with a simple, yet powerful API. It works with CSS properties, SVG, DOM attributes, and JavaScript Objects.
Basic Animation
This feature allows you to animate basic properties like translation, rotation, and background color of a DOM element.
anime({
targets: 'div',
translateX: 250,
rotate: '1turn',
backgroundColor: '#FFF',
duration: 800
});
Timeline Control
Timelines allow you to create complex animation sequences with precise control over the timing of each animation.
var tl = anime.timeline({
easing: 'easeOutExpo',
duration: 750
});
tl.add({
targets: '.box',
translateX: 250
}).add({
targets: '.box',
translateY: 250,
offset: '-=500' // Starts 500ms before the previous animation ends
});
SVG Animations
Anime.js can animate SVG properties, allowing for intricate and visually appealing vector animations.
anime({
targets: 'path',
strokeDashoffset: [anime.setDashoffset, 0],
easing: 'easeInOutSine',
duration: 1500,
delay: function(el, i) { return i * 250 },
direction: 'alternate',
loop: true
});
Keyframes
Keyframes allow you to define multiple stages of an animation, giving you more control over the animation sequence.
anime({
targets: '.box',
keyframes: [
{translateX: 250},
{translateY: 250},
{translateX: 0},
{translateY: 0}
],
duration: 4000,
easing: 'easeOutElastic(1, .8)',
loop: true
});
GSAP (GreenSock Animation Platform) is a powerful JavaScript library for creating high-performance animations. It offers more features and plugins compared to Anime.js, making it suitable for more complex animations.
Velocity is an animation engine with the same API as jQuery's $.animate(). It is designed for fast performance and is a good alternative for those who are familiar with jQuery animations.
Popmotion is a functional, flexible JavaScript animation library. It provides a more functional approach to animations compared to Anime.js, making it a good choice for developers who prefer functional programming paradigms.
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.
Anime.js is 100% free and is only made possible with the help of our sponsors. Help the project become sustainable by sponsoring us on GitHub Sponsors.
Anime.js V4 works by importing ES modules like so:
|
![]() |
The full documentation is available here.
You can find the v3 to v4 migration guide here.
First, run npm i
to install all the necessary packages.
Then, execute the following scripts with npm run <script>
.
script | action |
---|---|
dev | Watch any changes in src/ and compiles the esm version to lib/anime.esm.js |
dev-types | Same as dev , but also run TypeScript and generate the types/index.d.ts file |
build | Generate types definition and compiles ESM / UMD / IIFE versions to lib/ |
test-browser | Start a local server and start all browser related tests |
test-node | Start all Node related tests |
open-examples | Start a local server to browse the examples locally |
FAQs
JavaScript animation engine
The npm package animejs receives a total of 204,730 weekly downloads. As such, animejs popularity was classified as popular.
We found that animejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.