Want to animate element height in React with ReactCSSTransitionGroup? Lightweight, no dependency React component for animating height using CSS transitions. Slide up/down the element, and to any specific height. Check the demo lower on this page.
CSS classes are applied in specific animation states, check animationStateClasses prop.
Usage:
Import the component, and use it to wrap content whose height you want to animate.
1 2 3 4 5 6 7 8 9 | import AnimateHeight from 'react-animate-height'; <AnimateHeight duration={ 500 } height={ 'auto' } > <h1>Your content goes here</h1> <p>Put as many React or HTML components here.</p> </AnimateHeight> |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.