secondsky/claude-skills / plugins/auto-animate/skills/auto-animate
auto-animate
VerifiedAutoAnimate (@formkit/auto-animate) zero-config animations for React. Use for list transitions, accordions, toasts, or encountering SSR errors, animation libraries complexity.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.4 KB |
| assets/example-template.txt | markdown | 416 B |
| references/auto-animate-vs-motion.md | markdown | 9.8 KB |
| references/css-conflicts.md | markdown | 13.0 KB |
| references/example-reference.md | markdown | 760 B |
| references/ssr-patterns.md | markdown | 12.4 KB |
| scripts/example-script.shexecutable | script | 302 B |
| scripts/init-auto-animate.shexecutable | script | 8.8 KB |
| templates/accordion.tsx | other | 2.7 KB |
| templates/filter-sort-list.tsx | other | 3.2 KB |
| templates/form-validation.tsx | other | 4.2 KB |
| templates/react-basic.tsx | other | 2.8 KB |
| templates/react-typescript.tsx | other | 4.7 KB |
| templates/toast-notifications.tsx | other | 1.9 KB |
| templates/vite-ssr-safe.tsx | other | 4.2 KB |
templates/react-basic.tsx
View on GitHub// AutoAnimate - Basic React Example
// @formkit/auto-animate v0.10.0
import { useAutoAnimate } from "@formkit/auto-animate/react";
import { useState } from "react";
/**
* Example: Simple List Animation with AutoAnimate
*
* Key Features:
* - Zero config - just add the ref
* - Automatically animates add/remove/move
* - Respects prefers-reduced-motion
* - Works with any list structure
*/
interface Item {
id: number;
text: string;
}
export function BasicListExample() {
// 1. Get the ref from useAutoAnimate hook
const [parent] = useAutoAnimate();
// 2. Set up state
const [items, setItems] = useState<Item[]>([
{ id: 1, text: "Item 1" },
{ id: 2, text: "Item 2" },
{ id: 3, text: "Item 3" },
]);
// 3. Functions to modify the list
const addItem = () => {
const newId = Math.max(...items.map(item => item.id), 0) + 1;
setItems([...items, { id: newId, text: `Item ${newId}` }]);
};
const removeItem = (id: number) => {
setItems(items.filter(item => item.id !== id));
};
const shuffleItems = () => {
setItems([...items].sort(() => Math.random() - 0.5));
};
return (
<div className="space-y-4 p-6">
{/* Controls */}
<div className="flex gap-2">
<button
onClick={addItem}
className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700"
>
Add Item
</button>
<button
onClick={shuffleItems}
className="px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700"
>
Shuffle
</button>
</div>
{/* 4. Attach ref to parent element - that's it! */}
<ul ref={parent} className="space-y-2">
{items.map((item) => (
<li
key={item.id}
className="flex items-center justify-between p-4 bg-white border rounded shadow-sm"
>
<span>{item.text}</span>
<button
onClick={() => removeItem(item.id)}
className="px-3 py-1 bg-red-500 text-white rounded hover:bg-red-600"
>
Remove
</button>
</li>
))}
</ul>
</div>
);
}
/**
* CRITICAL:
* - ✅ Always use unique, stable keys for list items
* - ✅ Attach ref to immediate parent of animated children
* - ✅ Parent element must always be in DOM (not conditionally rendered)
* - ✅ AutoAnimate respects prefers-reduced-motion automatically
*/
/**
* Common Mistakes:
*
* ❌ Wrong: Conditional parent
* {showList && <ul ref={parent}>...</ul>}
*
* ✅ Correct: Always-rendered parent, conditional children
* <ul ref={parent}>{showList && items.map(...)}</ul>
*
* ❌ Wrong: Missing or non-unique keys
* {items.map((item, index) => <li key={index}>...)}
*
* ✅ Correct: Unique, stable keys
* {items.map(item => <li key={item.id}>...)}
*/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |