Comparing the top JS animation libraries for use in React apps
Tags: react, javascript, animation, frontenddev
Published: 2018-03-26 18:11:32

---
title: Comparing the top JS animation libraries for use in React apps
published: true
tags: react,javascript,animation,front-end-developmen
canonical_url: https://blog.logrocket.com/comparing-the-top-js-animation-libraries-for-use-in-react-apps-e3ba5ccad68d
---

![](https://cdn-images-1.medium.com/max/1024/1*p6A_nE4_qNjEtDffP6IA4A.jpeg)

You may have noticed that animation is pretty popular on the web. There’s no shortage of tutorials, case studies, and libraries targeting motion lovers. It’s a facet of development that can intrigue, enhance, delight, motivate, and impress users.

In this article, I’ve chosen five JavaScript animation libraries and dissected their abilities to perform from both a business and a development perspective.

Instead of asking “what do I use to build X?”, I explore concerns like:

- How well is this project maintained?
- Is it easy for a team to pick up?
- What’s the syntax like?

Additional aspects examined that help provide solutions towards project and business objectives such as:

- Are costs associated?
- Is it open source?
- Members only?
- Are add-ons available?
- What’s the community like?

These details help a business and team arrive at an educated decision that, hopefully, meets everyone’s needs.

### **What makes an animation library?**

An animation library is a toolset that creates an animation, and explicitly allows for custom support and creation.

These libraries must also provide methods to animate objects, tooling to allow the control of an object(s) motion, and directional control for starters. It can also come in flavors that cater to specific abilities such as _reactive_ animations.

_Since my grading scale towards each library is subjective, your opinion may differ from mine. If a library works for you, your project, and your business goals, that is what really matters. Let's get started._

### **GreenSock**

Documentation: **B+** , Features: **A,** Syntax: **B+,** Community & Support **:**  **A+,** Stability: **A**

![](https://cdn-images-1.medium.com/max/1024/1*oMzgiPe50QByX6pjumn1gQ.png)

GreenSock (GSAP) is one of the premiere JavaScript libraries for web animators. You can create all kinds of stunning effects including those that require SVG support.

The primary aspects of GreenSock are open source, allowing you to use TweenMax (113 KB minified), TimelineLite (12.6 KB minified), TimelineMax (20.4 KB minified) and TweenLite (27.5 KB minified) freely, plus meet a wide range of needs without the overhead cost. If you have concerns with regards to file size make sure to read this article titled “[Kilobyte Conundrum](https://greensock.com/kilobyte-conundrum).”

There’s also an array of handy plugins to help extend GSAP capabilities such as:

- **DrawSVG**  — Progressively reveal/hide SVG strokes
- **MorphSVG**  — Morph any SVG shape into any other shape
- **ScrollTo**  — Animate scroll position. Works with [ScrollMagic](http://scrollmagic.io)
- **ThrowProps**  — Smoothly glide any property to a stop using physics.
- **Bezier**  — Animate properties along a beziér curve.

Add-ons like Draggable and SplitText are available as well to compliment the multitude of plugins at your disposal. Here’s the entire list of [GreenSock’s product](https://greensock.com/products) line for further investigation.
{% codepen https://codepen.io/chrisgannon/pen/WvJMXP %}
In terms of ubiquity, GSAP is used on roughly 4,000,000 sites and has been around for a **very** long time. That means…

- More familiarity, more jobs, less training
- The more usage, the more chances bugs surface and get fixed
- A long track record of commitment

Overall, the GreenSock community is quite active. There are a plethora of demos, articles, and tutorials available and the community is active in Slack workspaces such as [Animation At Work](https://damp-lake-50659.herokuapp.com), [Stack Overflow](https://stackoverflow.com/questions/tagged/greensock), [members forum](https://greensock.com/forums), and Twitter. Documentation is well written, and the syntax is easily digestible and expressive. Some portions of GSAP as mentioned are open source while plugins and utilities will be [at a cost](https://greensock.com/club).

If you do motion work and desire a library that covers many different needs, provides solid community support, provides well-written documentation with an easy to read syntax, and always stays up-to-date; GreenSock is a great choice all around.

- URL: [https://greensock.com](https://greensock.com/)
- Docs: [https://greensock.com/docs](https://greensock.com/docs)
- Plugins: [https://greensock.com/docs/Plugins](https://greensock.com/docs/Plugins)
- Addons/Utilities: [https://greensock.com/docs/Utilities](https://greensock.com/docs/Utilities)

### **A note on reactive animations with GSAP**

Building for dynamic situations with GSAP can certainly be accomplished using a [ticker](https://greensock.com/docs/TweenLite/static.ticker) or [ModifiersPlugin](https://greensock.com/modifiersPlugin) should you need that type of capability in your project.

Here are some additional examples that showcase dynamic motion using GSAP:

- [https://codepen.io/osublake/pen/65cdc21ce5c49da45709ff9d09d0a754](https://codepen.io/osublake/pen/65cdc21ce5c49da45709ff9d09d0a754) — LERP frame independent.
- [https://codepen.io/osublake/pen/dmPyaw](https://codepen.io/osublake/pen/dmPyaw/) — Exponential interpolation using LERP on every frame
- [https://codepen.io/osublake/pen/PPmJpL](https://codepen.io/osublake/pen/PPmJpL) — Simple Additive Animation
- [http://codepen.io/osublake/full/zvpEMg](http://codepen.io/osublake/full/zvpEMg/) — Additive Animation
- [https://codepen.io/kvndy/pen/YyXLWp](https://codepen.io/kvndy/pen/YyXLWp) — Additive Keyframe Blend
- [https://codepen.io/osublake/pen/BLOoOP](https://codepen.io/osublake/pen/BLOoOP?editors=0010) — Image Panning
- [https://codepen.io/osublake/pen/XEJMWE](https://codepen.io/osublake/pen/XEJMWE) — Screen resize: TweenMax + CSS variables
- [https://codepen.io/osublake/pen/EEaPKe](https://codepen.io/osublake/pen/EEaPKe?editors=0010) — Screen resize: ModifiersPlugin

### **Anime.js**

Documentation **: C,** Features **: B** , Syntax: **B,** Community & Support **: C,** Stability: **B**

![](https://cdn-images-1.medium.com/max/1024/1*OBE14NXuAdHGS9YOpVFq2Q.png)

Anime is a lightweight (6.2 KB minified), open source JavaScript animation library.

It works with CSS Properties, individual CSS transforms, SVG, or any DOM attributes, and JavaScript Objects. Its notable features are keyframes with the ability to chain, timeline methods to synchronize multiple instances together, playback controls, individual CSS transform control, individual values for multiple animation targets, SVG paths/lines/morphing and plenty of easing functions.

Its syntax will be familiar including the approach on chaining that’s used in many animation libraries today. Timelines are also easy to instantiate, and controlling properties using an object literal approach is another familiar cowpath.

With a [public release date of June 27, 2016](https://github.com/juliangarnier/anime/commit/e27c0a6d1d56291d457f71bd112575dbb7600d74), it’s a project that’s certainly in its infancy. However, Anime is under active development according to GitHub pull requests (a good thing). For community support, I suggest using the project’s issue tracker before heading into Stack Overflow for the best chance at quick support.
{% codepen https://codepen.io/dennisgaebel/pen/aqXOYz %}
When it comes to documentation, be prepared to read code. Anime’s documentation makes comprehension challenging as it lacks explanations to compliment demos. I also found event control lacking the kind of sophistication your normally see with other libraries.

Browser support is very good with IE10–11 and Edge included as benchmark tests. However, nothing is noted for iOS or Android. There’s a [stress test](https://codepen.io/juliangarnier/pen/JKEgpO) that’s also available and built to showcase performance.

If you need a library that is small in file size, works great with simple timeline sequences, works with SVG (stroke, morphing, transforms etc.), is 100% open source, and has a familiar syntax, then Anime is for you.

- URL: [http://animejs.com](http://animejs.com/)
- Docs: [http://animejs.com/documentation](http://animejs.com/documentation/)

### **Mo.js**

Documentation **: C,** Features **: B** , Syntax: **B** , Community & Support: **C,** Stability: **C**

![](https://cdn-images-1.medium.com/max/1024/1*xhppBW642BRuHYIXx-iDcg.png)

Mo.js is is an open source project that can be installed via npm or CDNJS. It claims to be fast, reliable, unit tested, modular, robust, and has a simple API; all to help diminish large file sizes overheads.

I found the docs to be slightly confusing.They don’t always contain explanations for methods used in other demos so you’ll have to look hard to find an answer that fits your needs. I also struggled to find a use regarding simple motion work (some facets of this project aren’t clear in terms of how to do common animation tasks). There are certainly some really cool effects though that you can make with Mo.js such as this bubble layout:
{% codepen https://codepen.io/sol0mka/pen/yNOage %}
Upon examination of the GitHub repo this project doesn’t contain many contributors, and updates have not been issued in any recent time. The project’s most recent commits range between mid-2016 and mid-2017, but hasn’t seen much action since.

I’ve been told by reliable sources that this library has been stagnant due to the busy life of its creator, so the future of this library is very open-ended. I would suggest steering away from it as support will be bleak, the community is small, and the future direction of the library is uncertain.

- URL: [http://mojs.io](http://mojs.io/)
- Docs: [https://github.com/legomushroom/mojs/blob/master/api/readme.md](https://github.com/legomushroom/mojs/blob/master/api/readme.md)
- Addons:  
[https://github.com/legomushroom/mojs-player](https://github.com/legomushroom/mojs-player)  
[https://github.com/legomushroom/mojs-curve-editor](https://github.com/legomushroom/mojs-curve-editor)

**Popmotion**  
Documentation **: D,** Features **: C** , Syntax: **C** , Community & Support: **B,** Stability: **B**

![](https://cdn-images-1.medium.com/max/1024/1*V69F0DP6GWAx1e4IYbpJmg.png)

Popmotion is an 11.5 KB Swiss Army knife for animators aiming to be lego blocks, and comes with packages for blend, draggable, pose, react, and spinnable. A functional, _reactive_ JavaScript motion library that provides methods for tweening however, documentation can be a struggle to decipher; styler is specifically hard to wrap your head around due to the vague and brief explanation.

You should also be comfortable writing in ES6 as all demos, and code examples are written in this fashion. The overall syntax of this library is certainly confusing, and wording for documentation is complex, requiring an deep understanding of the project inside and out. Since you’ll most likely require a strong understanding of how this library is written it could take some time to pick up if you’re in a hurry.
{% codepen https://codepen.io/popmotion/pen/LeZvXB %}
{% codepen https://codepen.io/popmotion/pen/paXyRE %}
Popmotion’s creator is [hoping work on Pose](https://github.com/Popmotion/popmotion/tree/master/packages/popmotion-pose) will address my primary concerns by providing a declarative, DOM-specific layer that should make animation super-simple. Popmotion certainly has capabilities when it comes to reactive animations based on mouse position, and anything not duration based.
{% codepen https://codepen.io/popmotion/pen/dmMoVE %}
A good majority of developers will find the learning curve demanding. In theory it sounds nice, but when you actually start trying to write code, it’s surprisingly cumbersome and requires writing many aspects by hand. If you want a motion library with reactive in mind, small in size and 100% open source; Popmotion is for you.

If you need support, feel free to reach out in the [Animation at Work Slack](https://damp-lake-50659.herokuapp.com/) workspace via **#popmotion** channel as well as GitHub’s issue tracker.

If you want a library with a focus on reactive animations, 100% open source, and willing to do some hard development work up front, then Popmotion is for you.

- URL: [https://popmotion.io](https://popmotion.io/)
- Docs: [https://popmotion.io/learn/get-started](https://popmotion.io/learn/get-started/)

### **Velocity**

Documentation **: B+,** Features **: B+** , Syntax: **B+** , Community & Support: **B+,** Stability: **B**

![](https://cdn-images-1.medium.com/max/1024/1*cOXabt0u_0WE44NFrX7KiA.png)

Those familiar with jQuery will feel right at home with Velocity. Velocity is an animation engine with the same API as jQuery’s **$.animate()**. It works with and without jQuery. It features color animation, transforms, loops, easing, SVG support, and scrolling.

If you decide to use jQuery with Velocity, it’s just a matter of replacing **$.animate()** with **$.velocity**. It works everywhere including support as far back as IE8 and Android 2.3. There are also plenty of easing options to choose from including spring physics.
{% codepen https://codepen.io/tommiehansen/pen/netCu %}
Currently, this project is still under active development according to GitHub commits. It’s a library that has been on the market for quite awhile, widely used, and well-known. Velocity aims at convincing you from the start how performant it truly is through provided performance tests. There are plenty of articles too including videos and tutorials/books should you ever find yourself stuck. If you’re a ScrollMagic user you’ll be happy to hear that it works well with Velocity. [SVG support](http://velocityjs.org/#svg) is great too.

If you need a library with documentation that reads well, has a friendly syntax, works with & without jQuery, a long track record, abundant resources of teach materials, and decent community support then Velocity is for you.

- URL: [http://velocityjs.org](http://velocityjs.org/)
- Docs: [https://github.com/julianshapiro/velocity/wiki](https://github.com/julianshapiro/velocity/wiki)
- Plugins:  
[http://velocityjs.org/#uiPack](http://velocityjs.org/#uiPack)  
[http://velocityjs.org/#vmd](http://velocityjs.org/#vmd)  
[http://velocityjs.org/#ember](http://velocityjs.org/#ember)

### **Parting Thoughts**

While it’s important to think long-term, it’s just as important to solicit team feedback before making a decision. If you go with a minimalistic library today because it technically does what you need in that particular moment, you might not plan for what happens in 6 months when you need to add something more ambitious.

If you’re using a library with little traction or support it can backfire long-term; especially if you run into browser bugs. A long track record helps businesses feel safe, but a well documented, easy to read syntax with strong support and a good track record will keep both sides pleased. Let me hear your thoughts in the comments and happy animating!

_Special thanks to the Animation At Work Slack community for their time and opinions on this topic._

**Additional Libraries & References**

- SnapSVG [http://snapsvg.io](http://snapsvg.io/) — A JavaScript SVG library by Adobe
- Just Animate [https://just-animate.github.io](https://just-animate.github.io/) — Tweening engine
- TweenJS [https://createjs.com/tweenjs](https://createjs.com/tweenjs) — A JavaScript library for tweening and animating HTML5 and JavaScript properties. Works stand-alone or integrated with EaselJS.
- Sequence JS [https://www.sequencejs.com](https://www.sequencejs.com/) — A JavaScript library that provides a responsive CSS framework for creating unique sliders, presentations, banners, and other step-based applications.
- Moving Letters [http://tobiasahlin.com/moving-letters](http://tobiasahlin.com/moving-letters)
- Polymorph [https://github.com/notoriousb1t/polymorph](https://github.com/notoriousb1t/polymorph) — Morph SVG paths
- Path.js [https://github.com/SamKnows/path.js](https://github.com/SamKnows/path.js) — A library for morphing between SVG paths
- Lengthy [https://github.com/shshaw/lengthy-svg](https://github.com/shshaw/lengthy-svg) — MicroLibrary for SVG Shape Length in a CSS Var
- [https://github.com/googlearchive/flipjs](https://github.com/googlearchive/flipjs) — A helper library for [FLIP animations](https://aerotwist.com/blog/flip-your-animations).
- [https://github.com/davidkpiano/flipping](https://github.com/davidkpiano/flipping) — A tiny library (and collection of adapters) for implementing FLIP transitions easily.
- TweenRex [https://github.com/tweenrex/tweenrex](https://github.com/tweenrex/tweenrex) — A reactive tweeting engine
- Web Animation Toolbox [https://web-animation.github.io](https://web-animation.github.io/) — Awesome tools & books & articles & videos for web-animation

1. _Reactive_ — A “reactive animation” is one involving discrete changes, due to events (_Conal Elliot/Paul Hudak 1997_), or ones that occur based on user event/input and different input/event values. Reactive libraries generally don’t “think” ahead. [https://www.youtube.com/watch?v=lTCukb6Zn3g](https://www.youtube.com/watch?v=lTCukb6Zn3g). [http://slides.com/davidkhourshid/flipping#/42](http://slides.com/davidkhourshid/flipping#/42)
* * * 
## Plug: [LogRocket](https://logrocket.com/signup/), a DVR for web apps

![LogRocket Dashboard Free Trial Banner](https://i2.wp.com/blog.logrocket.com/wp-content/uploads/2017/03/1d0cd-1s_rmyo6nbrasp-xtvbaxfg.png?resize=1200%2C677&ssl=1)

[LogRocket](https://logrocket.com/signup/) is a frontend logging tool that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.

In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.

[Try it for free](https://logrocket.com/signup/).
* * *
The post [Comparing the top JS animation libraries for use in React apps](https://logrocket.com/blog/comparing-the-top-js-animation-libraries-for-use-in-react-apps-2/) appeared first on [LogRocket Blog](https://blog.logrocket.com).