Navigation
Accordion <pm-accordion>
Accordion. With single, opening one item closes the others.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
single | boolean | false | Only one item open at a time. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
<pm-accordion-item>
Accordion item built on <details> (find-in-page and keyboard for free).
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
heading | string | — | Title text. |
open | boolean | false | Whether it is open. Set to open or close it; changes when the user opens or closes it. |
disabled | boolean | false | Cannot be opened or closed by the user (its current state stays). |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-toggle | onPmToggle | The item opened or closed. |
Slots
| Slot | Description |
|---|---|
(default) | The content that opens. |
heading | Rich heading (text with a badge or an icon), instead of the heading attribute. |
CSS parts
| Part | Description |
|---|---|
::part(base) | The <details> element. |
::part(summary) | The row that opens and closes the item. |
::part(content) | The content that opens. |