Components ds-disclosure
Disclosure
Animated show/hide region with a toggle button, built on a cancelable event pair so a host can veto a transition before it runs.
Live playground
It hides secondary content behind a toggle, keeping a page scannable while the detail stays one keystroke away.
The panel animates its own height, and reports the transition through ds-show, ds-shown, ds-hide and ds-hidden.
Interactive props
Usage example
<ds-disclosure
summary="What does a disclosure do?"
duration="200"
easing="ease"
@ds-show=${this.onShow}
>
<p>Panel content goes here.</p>
</ds-disclosure>
Properties reference
| Property | Type | Default | Description |
|---|---|---|---|
| open | boolean | false | Whether the panel is expanded. Reflects to an attribute. |
| summary | string | '' | Toggle label used when the summary slot is empty. |
| disabled | boolean | false | Blocks toggling and dims the control. |
| duration | number | 200 | Height animation duration in milliseconds. |
| easing | string | 'ease' | Easing passed to the height animation. |
Events reference
| Event | Cancelable | Description |
|---|---|---|
| ds-show | yes | Before opening. preventDefault cancels the transition. |
| ds-shown | no | After the open animation finishes. |
| ds-hide | yes | Before closing. preventDefault cancels the transition. |
| ds-hidden | no | After the close animation finishes. |
Slots and Methods
| Name | Kind | Description |
|---|---|---|
| summary | slot | Rich toggle label, overriding the summary property. |
| (default) | slot | Panel content revealed when open. |
| show() / hide() / toggle() | method | Drive the panel; each resolves to whether it ran. |