Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

414 B
Raw Blame
import ReactAnimateHeight from 'react-animate-height';

type Props = {
  children: React.ReactNode;
  className?: string;
  open: boolean;
};

const AnimateHeight = ({ children, className, open }: Props) => {
  return (
    <ReactAnimateHeight
      className={className}
      duration={300}
      height={open ? 'auto' : 0}
    >
      {children}
    </ReactAnimateHeight>
  );
};

export default AnimateHeight;