
Description
React-animate-height is a lightweight React component that animates an element's height with CSS transitions. It slides an element up or down, or animates it to any specific height, and it has no dependencies. The content's opacity can optionally be animated as well, and CSS classes can be applied in each animation state, so you can style the phases of the animation. Version 3 of the component is rewritten to use React hooks and needs React 16.8 or newer. Its callbacks were renamed in version 3 to avoid clashing with native events, so the start and end callbacks are now named for the height animation. It is useful for accordions, collapsible menus, expanding panels and any interface where content should open and close smoothly. The README includes a quick start, a props reference and a live demo. The library is hosted on GitHub under the Stanko organization.…
Highlights
- Animates height with CSS transitions
- Optional opacity animation of the content
- CSS classes for each animation state
- Rewritten with hooks in version 3, needs React 16.8 or newer
Ratings & Reviews
No ratings yet
Be the first to rate react-animate-height.
People also visit

react-collapse
Component-wrapper for collapse animation for elements with variable
react-animate-on-scroll
React component to animate elements on scroll with animate.css
react-native-collapsible
Animated collapsible component for React Native using the Animated API
react-animate-height FAQ
What does react-animate-height do?
It animates an element's height open and closed with CSS transitions, or to any height you set.
Does it have dependencies?
The README says it has no dependencies.
Which React version does it need?
Version 3 needs React 16.8 or newer, because it uses hooks. Version 2 is on a separate branch.
Can I animate the opacity too?
Yes. The animateOpacity prop animates the content's opacity.
What changed in version 3?
The callback names changed, for example onAnimationStart is now onHeightAnimationStart.
Is it free?
The listing shows the library as free. Its source is on GitHub.
What are the best react-animate-height alternatives?
Popular alternatives to react-animate-height include react-css-collapse, react-collapse and react-smooth-collapse. See all react-animate-height alternatives



















