motion
Installation
SKILL.md
Motion
Motion is a production-grade animation library for React and JavaScript — formerly known as Framer Motion, now independent and expanded to support vanilla JS and other frameworks.
Documentation
- Docs: https://motion.dev/docs/
Key Capabilities
- Declarative animations:
motioncomponents animate viainitial,animate, andexitprops — no manual DOM manipulation - Variants: Named animation states shared across component trees, with automatic stagger and orchestration
- Exit animations:
AnimatePresencekeeps unmounting components in the DOM until theirexitanimation completes - Layout animations:
layoutprop uses FLIP technique to animate any CSS layout change automatically - Gestures: Built-in
whileHover,whileTap,whileDrag, andwhileFocusprops with full event callbacks - Motion values:
useMotionValueanduseTransformcreate composable, signal-like values that update outside React's render cycle - Imperative API:
animate()function anduseAnimatehook for programmatic control, usable outside React - Spring physics: Default transition is spring-based; configure with
type: "spring",stiffness,damping,mass - Scroll animations:
useScrollanduseTransformfor scroll-linked animations without scroll event listeners