PACKAGE · ANIMATION

motion

An animation library for JavaScript and React.

WEEKLY DOWNLOADS 14.5M
STARS 33.1K
FORKS 1.3K
OPEN ISSUES 113
GZIP SIZE 45.3 kB
UNPACKED SIZE 683.1 kB
DEPENDENCIES 2
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

motion downloads — last 12 months

Download trends for motion1 download series from Aug 2025 to Jul 2026. Use left and right arrow keys to inspect monthly values.016.9M33.8M50.7M67.6MAug 2025NovFebMayJul 2026
motion
ABOUT MOTION

Motion is a powerful animation library designed to bring dynamic and engaging visual experiences to JavaScript and React applications. It abstracts away the complexities of web animations, providing a declarative and intuitive API for developers to create sophisticated transitions and animations without deep knowledge of lower-level animation APIs like Web Animations or Greensock. The library aims to make animation accessible and manageable within modern web development workflows.

At its core, Motion is built around a philosophy of expressive animation control and developer ergonomics. It caters to frontend developers, UI/UX designers, and animators who want to integrate fluid motion into their interfaces. The primary goal is to enable rich, performant animations that enhance user interaction and visual appeal while maintaining code clarity and maintainability. The library focuses on physics-based animations and smooth easing functions.

Motion offers a hook-based API when used with React, such as `useMotionValue` for tracking animated values and `useTransform` for mapping one value to another. It also provides components like `motion.div` which allow direct application of animation props to DOM elements. This declarative approach makes it easy to define animation states, transitions, and gestures directly within your component tree, simplifying complex animation sequences.

The library integrates seamlessly into modern React applications, but its core animation engine can also be used in vanilla JavaScript projects or with other view layers. It is particularly well-suited for projects utilizing component-based architectures and declarative state management. Its compatibility with common build tools and frontend frameworks makes adoption straightforward.

With a substantial weekly download count of 13.9M and 33.0K GitHub stars, Motion is a mature and widely-used library. Its unpacked size is 683.1 kB, with a gzipped bundle size of 45.3 kB, representing a reasonable trade-off for the advanced animation capabilities it provides. Developers can leverage its extensive features for a wide range of interactive elements and UI enhancements. The last update was July 28, 2026, indicating recent maintenance.

While highly capable, developers should be aware that for extremely simple, one-off property tweens, the library's overhead might be greater than a custom CSS transition or a lighter animation utility. However, for complex sequences, physics-based interactions, or gesture-driven animations with intricate state management, Motion's comprehensive feature set typically justifies its inclusion.

WHEN TO USE
  • When creating complex, multi-stage entrance and exit transitions for components in React applications.
  • For implementing physics-based animations, such as spring or decay, using `useSpring` or `useDecay` hooks.
  • To animate SVG elements and SVG path data declaratively.
  • When building gesture-driven interfaces that respond to drag, pinch, or rotate events with `usePanGesture` or similar hooks.
  • To synchronize animations with scroll position or other external values using `useScroll` and `useTransform`.
  • When integrating animations into a component-driven UI architecture for consistent styling and behavior.
  • For creating animated layouts and staggering elements into view with precise control over timing and easing.
WHEN NOT TO USE
  • If you only need to animate a single CSS property and can achieve the effect with simple CSS transitions.
  • When targeting environments that do not support modern JavaScript features or require extremely minimal bundle sizes.
  • If your animation requirements are limited to basic 'fade-in'/'fade-out' controlled solely via CSS classes.
  • For projects where animations are purely decorative and do not impact user interaction or interface state.
  • If the project solely requires simple, non-physics-based, timed animations that can be managed with `requestAnimationFrame` directly.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 4
motion vs animejs ★ 71.8K · 919.6K/wk motion vs gsap ★ 27.4K · 3.7M/wk motion vs framer-motion ★ 33.1K · 34.9M/wk motion vs @formkit/auto-animate ★ 13.9K · 989.1K/wk