Skip to content

jossmac/react-height-transition

Repository files navigation

React Height Transition

Animate height when children mount and unmount.

https://jossmac.github.io/react-height-transition

import HeightTransition from 'react-height-transition';

const AnimatedAlert = ({ isOpen, ...rest }) => (
  <HeightTransition initial={0} duration={400} easing="ease-in-out">
    {isOpen ? <Alert {...rest} /> : null}
  </HeightTransition>
);

Alternatives

This component is intentionally simple. For more sophisticated alternatives that react to changing content height, checkout: