Props mirror Base UI React where applicable, adapted for Svelte 5. Native HTML attributes for the rendered element are also
accepted unless noted.
Collapsible.Root
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
open | boolean | undefined | — | Whether the component is open (controlled). |
defaultOpen | boolean | — | Whether the component is initially open (uncontrolled). |
onOpenChange | ((open: boolean, eventDetails: { reason: OpenChangeReason }) => void) | undefined | — | Event handler called when the open state changes. |
disabled | boolean | false | Whether the control ignores user interaction. |
children | Snippet<[{ open: boolean }]> | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-disabled | Present when the part is disabled. |
data-open | Present when the part is open. |
Collapsible.Panel
Extends div HTML attributes.
| Property | Type | Default | Description |
|---|
keepMounted | boolean | — | — |
role | string | undefined | — | — |
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-closed | Present when the part is closed. |
data-ending-style | Present while the exit animation can run. |
data-open | Present when the part is open. |
data-starting-style | Present while the enter animation can run. |
Collapsible.Trigger
Extends button HTML attributes.
| Property | Type | Default | Description |
|---|
children | Snippet | — | Content rendered inside the part. |
| Data attribute | Description |
|---|
data-disabled | Present when the part is disabled. |
data-panel-open | Present on the element when applicable. |