Accordion
Accordions display an expandable/collapsible list of items. The final Accordion component is a compound of the following:
Accordion
: wraps a series ofAccordionItem
s in a single component.AccordionItem
: wraps anAccordionButton
and anAccordionPanel
.AccordionButton
: contains the top-level items of the Accordion list. It is a clickable button that shows or hides the child items of a givenAccordionItem
.AccordionPanel
: contains the child items of a givenAccordionItem
.
Import​
import { Accordion, AccordionItem, AccordionButton, AccordionPanel } from '@faststore/ui'
Usage​
Multiple and collapsible​
Toggle with icon​
Props​
All accordion-related components support all attributes also supported by the <div>
tag, except for the AccordionButton
, which renders the <button>
tag.
Besides those attributes, the following props are also supported:
Accordion​
AccordionItem​
AccordionPanel​
Customization​
data-store-accordion
data-accordion-item
data-accordion-button
data-accordion-panel
The AccordionButton
component inherits Button css selectors.