Components ds-accordion
Accordion
Groups slotted disclosures behind one tab stop, moving between their headers with the arrow keys and optionally keeping a single panel open at a time.
Live playground
Orders leave the warehouse within one business day.
Unopened items can be returned for 30 days after delivery.
Hardware carries a two year limited warranty from purchase.
Interactive props
Usage example
<ds-accordion exclusive
style="--ds-accordion-gap: 8px"
@ds-change=${this.onChange}
>
<ds-disclosure summary="Shipping">…</ds-disclosure>
<ds-disclosure summary="Returns">…</ds-disclosure>
<ds-disclosure summary="Warranty">…</ds-disclosure>
</ds-accordion>
Keyboard
| Key | Result |
|---|---|
| Tab | Enters the group once, landing on the active header. |
| Arrow Down / Up | Moves to the next or previous header, wrapping at ends. |
| Enter / Space | Toggles the focused panel. |
API Reference
| Member | Kind | Description |
|---|---|---|
| exclusive | property | Opening one panel closes the others. Defaults to false. |
| disclosures | getter | The slotted panels, in document order. |
| activePanel | getter | The first open panel, or null when all are closed. |
| headers | getter | The panel toggle buttons the roving tabindex moves across. |
| ds-change | event | Fires after a panel finished opening or closing, with {panel, open}. An exclusive switch reports two. |
| --ds-accordion-gap | css | Spacing between panels. Defaults to 0. |