Collapsible
A single collapsible section that can be toggled open and closed. Wraps bits-ui Collapsible.
Example
Here are some hidden details that can be revealed by clicking the trigger above.
Sub-components
Collapsible.Root
| Prop | Type | Default | Description |
|---|
open | boolean | false | Whether the section is open (bindable) |
onOpenChange | (open: boolean) => void | — | Called when open state changes |
disabled | boolean | false | Disables the collapsible |
class | string | — | Additional CSS classes |
Collapsible.Trigger
| Prop | Type | Default | Description |
|---|
class | string | — | Additional CSS classes |
Collapsible.Content
| Prop | Type | Default | Description |
|---|
class | string | — | Additional CSS classes |
Usage
<script>
import { Collapsible } from '@chrissnell/chonky-ui';
</script>
<Collapsible.Root>
<Collapsible.Trigger>Show more</Collapsible.Trigger>
<Collapsible.Content>
<p>Revealed content goes here.</p>
</Collapsible.Content>
</Collapsible.Root>