Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
React Spring | 26,709 | 1,464 | 1,765 | 10 hours ago | 382 | September 26, 2023 | 102 | mit | TypeScript | |
✌️ A spring physics based React animation library | ||||||||||
React Three Fiber | 24,613 | 380 | a day ago | 210 | December 03, 2023 | 33 | mit | TypeScript | ||
🇨🇭 A React renderer for Three.js | ||||||||||
Motion | 20,647 | 118 | 4,034 | 3 days ago | 960 | December 01, 2023 | 347 | mit | TypeScript | |
Open source, production-ready animation and gesture library for React | ||||||||||
Lottie React Native | 16,277 | 6,322 | 265 | 8 days ago | 77 | November 14, 2023 | 29 | apache-2.0 | Kotlin | |
Lottie wrapper for React Native. | ||||||||||
React Content Loader | 12,768 | 309 | 478 | 9 months ago | 70 | March 12, 2023 | 9 | mit | TypeScript | |
⚪ SVG-Powered component to easily create skeleton loadings. | ||||||||||
Auto Animate | 10,300 | 68 | a month ago | 15 | November 06, 2023 | 35 | mit | TypeScript | ||
A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application. | ||||||||||
React Transition Group | 9,771 | 47,715 | 6,933 | 8 months ago | 44 | August 01, 2022 | 218 | other | JavaScript | |
An easy way to perform animations when a React component enters or leaves the DOM | ||||||||||
React Native Animatable | 9,602 | 2,130 | 363 | a month ago | 24 | October 26, 2023 | 169 | mit | JavaScript | |
Standard set of easy to use animations and declarative transitions for React Native | ||||||||||
React Native Reanimated | 7,925 | 4,847 | 1,779 | 13 hours ago | 320 | December 02, 2023 | 297 | mit | TypeScript | |
React Native's Animated library reimplemented | ||||||||||
React Move | 6,568 | 323 | 83 | a year ago | 60 | June 13, 2021 | 25 | mit | JavaScript | |
React Move | Beautiful, data-driven animations for React |
A simple state animation mixin for React.js
React.Animate is a different approach to animate based on state rather than direct DOM mutation using $.animate or similar.
While it's great that you can use refs to get DOM nodes after render, the biggest benefit to using react is that there is always a direct, observable, and testable relationship between component props, state, and the rendered output.
Mutating the dom directly is an antipattern.
What we really want to animate is not the DOM, it's component state.
If you think about animation as a transition from one state value from another, you can just interpolate state over an interval, and your component can rerender precisely in response to the current component state at every step.
At it's most simple, React.Animate allows you to transition between one state and another over a set interval. The implementation supports the same syntax as $.animate.
you can pass either
this.animate(properties [, duration ] [, easing ] [, complete ] );
or
this.animate(key, value [, duration ] [, easing ] [, complete ] );
React.Animate can be included in any React class by adding it to the mixins array
By animating state instead of the DOM directly, we can define logic that acts during certain parts of our animations.
var component = React.createClass({
mixins: [React.Animate],
getInitialState: function() {
return {
width: 100
};
},
render: function() {
var heightBounds = [50, 100];
return React.DOM.div({
style: {
width: this.state.width,
height: Math.min(heightBounds[1], Math.max(heightBounds[0], this.state.width / 2))
},
onClick: this.randomSize
});
},
randomSize: function() {
this.animate({
width: _.random(20, 300)
}, 500, function() {
console.log("random size reached!");
});
}
});
view in jsfiddle
React.Animate can be installed with bower using
bower install react.animate --save
React.Animate can be installed with npm using
npm install react.animate --save
Both will automatically pull the required React and Underscore dependencies.
to use React.Animate, include it in your page or build process after React and Underscore