Installation
Motion is available as separate packages optimized for React, JavaScript, and Vue. Choose the installation method that matches your project.React
For React projects, install themotion package:
React usage
Import Motion components frommotion/react:
Motion supports React 18 and 19. For React 18, you may need to install peer dependencies
react and react-dom.React peer dependencies
Motion requires React 18 or higher:JavaScript
For vanilla JavaScript or framework-agnostic projects, use the samemotion package:
JavaScript usage
Import theanimate function from motion:
Using a CDN
You can also use Motion directly from a CDN:Vue
For Vue 3 projects, install the dedicatedmotion-v package:
Vue usage
Import Motion components frommotion-v:
Package exports
Motion provides multiple entry points for different use cases:Main exports
motion- Full JavaScript/vanilla APImotion/react- Full React API with all featuresmotion/react-client- Client-only React components (for server-side rendering)
Optimized bundles
motion/mini- Minimal JavaScript API (~4KB)motion/react-mini- Minimal React API (~8KB)motion/react-m- Aliased asmfor smaller component names
TypeScript support
Motion is written in TypeScript and includes type definitions out of the box. No additional@types packages are needed.
Next steps
Quickstart
Build your first animation in 5 minutes