animejs

Use when creating JavaScript animations with Anime.js v4, implementing web animations, or when user mentions anime.js/animejs. Triggers on v3 code symptoms: anime() instead of animate(), translateX instead of x, easeOutExpo instead of outExpo, anime.timeline() instead of createTimeline(). Also triggers on: CSS animation, SVG animation, scroll-driven animation, drag interaction, text splitting, layout FLIP, spring physics, stagger patterns in JavaScript.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "animejs" with this command: npx skills add lucking7/animejs-skills/lucking7-animejs-skills-animejs

Anime.js v4

Modern JavaScript animation library. V4 is a complete rewrite — animate() not anime().

Installation

npm install animejs
import { animate, createTimeline, stagger, utils, onScroll, createDraggable, splitText, createScope, createLayout, waapi, svg, eases, cubicBezier, spring, engine } from 'animejs';

CDN: <script src="https://cdn.jsdelivr.net/npm/animejs@4/dist/anime.min.js"></script>const { animate } = anime;

V3 → V4 Migration (Critical)

If you see ANY V3 pattern, the code MUST be migrated.

V3 (Wrong)V4 (Correct)Notes
anime({ targets: '.el', ... })animate('.el', { ... })Targets = first arg
anime.timeline()createTimeline()Named import
anime.stagger(100)stagger(100)Named import
anime.set() / anime.get()utils.set() / utils.get()On utils object
anime.remove(targets)utils.remove(targets)On utils object
anime.random(0, 100)utils.random(0, 100)On utils object
translateX / translateY / translateZx / y / zShorthand transforms
easing: 'easeOutExpo'ease: 'outExpo'Param renamed, drop "ease" prefix
direction: 'alternate'alternate: trueBoolean property
direction: 'reverse'reversed: trueBoolean property
import anime from 'animejs'import { animate } from 'animejs'Named imports only
Timeline .add({ targets }).add(targets, params, pos)Targets = first arg of .add()
spring('mass:1')spring({ mass: 1, stiffness: 200 })Object params, not string
cubicBezier('0.7,0.1,0.5,0.9')cubicBezier(.7, .1, .5, .9)Numeric args

V4 Easing Names

Drop the "ease" prefix: easeOutExpooutExpo, easeInOutQuadinOutQuad. linear unchanged. Full list → references/easings.md.

API Reference

Load specific reference file for detailed params, methods, callbacks, and examples.

NeedAPIReference
Animate elementsanimate(targets, params)animation.md
Reactive animatable valuescreateAnimatable(targets, params)animatable.md
Sequence animationscreateTimeline(params)timeline.md
Frame loops / countdownscreateTimer(params)timer.md
Drag interactionscreateDraggable(targets, params)draggable.md
Scroll-driven animationsonScroll(params)events.md
Scope, media queries, cleanupcreateScope(params)scope.md
Text character/word splittingsplitText(targets, params)text.md
FLIP layout animationscreateLayout(params)layout.md
SVG morph / draw / motion pathsvg.morphTo(), svg.drawLine()svg.md
Lightweight WAAPI (3KB)waapi.animate(targets, params)web-animation-api.md
Easing functions, spring, beziereases, spring(), cubicBezier()easings.md
Stagger, get/set, math helpersutils, stagger()utilities.md
Global clock, fps, suspendengineengine.md
Setup, React integrationGetting started guidegetting-started.md

Common Patterns

Staggered entrance

import { animate, stagger } from 'animejs';
animate('.item', {
  y: [-20, 0], opacity: [0, 1],
  delay: stagger(80, { from: 'center' }),
  ease: 'outExpo', duration: 600,
});

Timeline sequence

import { createTimeline } from 'animejs';
const tl = createTimeline({ defaults: { duration: 750, ease: 'outExpo' } });
tl.add('.a', { x: '15rem' }, 0)
  .add('.b', { x: '15rem' }, '<')         // starts with previous
  .add('.c', { x: '15rem' }, '<-=500');    // 500ms before previous starts

Time positions: 0 (absolute ms), '<' (prev start), '<<' (prev end), '>>' (prev end), '<+=200' / '<-=200' (offset from prev start), '>>=200' (offset from prev end), 'label' / 'label+=500'.

Scroll-linked animation

import { animate, onScroll } from 'animejs';
animate('.progress', {
  scaleX: [0, 1],
  autoplay: onScroll({ target: '.content', enter: 'top bottom', leave: 'bottom top' })
});

Red Flags — V3 Code Detected

Stop and migrate if you see ANY of these:

  • anime({ or anime.timeline() — V3 constructor
  • translateX, translateY, translateZ — use x, y, z
  • easeIn*, easeOut*, easeInOut* prefix — drop "ease"
  • anime.stagger(), anime.set(), anime.get() — named imports / utils
  • direction: 'alternate' / direction: 'reverse' — use booleans
  • easing: parameter — V4 uses ease:
  • import anime from 'animejs' — use named imports { animate }
  • "anime is not a function" / "anime is not defined" — V4 has no default export
  • Animating width/height directly — use scaleX/scaleY or x/y for performance
  • Missing autoplay for scroll — pass autoplay: onScroll({...})
  • Not cleaning up in React — use createScope() + .revert() in cleanup

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

animejs

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

motion

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

animejs

No summary provided by upstream source.

Repository SourceNeeds Review
General

animejs

No summary provided by upstream source.

Repository SourceNeeds Review