animejs

Orchestrate React animations with the useAnime hook and anime.js v4 named imports.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill animejs-matthewharwood
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: animejs
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/animejs
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill animejs-matthewharwood

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The producer of every animation surface. anime.js v4 is the only animation library, and the useAnime hook is the only way React mounts an animation — it enforces the side-channel rule (animations never run during render) by construction.

Core Features & Use Cases

  • Named imports for anime.js v4 (createTimeline, createAnimatable, createDraggable, createScope, stagger, utils) and the useAnime hook to mount animations safely.
  • Support for prefers-reduced-motion and a strict compiler-friendly lifecycle that ensures animations run after mount and are cleaned up on unmount.

Quick Start

Attach the useAnime hook to a ref and specify the animation parameters to run after the component mounts.

Frequently Asked Questions about animejs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run anime.js animations safely within the React render lifecycle?

To run anime.js animations safely in React, use a dedicated hook that enforces a side-channel rule ensuring animations never execute during render. This hook mounts animations only after the component mounts and handles automatic cleanup on unmount.

Does this anime.js React hook support prefers-reduced-motion for accessible web animations?

Yes, the anime.js React hook fully supports prefers-reduced-motion preferences to deliver accessible web animations. It inherently respects user accessibility settings by adjusting animation behavior during the component lifecycle.

What's the best way to orchestrate timeline-based motion in React without causing memory leaks?

The best way to orchestrate timeline-based motion in React without memory leaks is using a hook that provides named imports like createTimeline alongside automatic cleanup. This enforces strict lifecycle rules to prevent animation side effects.

Can I use anime.js v4 features like createDraggable and createAnimatable directly in React?

Yes, you can use anime.js v4 features like createDraggable and createAnimatable directly in React. The hook provides named imports for these utilities, allowing you to build interactive motion and draggable components safely.

Why do my React component animations break or cause side effects during re-renders?

React component animations break during re-renders because they are triggered during the render phase rather than after mount. An anime.js hook fixes this by enforcing a side-channel rule that restricts animation execution to post-mount.

How do I handle animation cleanup on unmount when using anime.js with React?

To handle animation cleanup on unmount with anime.js and React, use a dedicated hook that automatically tears down animations. It enforces a strict compiler-friendly lifecycle, ensuring all animation instances are destroyed when the component unmounts.