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/accordion.tsx
View on GitHub// AutoAnimate - Accordion Example
// Smooth expand/collapse animations
import { useAutoAnimate } from "@formkit/auto-animate/react";
import { useState } from "react";
interface AccordionItem {
id: string;
title: string;
content: string;
}
const items: AccordionItem[] = [
{
id: "1",
title: "What is AutoAnimate?",
content:
"AutoAnimate is a zero-config, drop-in animation utility that automatically adds smooth transitions to elements.",
},
{
id: "2",
title: "How do I use it?",
content:
"Just import useAutoAnimate, get a ref, and attach it to a parent element. That's it!",
},
{
id: "3",
title: "Is it accessible?",
content:
"Yes! AutoAnimate automatically respects prefers-reduced-motion settings.",
},
];
export function AccordionExample() {
const [openId, setOpenId] = useState<string | null>(null);
const toggle = (id: string) => {
setOpenId(openId === id ? null : id);
};
return (
<div className="max-w-2xl mx-auto p-6 space-y-2">
{items.map((item) => (
<AccordionItem
key={item.id}
item={item}
isOpen={openId === item.id}
onToggle={() => toggle(item.id)}
/>
))}
</div>
);
}
function AccordionItem({
item,
isOpen,
onToggle,
}: {
item: AccordionItem;
isOpen: boolean;
onToggle: () => void;
}) {
// Animate the content div
const [parent] = useAutoAnimate();
return (
<div className="border rounded overflow-hidden">
{/* Header (always visible) */}
<button
onClick={onToggle}
className="w-full flex items-center justify-between p-4 bg-gray-50 hover:bg-gray-100 text-left"
>
<span className="font-semibold">{item.title}</span>
<svg
className={`w-5 h-5 transition-transform ${
isOpen ? "rotate-180" : ""
}`}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
{/* Content (conditionally rendered, animated by parent ref) */}
<div ref={parent}>
{isOpen && (
<div className="p-4 bg-white border-t">
<p className="text-gray-700">{item.content}</p>
</div>
)}
</div>
</div>
);
}
/**
* Key Pattern:
* - Parent ref wraps the conditionally rendered content
* - Parent div is always in DOM (not conditional)
* - Only the child content is conditional
*
* ❌ Wrong: <div ref={parent}>{isOpen && <div>...</div>}</div> is outside component
* ✅ Correct: <div ref={parent}>{isOpen && <div>...</div>}</div> inside component
*/
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 |