2.23.0
Accordion Component in Bolt
The Accordion component is a vertical list of items, each of which can be expanded or collapsed to show more content.
npm install @bolt/components-accordion
{% include "@bolt-components-accordion/accordion.twig" with {
items: [
{
trigger: "Accordion item 1",
content: "This is the accordion content.",
},
{
trigger: "Accordion item 2",
content: "This is the accordion content.",
},
{
trigger: "Accordion item 3",
content: "This is the accordion content.",
}
]
} only %}
Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case
.
Prop Name | Description | Type | Default Value | Option(s) |
---|---|---|---|---|
items | All of the items in the accordion. Each item should contain a header and a content. |
array
| — |
|
single | Allow only one section to open at a time. |
boolean
|
false
|
|
no_separator | Hides the separator in between items. |
boolean
|
false
|
|
box_shadow | Creates a box shadow around the accordion. |
boolean
|
false
|
|
spacing | Controls the inset spacing of each item. |
string
|
medium
|
|
icon_valign | Vertically align the accordion trigger content and trigger icon. |
string
|
center
|
|