Collapsible

Disclosure & Layout
Local guide ↗ import { Collapsible } from "bits-ui"

Animated content

Height and opacity animate without measuring in application code

Controlled and searchable

Bound open state plus hidden-until-found browser search integration

State: closed

Content exposes --bits-collapsible-content-height and --bits-collapsible-content-width, so CSS can animate to the measured size. For Svelte transitions instead, set forceMount and render conditionally from the child snippet's open value.

hiddenUntilFound maps collapsed content to hidden="until-found", allowing supported browsers to reveal it for find-in-page matches.