Skip to main content

Accordion

shadow

The Accordion element allows you to view the contents in drop-down sections. Each section can be expanded or collapsed with a click, allowing users to quickly find and view the information they want. The component supports multiple selection, which means that multiple sections can be expanded at once. In addition, it allows you to set the initial index of the expanded section, which provides flexibility when initializing a component with default expanded content.

Basic use

Attributes and Properties

multiple

DescriptionAn attribute that determines whether multiple sections can be expanded at the same time.
Attributemultiple
Typeboolean
Default0

Index

DescriptionAn attribute that sets the initial index of the extended section.
AttributeIndex
Typenumber
Default1000

Events

NameDescription
wje-accordion-item:openIt is emitted when the accordion item is opened.

Methods

collapseAll

DescriptionCollapses all accordion items except the one specified as the exception.
Signature(exception: HTMLElement) => Promise<void>

getAccordions

DescriptionSearch for all Accordion components within a group.
SignaturegetAccordions() => Accordion[]

CSS Shadow Parts

No CSS shadow parts available for this component.

CSS Custom Properties

No CSS custom properties available for this component.

Slots

No slots available for this component.