motion
Original:🇺🇸 English
Translated
Web animations with Motion (formerly Framer Motion) for React -- gestures, scroll effects, spring physics, layout animations, SVG, micro-interactions, loading states. Use when: drag-and-drop, scroll animations, modals, carousels, parallax, page transitions, hover effects, staggered lists, loading spinners, number counters. Troubleshoot: AnimatePresence exit, list performance, Tailwind conflicts, Next.js "use client", layout in scaled containers.
12installs
Sourceoakoss/agent-skills
Added on
NPX Install
npx skill4agent add oakoss/agent-skills motionTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Motion
Overview
Motion (package: , formerly ) is the standard React animation library. Import from . Provides declarative props for gestures, scroll-linked animations, layout transitions, SVG path drawing, and spring physics. Uses a hybrid animation engine (WAAPI for transforms/opacity, ScrollTimeline for scroll-linked effects). Bundle ranges from 2.3 KB (useAnimate mini) to 34 KB (full), optimizable to 4.6 KB with LazyMotion. Compatible with React 18.2+, React 19, Next.js App Router, and Vite.
motionframer-motionmotion/reactDo NOT use Motion for simple list add/remove animations (use AutoAnimate instead at 3.28 KB). Do NOT use for 3D (use Three.js / React Three Fiber).
Quick Reference
| Pattern | API / Props |
|---|---|
| Fade in on mount | |
| Exit animations | |
| Staggered list | |
| Hover / tap / focus | |
| Drag | |
| Scroll-triggered | |
| Scroll-linked/parallax | |
| Progress indicator | |
| Layout animation | |
| Shared element | |
| Layout group | |
| Page transition | |
| SVG path drawing | |
| Animated counter | |
| Imperative control | |
| Custom components | |
| Bundle optimization | |
| Reduced motion | |
Common Mistakes
| Mistake | Correct Pattern |
|---|---|
| AnimatePresence inside a conditional | Keep AnimatePresence mounted; place conditional content inside it |
Missing unique | Add unique |
Tailwind | Remove Tailwind transition classes to avoid stuttering |
Importing from | Use |
| Animating 50+ items without virtualization | Use react-window or @tanstack/react-virtual for large lists |
| Full 34 KB bundle for simple animations | Use LazyMotion + domAnimation (4.6 KB) or useAnimate (2.3 KB) |
Missing | Add directive or use |
Animating | Use |
No | Wrap app in |
Delegation
- Audit animation performance and bundle size: Use agent to find heavy imports, missing LazyMotion, and reflow-triggering properties
Explore - Build complex multi-step animations: Use agent for scroll-linked parallax, shared layout transitions, and staggered sequences
Task - Plan animation architecture for a new project: Use agent to evaluate Motion vs AutoAnimate vs CSS-only based on requirements
Plan
If theskill is available, delegate animation token definitions and motion design guidelines to it.design-system
References
- Core Patterns -- Animation patterns: fade, exit, stagger, gestures, modal, accordion, tabs, scroll, layout, drag, SVG, loading
- Scroll Animations -- useScroll, useTransform, scroll-triggered, parallax, progress indicators, offset configuration
- Performance -- LazyMotion, useAnimate, hardware acceleration, virtualization, production checklist
- Next.js Integration -- App Router patterns, motion/react-client, Pages Router, known issues
- Accessibility & CSS -- prefers-reduced-motion, MotionConfig, useReducedMotion, CSS keyframes, Tailwind animations
- Library Selection Guide -- Motion vs AutoAnimate decision guide with feature comparison and use-case recommendations
- Troubleshooting -- AnimatePresence bugs, Tailwind conflicts, layout glitches, React 19 issues, naming migration