PACKAGE · ANIMATION

motion

An animation library for JavaScript and React.

WEEKLY DOWNLOADS 6.7M
STARS 32.2K
FORKS 1.2K
OPEN ISSUES 126
GZIP SIZE 46.4 kB
UNPACKED SIZE 634.1 kB
DEPENDENCIES 4
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

motion downloads — last 12 months

Download trends for motion1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.013.1M26.3M39.4M52.5MJun 2025SepDecMarMay 2026
motion
ABOUT MOTION

Motion is a powerful animation library designed to simplify the creation of engaging and dynamic user interfaces in JavaScript, with a particular emphasis on seamless integration within React applications. It addresses the common challenge of implementing complex, performant animations by providing a declarative API that abstracts away much of the manual DOM manipulation and timing logic. This allows developers to focus on the animation's intent rather than its intricate implementation details, making sophisticated motion graphics accessible.

The core philosophy behind Motion centers on developer experience and performance, aiming to empower creators of all skill levels to add rich animation to their projects. It achieves this through a highly intuitive API that feels natural to developers accustomed to modern JavaScript and React patterns. The library is built for both immediate visual feedback and long-term maintainability, making it suitable for a wide range of projects from small interactive elements to complex application transitions.

Key to Motion's approach is its hook-based API, such as `useMotionValue` for tracking animated values and `useTransform` for mapping one value to another, enabling intricate relationships between different animation properties. It also offers declarative components for React, allowing animations to be defined directly within your JSX. This pattern facilitates easier reasoning about animation states and transitions tied to component lifecycles and props, making complex sequences manageable.

Motion integrates smoothly into modern front-end workflows, particularly within the React ecosystem. It can be easily incorporated into existing React projects without significant configuration overhead. The library's design also plays well with state management solutions and routing libraries, ensuring that animations can be triggered and controlled based on application state changes or navigation events, enhancing the overall user experience.

With a packed size of 46.4 kB (gzipped), Motion offers a substantial feature set without imposing an excessive bundle size penalty. Its architecture is optimized for performance, leveraging efficient rendering techniques to ensure smooth animations, even in demanding scenarios. This makes it a compelling choice for projects where visual polish is important but load times are critical, offering a good balance between capability and efficiency.

While highly versatile, Motion's extensive feature set might introduce complexity for extremely simple animation needs. For animations that are purely CSS-based or involve minimal dynamic changes, a dedicated CSS animation approach or a simpler JavaScript library might suffice. However, for custom, physics-based, or complex interactive animations, Motion's expressive API is typically warranted.

WHEN TO USE
  • When creating physics-based animations using the `spring` or `keyframes` utilities for realistic motion.
  • For animating SVG elements and complex shapes with fine-grained control over path data and properties.
  • When building intricate scroll-driven animations that react dynamically to user scrolling behavior.
  • To implement complex component transitions and page load animations within a React application.
  • For animating elements based on user gestures like drag and pinch, leveraging Motion's gesture recognizers.
  • When integrating motion design principles into interactive prototypes and production-ready UI elements.
WHEN NOT TO USE
  • If your animation requirements are fully met by CSS transitions and keyframe animations alone, consider using CSS for a potentially smaller footprint.
  • When the project solely needs very basic, static visual changes that do not involve dynamic value tracking or physics.
  • If you are working in an environment where JavaScript execution is severely restricted or disabled for specific user segments.
  • For simple, one-off animations that can be trivially achieved with inline styles or minimal JavaScript without needing a dedicated library.
  • When the primary goal is to animate purely static assets without any interaction or state-driven changes, where image or video formats might be more appropriate.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 4
motion vs animejs ★ 69.4K · 423.2K/wk motion vs framer-motion ★ 32.2K · 18.7M/wk motion vs @formkit/auto-animate ★ 13.8K · 436.8K/wk motion vs gsap ★ 25.6K · 1.6M/wk