Collapsible
Single expandable section that reveals or hides its content on toggle.
Examples
Basic toggle
Simple show/hide section triggered by a header button.
Default open
Collapsible that starts in the expanded state.
With icon
Trigger includes a leading icon for visual context.
Nested
Collapsible sections within collapsible sections.
Settings Panel
Collapsible used as a settings section.
File Tree
Collapsible sections forming a file tree structure.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { Collapsible } from "@rokle/components";import { Collapsible } from "@rokle/components";
export function Example() {
return <Collapsible />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| open | boolean | false | Whether the section is expanded. |
| onOpenChange | (open: boolean) => void | - | Called when open state changes. |
| children | ReactNode | - | Collapsible content. |