package
Automatically animate list reordering
npm install react-animate-reorderGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
This is a React component which causes its children to be animated to their new positions if they're re-ordered.
Note that only vertical movement is handled currently, and adding or removing elements to the list is not animated. The module react-shuffle handles that, so you might want to use it instead. However, it currently mounts its children twice and doesn't handle state well on its children.
Your application must include this CSS rule:
.reorder-wrapper-item {
position: relative;
transition: top 1s ease-in;
}Then wrap some elements with the AnimateReorder component. Make sure that each element has a unique key set!
var AnimateReorder = require('react-animate-reorder');
class SomeComponent extends React.Component {
render() {
var list = [ /* ... */ ];
return (
<div>
<AnimateReorder>
{list}
</AnimateReorder>
</div>
);
}
}Estimated unpacked size across 7 packages.
3.1 MB
Includes dependencies.
^3.10.1
4.18.1
^2.0.0
2.3.1
^6.5.0
6.26.0