framer-motion-animations
/framer-motion-animations
Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.
- Author
- nextboxis ↗
- Repository
- library-skill-agents ↗
- Licence
- MIT
- Last repository change
- 28.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.
Original author description
Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.
How it works
- When to use
- Prerequisites
- Step-by-step workflow
- Commands / code examples
- Common mistakes & pitfalls
- Verification checklist
- Related skills
SKILL.md preview
---
name: framer-motion-animations
description: Use this skill when implementing declarative physics-based micro-interactions, layout transitions, gestures, and exit animations in React.
---
# Framer Motion Animations
## When to use
Use this skill when building fluid UI animations in React, handling enter/exit transitions, animating modal dialogs, or creating drag-and-drop gestures.
## Prerequisites
- React 18+ project environment.
- `framer-motion` package installed (`npm install framer-motion`).
## Step-by-step workflow
1. **Convert to motion elements**: Replace standard HTML tags with motion equivalents (e.g., `motion.div`, `motion.button`).
2. **Define animate states**: Use `initial`, `animate`, and `exit` props or named `variants` for clean state transitions.
3. **Configure physics transitions**: Set `transition={{ type: 'spring', stiffness: 300, damping: 25 }}` for natural movement.
4. **Handle exit animations**: Wrap conditional components with `<AnimatePresence>` providing a unique `key` to each child.
5. **Respect reduced motion**: Check user system preferences with `useReducedMotion()` and suppress motion for sensitive users.
## Commands / code examples
```tsx
import React from 'react';
import { motion, AnimatePresence, useReducedMotion } from 'framer-motion';
interface ToastProps {
id: string;
message: string;
onDismiss: () => void;
}
export const Toast: React.FC<ToastProps> = ({ message, onDismiss }) => {
const shouldReduceMotion = useReducedMotion();
const variants = {
initial: { opacity: 0, y: shouldReduceMotion ? 0 : 20, scale: 0.95 },
animate: { opacity: 1, y: 0, scale: 1 },
exit: { opacity: 0, scale: 0.9, transition: { duration: 0.15 } },
};
return (
<motion.div
variants={variants}
initial="initial"
animate="animate"
exit="exit"
transition={{ type: 'spring', stiffness: 400, damping: 30 }}
className="bg-gray-900 text-white p-4 rounded-lg shadow-xl flex items-center justify-between"
>
<span>{message}</span>
<button onClick={onDismiss} className="ml-4 text-sm text-gray-400 hover:text-white">
Close
</button>
</motion.div>
);
};
```
## Common mistakes & pitfalls
- Forgetting to provide a stable, unique `key` to children of `<AnimatePresence>`, breaking exit animation detection.
- Animating non-performant properties like `width`, `height`, or `top` instead of GPU-accelerated `transform` and `opacity`.
- Neglecting `useReducedMotion()`, triggering vestibular disorders for sensitive users.
## Verification checklist
- [ ] Animations primarily animate `transform` and `opacity` properties.
- [ ] Exit transitions are wrapped inside `<AnimatePresence>`.
- [ ] Reduced motion preferences are checked via `useReducedMotion()`.
- [ ] Spring physics parameters produce natural, non-oscillating settling.
## Related skills
- react-fundamentals
- react-hooks-patterns
- shadcn-ui-radix-primitives
- wcag-22-guidelines-conformance-levels
Versions
The database has no other skills named framer-motion-animations.
Database snapshot: 13.11.2026 · package version a8cde43f728f (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 91motion-framer
Use when implementing Motion or Framer Motion in React/JavaScript: interactive UI components, micro-interactions, gestures, layout or page transitions, and scroll-based animation. Do not use for static styling, backend/API work, or animation in another runtime unless… - 90framer-motion-animator
Creates smooth animations and micro-interactions using Framer Motion including page transitions, gestures, scroll-based animations, and orchestrated sequences. Use when users request "add animation", "framer motion", "page transition", "animate component", or "micro-interactions". - 100react-motion
Build UI animation in React/Next.js with Motion for React (formerly Framer Motion) — micro-interactions, enter/exit with AnimatePresence, layout and shared-element animations, gestures (hover, tap, drag), scroll-linked values, staggered lists, modals, tabs, menus, and page… - 100motion-design
Use when implementing motion design — page transitions, element animations, micro-interactions, layout animations. Covers Motion (ex Framer Motion), View Transitions API, auto-animate, SVG animation (Rive, Lottie), and accessibility. - 100framer-motion
Framer Motion performance optimization guidelines. This skill should be used when writing, reviewing, or refactoring React animations with Framer Motion to ensure optimal performance patterns. Triggers on tasks involving motion components, animations, gestures, layout… - 100framer-motion
Use when implementing Disney's 12 animation principles with Framer Motion in React applications