Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

660 B
Raw Blame
import { motion } from 'motion/react'
import type { ReactNode } from 'react'

/** Wrap the parent in `<AnimatePresence initial={false}>` to avoid animating on first paint. */
export const FormSectionCollapse = ({ children }: { children: ReactNode }) => (
  <motion.div
    initial="collapsed"
    animate="open"
    exit="collapsed"
    variants={{
      collapsed: { opacity: 0, height: 0, overflow: 'hidden' },
      open: {
        opacity: 1,
        height: 'auto',
        overflow: 'hidden',
        transitionEnd: { overflow: 'visible' },
      },
    }}
    transition={{ duration: 0.18, ease: [0.4, 0, 0.2, 1] }}
  >
    {children}
  </motion.div>
)