PACKAGE · ANIMATION

motion

An animation library for JavaScript and React.

WEEKLY DOWNLOADS 22.9M
STARS 33.8K
FORKS 1.4K
OPEN ISSUES 103
GZIP SIZE 47.8 kB
UNPACKED SIZE 760.7 kB
DEPENDENCIES 2
LAST UPDATED 7mo ago
DOWNLOAD TRENDS

motion downloads · last 12 months

Download trends for motion1 download series from Oct 2025 to Sep 2026. Use left and right arrow keys to inspect monthly values.022.2M44.5M66.7M88.9MOct 2025JanAprJulSep 2026
motion
ABOUT MOTION

Motion is a powerful animation library designed to bring dynamic visual experiences to JavaScript and React applications. It addresses the complexity often associated with implementing smooth, performant, and interactive animations, allowing developers to create engaging user interfaces without deep knowledge of animation intricacies.

Built with a focus on developer experience and declarative control, Motion aims to make animation an integral and intuitive part of the UI development process. Its primary audience includes front-end developers working with React who need to add sophisticated animations, transitions, and gestures to their projects.

The library's core architecture revolves around a declarative API, particularly its `useMotion` hook and component-based approach. Developers can define animations directly within their JSX, controlling properties like opacity, position, scale, and rotation with ease. This approach abstracts away the complexities of requestAnimationFrame and DOM manipulation.

Motion integrates seamlessly into modern React workflows, supporting features like Server Components and client-side rendering. It plays well with existing React patterns and can be combined with other UI libraries and state management solutions. Its flexibility allows for both simple property animations and complex physics-based motion.

With a bundle size of 47.8 kB (gzipped), Motion offers a rich feature set without imposing a significant performance penalty. The library's design prioritizes efficient rendering and a smooth animation loop, ensuring that animations remain fluid even in demanding applications. Its high weekly download count of 22.9 million suggests widespread adoption and community trust.

While versatile, developers should be aware that Motion's extensive capabilities might introduce a learning curve for developers unfamiliar with declarative animation paradigms. For extremely simple, one-off animations, a more lightweight, imperative approach might be considered to minimize bundle size further.

WHEN TO USE
  • When creating complex, physics-based animations in React using the `spring` utility.
  • When implementing interactive gestures and drag animations with components like `motion.div`.
  • When you need to animate CSS properties declaratively within your React components.
  • When building animated layouts and transitions that respond to state changes.
  • When integrating animations with React Server Components for improved initial load performance.
  • When you require a high degree of control over animation easing curves and durations.
WHEN NOT TO USE
  • If your animation needs are limited to very basic, static transitions (e.g., a simple fade-in on load), consider CSS transitions or a lighter utility.
  • If you are working in an environment where minimizing JavaScript bundle size is paramount and only extremely simple animations are required.
  • When you need to animate SVGs with intricate, frame-by-frame sequences, as dedicated SVG animation tools might offer more specialized features.
  • If your project exclusively uses plain JavaScript without a framework like React, exploring other animation libraries might be more suitable.
  • For purely decorative, non-interactive animations that could be achieved with CSS animations alone to reduce runtime overhead.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 4
motion vs framer-motion ★ 33.8K · 47.5M/wk motion vs gsap ★ 28.8K · 5.5M/wk motion vs @formkit/auto-animate ★ 13.9K · 1.6M/wk motion vs animejs ★ 73.3K · 1.1M/wk