Creates 120fps GPU-accelerated animations with Motion.dev (Framer Motion successor) for React, Next.js, Svelte, and Astro projects. Use when user requests animation, motion, scroll effects, parallax, hero animations, gestures, drag interactions, spring physics, whileHover effects, whileInView animations, animated UI, micro-interactions, page transitions, or layout animations. Generates production TypeScript/JSX code with accessibility (prefers-reduced-motion) and performance validation (≥60fps). Supports entrance animations, gesture interactions (hover/tap/drag), scroll-based reveals, and layout transitions using spring physics and natural timing. Do NOT use for CSS-only transitions (use native CSS), static sites without JavaScript, Vue animations (use motion-v variant instead), or SVG/Canvas complex animations (GSAP better suited).
Motion.dev - 10M+ downloads/month, successor to Framer Motion 120fps GPU-accelerated animations for React, Next.js, Svelte, Astro, Vue
Generate production-grade animations using Motion.dev following Apple/Jon Ive principles: Purposeful (serves function) | Smooth (120fps) | Accessible (reduced-motion) | Performant (GPU-only) | Elegant (subtle) | Consistent (unified timing)
✅ Use for:
❌ Don't use for:
transition property)motion-v package - different API)Determine project context and animation goals:
Define implementation approach:
Build animations incrementally:
Check against requirements:
INPUT: What should animate?
├─ ENTRANCE (page load, mount)
│ → Pattern: initial={{opacity: 0, y: 20}} animate={{opacity: 1, y: 0}}
│ → Timing: 0.6-0.8s, ease: [0.22, 1, 0.36, 1]
│ → Stagger: 0.1-0.2s between elements
│ → Example: ./examples/hero-fade-up.md
│
├─ GESTURE (hover, tap, drag)
│ → Pattern: whileHover={{scale: 1.05}}, whileTap={{scale: 0.95}}
│ → Physics: Spring (stiffness: 300-400, damping: 20)
│ → Timing: Instant response (no duration)
│ → Examples: ./examples/card-hover.md, ./examples/magnetic-button.md
│
├─ SCROLL (reveal, parallax)
│ → Pattern: whileInView + viewport OR useScroll + useTransform
│ → Trigger: viewport={{once: true, amount: 0.3}}
│ → Performance: Transform/opacity only
│ → Examples: ./examples/scroll-reveal.md, ./examples/parallax-layers.md
│
└─ LAYOUT (reorder, expand)
→ Pattern: layout prop (auto FLIP)
→ Shared: layoutId="id" for morphing
→ Caveat: Only animates transforms| Component/Hook | Usage | When |
|---|---|---|
| motion.div | <motion.div animate={{x: 100}}> | Basic animations |
| whileHover | whileHover={{scale: 1.05}} | Hover states (0.2-0.3s) |
| whileTap | whileTap={{scale: 0.95}} | Click feedback |
| whileInView | whileInView={{opacity: 1}} | Scroll reveal |
| drag | drag="x" dragConstraints | Draggable elements |
| layout | <motion.div layout /> | Auto FLIP animation |
| useScroll | Track scroll progress | Parallax, progress bars |
| useTransform | Map values | Scroll-linked effects |
| useSpring | Spring physics | Smooth value changes |
| useInView | Viewport detection | Trigger animations |
Full API: See Complete API Reference
| Framework | Import | Components | Exit Animations |
|---|---|---|---|
| React/Next.js | "motion/react" | <motion.div> | <AnimatePresence> |
| Svelte | "motion" | Vanilla API | N/A |
| Astro | "motion" | Client scripts | N/A |
| Vue | "motion-v" | <motion.div> | Similar to React |
| Category | Requirement | How to Verify |
|---|---|---|
| Performance | ≥60fps | Chrome DevTools → Performance |
| GPU-accel | transform/opacity only | No width/height/left/top |
| Bundle | <50KB | webpack-bundle-analyzer |
| Accessibility | prefers-reduced-motion | System settings test |
| Mobile | Touch-friendly | iOS/Android testing |
| Layout shift | CLS = 0 | Lighthouse audit |
Load on-demand based on animation type:
Full examples: All files in ./examples/ directory
# React/Next.js/Svelte/Astro
npm install motion
# Vue
npm install motion-v<motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1] }} /><motion.div whileHover={{ y: -8, boxShadow: '0 20px 40px rgba(0,0,0,0.12)' }} transition={{ type: 'spring', stiffness: 300, damping: 20 }} /><motion.div initial={{ opacity: 0, y: 50 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true, amount: 0.3 }} />More patterns: Staggered lists, exit animations, layout transitions → ./examples/ directory
| Issue | Solution |
|---|---|
| Animation doesn't trigger | Check initial ≠ animate values |
| Poor performance | Use transform/opacity only + will-change CSS |
| Layout shift | Set explicit dimensions, use layout prop |
| Exit not working | Wrap with <AnimatePresence>, add key prop |
Apply these design principles to all animations:
For structured output validation, see:
Version: 3.0.0 (Research-Backed Optimization) Optimization: Imperative language, few-shot patterns (3 examples), layered complexity, progressive loading Token Efficiency: 87% core reduction (15K → 2K) + auto-caching Motion.dev: v11+ Frameworks: React 19+, Next.js 15+, Svelte 5+, Astro 4+, Vue 3+ Research: arXiv 2402.07927v1, 2211.01910, 2310.14735v5, PubMed 40334089 License: MIT
8a737ca
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.