Basic information
About auto-animate
Zero-config animations for React, Vue, Solid, Svelte, Preact with @formkit/auto-animate (3.28kb). Prevents 15 documented errors including React 19 StrictMode bugs, SSR imports, conditional parents, viewport issues, drag & drop conflicts, and CSS transform bugs. Use when: animating lists/accordions/toasts, troubleshooting SSR animation errors, React 19 StrictMode issues, or need accessible drop-in transitions with auto prefers-reduced-motion.
auto-animate is an agent skill listed in the AddMCP.net directory, published by openclaw. Source code is hosted on github.com.
Overview
What is auto-animate?
name: auto-animate description: | Zero-config animations for React, Vue, Solid, Svelte, Preact with @formkit/auto-animate (3.28kb). Prevents 15 documented errors including React 19 StrictMode bugs, SSR imports, conditional parents, viewport issues, drag & drop conflicts, and CSS transform bugs.
Use when: animating lists/accordions/toasts, troubleshooting SSR animation errors, React 19 StrictMode issues, or need accessible drop-in transitions with auto prefers-reduced-motion. user-invocable: true
AutoAnimate - Error Prevention Guide
Package: @formkit/[email protected] (current) Frameworks: React, Vue, Solid, Svelte, Preact Last Updated: 2026-01-21
SSR-Safe Pattern (Critical for Cloudflare Workers/Next.js)
// Use client-only import to prevent SSR errors
import { useState, useEffect } from "react";
export function useAutoAnimateSafe<T extends HTMLElement>() {
const [parent, setParent] = useState<T | null>(null);
useEffect(() => {
if (typeof window !== "undefined" && parent) {
import("@formkit/auto-animate").then(({ default: autoAnimate }) => {
autoAnimate(parent);
});
}
}, [parent]);
return [parent, setParent] as const;
}
Why this matters: Prevents Issue #1 (SSR/Next.js import errors). AutoAnimate uses DOM APIs not available on server.
Known Issues Prevention (15 Documented Errors)
- ...
- {showList && items.map(...)}
- {{ item.text }}
- {{ item.text }}
-
{items.map(item => (
- {item.text} ))}
-
{items.map(item => (
- {item.text} ))}
-
{/* items */}
Critical Rules (Error Prevention)
- }`
❌ **Index as key** - `key={index}` breaks animations
❌ **Ignore SSR** - Will break in Cloudflare Workers/Next.js
❌ **Force animations** - `disrespectUserMotionPreference: true` breaks accessibility
❌ **Animate tables directly** - Use tbody or div-based layout
❌ **Skip unique keys** - Required for proper animation
❌ **Complex animations** - Use Motion instead
**Note**: AutoAnimate respects `prefers-reduced-motion` automatically (never disable this).
---
Community Tips (Community-Sourced)
Note: These tips come from community discussions. Verify against your version.
Tip: Prevent Test Freezing with Mocked Package
Source: Issue #230 | Confidence: MEDIUM Applies to: v0.8.2+
Tests may freeze for ~10 seconds when package is mocked. Add ResizeObserver mock:
// jest.setup.js
global.ResizeObserver = jest.fn().mockImplementation(() => ({
observe: jest.fn(),
unobserve: jest.fn(),
disconnect: jest.fn(),
}));
// __mocks__/@formkit/auto-animate.js
const autoAnimate = jest.fn(() => () => {});
const useAutoAnimate = jest.fn(() => [null, jest.fn(), jest.fn()]);
module.exports = { default: autoAnimate, useAutoAnimate };
Tip: Memory Leak Prevention
Source: Issue #180 | Confidence: LOW Applies to: All versions
For long-lived SPAs, ensure proper cleanup:
useEffect(() => {
const cleanup = autoAnimate(parent.current);
return () => cleanup && cleanup();
}, []);
// useAutoAnimate hook handles cleanup automatically
const [parent] = useAutoAnimate(); // Preferred
Package Versions
Latest: @formkit/[email protected] (Sept 5, 2025)
Recent Releases:
- v0.9.0 (Sept 5, 2025) - Current stable
- v0.8.2 (April 10, 2024) - Fixed Nuxt 3 ESM imports, ResizeObserver guard
{
"dependencies": {
"@formkit/auto-animate": "^0.9.0"
}
}
Framework Compatibility: React 18+, Vue 3+, Solid, Svelte, Preact
Important: For Nuxt 3 users, v0.8.2+ is required. Earlier versions have ESM import issues
Official Documentation
- Official Site: https://auto-animate.formkit.com
- GitHub: https://github.com/formkit/auto-animate
- npm: https://www.npmjs.com/package/@formkit/auto-animate
- React Docs: https://auto-animate.formkit.com/react
Templates & References
See bundled resources:
templates/- Copy-paste examples (SSR-safe, accordion, toast, forms)references/- CSS conflicts, SSR patterns, library comparisons
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In