Collapsible
Expandable/collapsible content panel
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Collapsible } from '@dryui/ui';
</script>
<Collapsible.Root>
<Collapsible.Trigger>...</Collapsible.Trigger>
<Collapsible.Content>...</Collapsible.Content>
</Collapsible.Root>Import options
Root package
import { Collapsible } from '@dryui/ui'Per-component subpath
import { Collapsible } from '@dryui/ui/collapsible'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
Default Closed
This content is hidden by default and reveals on toggle.
<Collapsible.Root>
<Collapsible.Trigger>Toggle content</Collapsible.Trigger>
<Collapsible.Content>
<p>This content is hidden by default and reveals on toggle.</p>
</Collapsible.Content>
</Collapsible.Root>Default Open
This content starts expanded.
<Collapsible.Root open>
<Collapsible.Trigger>Hide details</Collapsible.Trigger>
<Collapsible.Content>
<p>This content starts expanded.</p>
</Collapsible.Content>
</Collapsible.Root>Structure
Compound components always start with Collapsible.Root. Use this structure block to understand required wrappers before you wire state or styling.
Collapsible.Root Collapsible.Trigger Collapsible.Content
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
Compound component. Start with Collapsible.Root, then add only the parts you need.
Collapsible.Root
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
open | boolean | false | — | — |
disabled | boolean | false | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.
Collapsible.Trigger
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <button> attributes via rest props. Common examples: type, disabled, name.
Collapsible.Content
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.