Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 671 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 671 Bytes

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: