Collapsible
Collapsible Primitive
Demo
A dynamic element that facilitates the expansion or collapse of a panel.
Installation
Copy/paste the following code to ~/components/ui/collapsible.tsx
:
Usage
Props
Collapsible
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
open | boolean | (optional) |
onOpenChange | (value: boolean) => void | (optional) |
defaultOpen | boolean | (optional) |
disabled | boolean | (optional) |
CollapsibleTrigger
Extends Pressable
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
CollapsibleContent
Extends View
props
Prop | Type | Note |
---|---|---|
asChild | boolean | (optional) |
forceMount | true | undefined; | (optional) |