Motion (formerly Framer Motion) for React animations. Covers transitions, gestures, layout animations, and exit animations. Triggers on motion, animate, framer.
Provides Motion (Framer Motion successor) for React animations. Triggers when you use `motion`, `animate`, or `framer` to create transitions, gestures, layout animations, and exit animations.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
<mcp_first> CRITICAL: Fetch Motion documentation before implementing.
MCPSearch({ query: "select:mcp__plugin_devtools_context7__query-docs" })
// Motion component patterns
mcp__context7__query_docs({
libraryId: "/motiondivision/motion",
query: "How do I use motion.div with animate, initial, and exit props?",
});
// Variants and orchestration
mcp__context7__query_docs({
libraryId: "/motiondivision/motion",
query: "How do I use variants and staggerChildren for orchestration?",
});
// Layout animations
mcp__context7__query_docs({
libraryId: "/motiondivision/motion",
query: "How do I use layout and layoutId for shared layout animations?",
});
// Gestures
mcp__context7__query_docs({
libraryId: "/motiondivision/motion",
query: "How do I use whileHover, whileTap, and drag gestures?",
});
Note: Context7 v2 uses server-side filtering. Use descriptive natural language queries. </mcp_first>
<quick_start> Basic animation:
import { motion } from "motion/react";
function FadeIn() {
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3 }}
>
Hello!
</motion.div>
);
}
Exit animations:
import { motion, AnimatePresence } from "motion/react";
function Modal({ isOpen, onClose }) {
return (
<AnimatePresence>
{isOpen && (
<motion.div
initial={{ opacity: 0, scale: 0.9 }}
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.9 }}
>
<button onClick={onClose}>Close</button>
</motion.div>
)}
</AnimatePresence>
);
}
Gestures:
<motion.button whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }}>
Click me
</motion.button>
</quick_start>
<patterns> **Variants (reusable animations):**const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.1,
},
},
};
const itemVariants = {
hidden: { opacity: 0, y: 20 },
visible: { opacity: 1, y: 0 },
};
function List({ items }) {
return (
<motion.ul variants={containerVariants} initial="hidden" animate="visible">
{items.map((item) => (
<motion.li key={item.id} variants={itemVariants}>
{item.name}
</motion.li>
))}
</motion.ul>
);
}
Layout animations:
<motion.div layout>
{/* Content changes trigger smooth layout animation */}
</motion.div>
Shared layout (magic move):
<motion.div layoutId="card">
{/* Same layoutId creates shared transition */}
</motion.div>
Spring physics:
<motion.div
animate={{ x: 100 }}
transition={{
type: "spring",
stiffness: 300,
damping: 20,
}}
/>
Keyframes:
<motion.div
animate={{
scale: [1, 1.2, 1],
rotate: [0, 180, 360],
}}
transition={{ duration: 2 }}
/>
</patterns>
<hooks>
```typescript
import { useAnimate, useMotionValue, useTransform, useSpring } from "motion/react";
// Imperative animations const [scope, animate] = useAnimate(); animate(scope.current, { opacity: 1 });
// Motion values for performance const x = useMotionValue(0); const opacity = useTransform(x, [0, 100], [1, 0]);
// Spring-based values const smoothX = useSpring(x, { stiffness: 300 });
</hooks>
<constraints>
**Best practices:**
- Use `layoutId` for shared element transitions
- Wrap conditional renders in `AnimatePresence`
- Use `variants` for complex orchestration
- Prefer `spring` transitions for natural feel
- Use `useMotionValue` for frequently updating values
**Performance:**
- Animate `transform` and `opacity` (GPU accelerated)
- Avoid animating `width`, `height` (use `scale`)
- Use `layout` prop sparingly (can be expensive)
</constraints>
<success_criteria>
- [ ] Context7 docs fetched for current API
- [ ] Exit animations wrapped in AnimatePresence
- [ ] Variants used for staggered children
- [ ] Performance-friendly properties animated
- [ ] Spring transitions for natural feel
</success_criteria>
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.