Accordion<mds-accordion>Generato da @maggioli-design-system/magma@2.3.0dist/documentation.json. Incapsulamento: shadow.
Questa pagina è generata dai pacchetti Magma, documentati solo in inglese.
Il primo esempio della pagina Pattern, dal vivo. Cambia le sue proprietà qui sotto e l'anteprima le segue; Ripristina riporta l'esempio com'era.
Proprietà
disableClosedisableClosebooleanPrevents the user from closing the currently open item, forcing at least one panel to stay expanded
multiplemultiplebooleanChoose if multiple siblings can be selected simultaneously
Panoramica
The <mds-accordion> web component is the compound container of the Magma Design System that groups and orchestrates a set of collapsible <mds-accordion-item> panels. It acts as the coordination layer that decides which children are selected.
Semantic Behavior
Compound parent/child: The default slot accepts only <mds-accordion-item> elements.Single vs. multiple selection: By default opening one item collapses the others. With multiple set, any number of children may stay open at once and selection state is reported as a comma-separated list of indices.Mandatory selection: When disable-close is set, the user cannot collapse the currently open item by clicking it again - one panel always remains open.Emitted event: mdsAccordionChange when the user opens an item (with multiple, on every toggle), carrying the live children NodeList and the selected index/indices as a string. In single-selection mode, collapsing the open item emits nothing.
Properties & Visual Configurations
This component has no shared variant / tone / size props; its two booleans control selection semantics rather than appearance.
Other behavioral props
multiple switches the group from accordion behavior (one panel at a time) to independent toggles, allowing several panels open simultaneously.disableClose prevents the active panel from being dismissed; set it to force at least one panel to stay expanded at all times.Per-panel presentation - the visible label, heading typography, and the slotted body content - is configured on each <mds-accordion-item> child, not on the accordion itself.