Components · Disclosure
Collapsible
StableSince v0.0.1
Toggle visibility of content with smooth animation.
import { Collapsible } from '@nexub/react';Examples
Default
Controlled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| Collapsible.Root open | boolean | — | Controlled open state. |
| Collapsible.Root defaultOpen | boolean | false | Whether the collapsible is open by default (uncontrolled). |
| Collapsible.Root onOpenChange | (open: boolean) => void | — | Callback fired when the open state changes. |
| Collapsible.Root disabled | boolean | false | Prevents the user from toggling the collapsible. |
| Collapsible.Trigger asChild | boolean | false | Merges props onto the immediate child element (Radix Slot). |
| Collapsible.Content forceMount | boolean | false | Keeps the content mounted in the DOM even when closed. |
On iOS & Android
Web only
Collapsible has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.