Component
A simple show/hide component with a trigger and content area. Useful for secondary information that doesn't need to be always visible.
View component changelogpreview
Import all parts of the component and piece them together
The root collapsible container.
| Prop | Type | Default |
|---|---|---|
open | boolean | false |
defaultOpen | boolean | false |
disabled | boolean | false |
transitionDuration | number | 0 |
onOpenChange | function | -- |
customRootClass | string | "" |
The button that toggles the collapsible open/closed.
| Prop | Type | Default |
|---|---|---|
asChild | boolean | false |
className | string | "" |
The content that is shown or hidden.
| Prop | Type | Default |
|---|---|---|
className | string | "" |
| Shortcut | Description |
|---|---|
Tab | Moves focus to the Collapsible.Trigger. |
Space | Toggles the controlled content open or closed. |
Enter | Toggles the controlled content open or closed. |
Escape | When the content is open and focus is on the trigger, closes the content. |
| Reference | What Rad UI follows |
|---|---|
Uses a button trigger with aria-expanded and aria-controls to expose the content relationship. |