Enode — API Reference
    Preparing search index...

    Function Collapsible

    • A section that eases open and shut around whatever it wraps.

      Parameters

      • open: { children: ReactNode; open: boolean }

        Whether the content is revealed. The children stay mounted either way, so state inside them survives a collapse.

      Returns Element

      Animates grid-template-rows from 0fr to 1fr rather than a height or a max-height. That means the open height is the content's natural height — no measuring, and no max-height guess that clips tall content or adds a pause before short content finishes opening. The inner min-h-0 overflow-hidden wrapper is what makes the grid row actually shrink.

      While closed the wrapper is inert, so the hidden content is neither focusable nor in the accessibility tree; pair the trigger with aria-expanded so the state is announced. The transition only runs on a change of open, so an initially open section renders at full height with no mount animation. Under prefers-reduced-motion the section switches without a transition.

      Drop-in for {expanded && <Body />}: <Collapsible open={expanded}><Body /></Collapsible>.