Skip to content

Accordion - Web Component โ€‹

The Accordion component can be used imported from:

Playground โ€‹

Parameters โ€‹

The Web component uses the <z-accordion> tag:

By default, all the parameters are optional or can be set in different, except for the ones marked as required

The parametrization of the component can be done with the following custom HTML params:

NameTypeDescriptionSlotA11y
configstring

Sets the size of the accordion item. Default is m. You can also set it as l.

summarystringThe title of the accordion itemsummary
openbooleanIf the accordion item is open or closed
contentstringThe content of the accordion itemdefault

Events โ€‹

This component has events. Check the documentation about how to use the events.

NamePayloadDescription

Slots โ€‹

This component has slots. Check the documentation about how to use the slots.

NameTagsDescription
defaultspanThe content of the accordion item
summaryspanThe title of the accordion item

Parameters use โ€‹

value โ€‹

...

config โ€‹

The config attribute it's used to set the size of the accordion item. Default is m. You can also set it as l.

Body text inside accordion

summary โ€‹

The summary attribute is used to set the text label of the accordion item. Make sure you always use it.

Also you can use the summary slot to set the text label of the accordion item.

Accordion item

open โ€‹

The open attribute is used to set the accordion item as open by default. Default is false.

Browser support โ€‹

Detected engine: ย 

  • Chromium

  • Webkit

  • Gecko

HTML Examples โ€‹

CodeSandbox example โ€‹