react-motion
Installation
SKILL.md
React Motion (Motion for React)
1. Setup
- New code:
npm i motionandimport { motion, AnimatePresence } from "motion/react". - If the project already uses
framer-motion, keep it consistent; to migrate, swap the package and change importsframer-motion→motion/react(API is the same). - Next.js App Router: components using
motion.*must be client components ("use client"). For server components, useimport * as motion from "motion/react-client". - Wrap the app once:
<MotionConfig reducedMotion="user" transition={{ duration: 0.3, ease: [0.22, 1, 0.36, 1] }}>
- Bundle-size sensitive? Use
LazyMotion+mcomponents withdomAnimationfeatures.