Back to Skills

motion-framer

Modern animation library for React and JavaScript. Create smooth, production-ready animations with motion components, variants, gestures (hover/tap/drag), layout animations, AnimatePresence exit animations, spring physics, and scroll-based effects. Use when building interactive UI components, micro-interactions, page transitions, or complex animation sequences.

483stars71forksUpdated 7/9/2026

Security Assessment

Safe(100/100)
Security Score100/100

About motion-framer

A practical reference for building animations in React (and JavaScript or Vue) with Motion, the modern successor to Framer Motion. It centers on motion components, HTML or SVG elements prefixed with motion. that accept animation and gesture props. Core concepts include the animate prop, which tweens to target values whenever they change, the initial prop for pre-animation state (or initial set to false to skip the mount animation), and the transition prop for controlling motion, with three types: tween (duration plus easing), spring (physics-based stiffness and damping), and inertia (decelerating, used in drag). Per-property transitions are supported.

Variants let you name animation states for cleaner code and automatic propagation to children, including staggerChildren for sequenced list reveals and beforeChildren/afterChildren ordering. Gesture recognition is covered through whileHover and whileTap, which accept inline values or variant names and can carry their own transitions, plus drag interactions via the drag prop: axis locking (drag x or y), dragConstraints (numeric bounds or a ref), whileDrag feedback, dragElastic, dragTransition, and onDragStart/onDrag/onDragEnd events exposing point, offset, and velocity.

Exit animations use AnimatePresence: children must be direct descendants with a unique key and an exit prop, enabling modal fade-outs, animated list removal (paired with layout for smooth shifts), and staggered exits. Use it when building interactive UI components, micro-interactions, hover effects, page and route transitions, scroll-based and parallax effects, layout and shared-element transitions, drag-and-drop interfaces, or complex state-driven sequences, essentially wherever CSS transitions fall short. It is compatible with React 18+, TypeScript, and frameworks such as Next.js, Vite, and Remix.

FAQ

What is the difference between Motion and Framer Motion?

Motion (v11+) is the modern, smaller library from the Framer Motion creators, while Framer Motion is the full-featured predecessor that remains widely used; both are covered here.

How do I make an element draggable?

Add the drag prop, then constrain it with drag x or y or with dragConstraints (numeric bounds or a ref), and use whileDrag for visual feedback.

How do I animate a component as it leaves the DOM?

Wrap it in AnimatePresence, give it a unique key, and define an exit prop; the component must be a direct child of AnimatePresence.

What transition types are available?

tween (duration-based with easing, the default), spring (physics-based via stiffness and damping), and inertia (decelerating, used during drag).

How do child animations get staggered?

Use variants on a parent with staggerChildren in its transition; children inherit the parent's variant state and animate in sequence.

All Files

15 files
assets/starter_motion/src/components/HoverCard.jsx0.8 KB
View
scripts/animation_generator.py15.2 KB
View
assets/starter_motion/package.json0.4 KB
View
assets/starter_motion/README.md6.5 KB
View
assets/starter_motion/src/components/DraggableBox.jsx1.4 KB
View
references/api_reference.md20.0 KB
View
assets/starter_motion/index.html0.9 KB
View
assets/starter_motion/src/components/StaggerList.jsx1.5 KB
View
scripts/variant_builder.py13.6 KB
View
assets/starter_motion/src/App.css1.7 KB
View
assets/starter_motion/src/main.jsx0.2 KB
View
SKILL.md20.5 KB
View
assets/examples/README.md72.2 KB
View
assets/starter_motion/src/App.jsx3.4 KB
View
assets/starter_motion/vite.config.js0.2 KB
View

Install motion-framer

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill