motion-react

Implements React UI animations with the Motion library covering enter/exit, variants, layout transitions, and reduced-motion accessibility.

1|1|Updated May 24, 2026
One-click install
npx skills add https://github.com/bm629/agent-skills --skill motion-react-bm629
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: motion-react
Source: https://github.com/bm629/agent-skills/tree/main/skills/motion-react
Command: npx skills add https://github.com/bm629/agent-skills --skill motion-react-bm629

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires motion, @formkit/auto-animate, and includes references (resource) components.

What problem does it solve? Adding animation to a React app involves choosing between CSS transitions, AutoAnimate, and the Motion library, then getting accessibility, performance, and test stability right — mistakes like animating layout properties, ignoring prefers-reduced-motion, or breaking exit animations with unstable keys are common and costly. ## Core Features & Use Cases - Tool selection guidance: A decision table routes each job to plain CSS/Tailwind, AutoAnimate, Motion, or the View Transitions API so Motion is only used where JS lifecycle control is genuinely needed. - Full Motion API coverage: Enter/exit animations with AnimatePresence, variant orchestration with stagger(), layout and shared-element transitions via layoutId, motion values, imperative animate() sequences, number tickers, and drag gestures. - Accessibility and performance as hard rules: MotionConfig reducedMotion="user" at the root, transform/opacity-only animation, WCAG 2.3.3/2.2.2 compliance, and deterministic tests via MotionGlobalConfig.skipAnimations. - Use Case: When building a dashboard that needs list add/remove animations, a sliding tab indicator, and an animated stat counter, this Skill provides the exact patterns — including the Radix forceMount integration and router page-transition freezing — with reduced-motion degradation built in. ## Quick Start Use the motion-react skill to add an exit animation and staggered list entrance to my React component with reduced-motion support.

Frequently Asked Questions about motion-react

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add exit animations in React with Motion?

Wrap the conditional element in AnimatePresence from motion/react and give each child a stable, unique key plus an exit prop. Exit animations only run on direct children of AnimatePresence, and array-index keys silently break them.

Motion vs CSS transitions vs AutoAnimate for React animations?

Use CSS/Tailwind transitions for hover and simple state styling, AutoAnimate for zero-config list add/remove/move, and Motion when you need exit animations, orchestrated sequences, shared elements, springs, or drag. Escalate to Motion only when simpler tiers cannot express the interaction.

Is framer-motion the same as the motion package?

Motion is the renamed, independent successor to framer-motion, published as the npm package motion with React imports from motion/react. New projects should use motion; old framer-motion idioms like staggerChildren are deprecated in favor of delayChildren: stagger().

How do I support prefers-reduced-motion with Motion in React?

Set MotionConfig reducedMotion="user" at the app root, which disables transform and layout animations while keeping opacity fades. Imperative animate() calls bypass this context, so gate them manually with the useReducedMotion hook.

Why does my AnimatePresence exit animation never play?

The element is not a direct child of AnimatePresence, its key is unstable (such as an array index), or the AnimatePresence itself unmounts with the element. Fix the component tree structure rather than the animation values.

How do I test React components that use Motion animations?

Set MotionGlobalConfig.skipAnimations = true in the test setup so animations complete instantly, then assert end states. Stub window.matchMedia in jsdom for reduced-motion paths, and use Playwright with reducedMotion: "reduce" for e2e verification.