> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/components/accordion.md).

# Accordion

## Overview

Use Accordion to group related content in sections that users can open as needed. For example, put a product description, specifications and shipping information in separate sections so the description stays easy to find.

Each section is a container for Avonni Dynamic Components. Add Text for a short explanation, or use a Data Table or Map when the content calls for it.

## Tutorials

Browse the [Accordion tutorials](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/accordion.md) for a guided build and a Preview checklist.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Organize Product Details with Accordion</strong></td><td>Build an Accordion that groups product descriptions, specifications and shipping information, then test which sections open in Builder Preview.</td><td><a href="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FTr6zAwEI7f5IpMVAlr5b%2Faccordion-product-details-cover.jpg?alt=media">accordion-product-details-cover.jpg</a></td><td><a href="https://docs.avonnicomponents.com/dynamic-components/tutorials/components/accordion/organize-product-details-with-accordion.md">Organize Product Details with Accordion</a></td></tr></tbody></table>

## Configuration

Select the Accordion on the canvas to open **Edit Accordion**. Use **Properties** to create sections and set how they open.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2F7DtR0dJEEn4NtAO8rrXB%2Faccordion-builder-properties.png?alt=media" alt="" width="320"><figcaption><p>The Properties tab of the Edit Accordion panel.</p></figcaption></figure>

### Properties

#### Allow Expansion of Multiple Sections

With this setting off, opening a section closes the previous one. Turn it on when users need to keep several sections open, such as when comparing answers in an FAQ.

#### Active Section(s)

Select the sections that open when the component loads. In single section mode, only the first selected section opens. To open several by default, enable multiple expansion and select each one.

**Active Section(s)** also exposes the values of the currently open sections. Other components can use that output as users open or close sections.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FdkkIEqf6kGIsjVvvQUpV%2Faccordion-sections.png?alt=media" alt=""><figcaption><p>An accordion with three sections. The first is expanded, the other two show the collapsed icon.</p></figcaption></figure>

#### Items

Under **Items**, click **Add Items** to create a section. Enter a visible **Label** and a unique **Value** in the dialog, then click **Save**. Drag the components you need into the section on the canvas.

{% @arcade/embed url="<https://app.arcade.software/share/7ZnMSlKAQfGsS7pOFTwZ>" flowId="7ZnMSlKAQfGsS7pOFTwZ" %}

| Setting            | Description                                                                                                                                                                                                                                                  |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Label**          | The text shown in the section's header.                                                                                                                                                                                                                      |
| **Value**          | A unique identifier for the section. It's used by **Active Section(s)** to control which sections open by default.                                                                                                                                           |
| **Variant**        | Choose **Base** for a standard appearance or **Shaded** for a subtle background effect. Default is **Base**.                                                                                                                                                 |
| **Hide Icon**      | Hide the expand/collapse icon shown in the section header. When hidden, the icon settings below no longer apply.                                                                                                                                             |
| **Collapsed Icon** | The icon displayed when the section is collapsed. Default is `utility:chevronright`.                                                                                                                                                                         |
| **Expanded Icon**  | The icon displayed when the section is expanded. Default is `utility:chevrondown`.                                                                                                                                                                           |
| **Position**       | Place the icon on the **Left** (default) or **Right** of the section header.                                                                                                                                                                                 |
| **Size**           | The icon size: XX-Small (default), X-Small, Small, Medium, or Large.                                                                                                                                                                                         |
| **Help Text**      | A hoverable help icon beside the section title. Set **Content** to show it (no icon appears while it is empty), then optionally choose its **Icon Name**, **Variant** (**Bare** by default, **Inverse**, **Warning** or **Error**) and **Alternative Text**. |

{% hint style="info" %}
**Collapsed Icon**, **Expanded Icon**, **Position**, and **Size** are only available when **Hide Icon** is turned off.
{% endhint %}

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FthM1rxUQow03glb10L1j%2Faccordion-variant.png?alt=media" alt=""><figcaption><p>The section Variant property. Shaded gives each section header a grey background.</p></figcaption></figure>

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FE62jgi3briZkbMOhHqXX%2Faccordion-icon-position.png?alt=media" alt=""><figcaption><p>The section icon Position property, Left and Right.</p></figcaption></figure>

### Set Component Visibility

Use [Component Visibility](https://docs.avonnicomponents.com/dynamic-components/core-concepts/component-visibility.md) to control when the whole Accordion appears.

## Styling

Open the **Style** tab of **Edit Accordion** to adjust spacing, dimensions and section appearance.

{% tabs %}
{% tab title="Margin" %}
Controls the *outer* spacing around the entire accordion.

* **Top / Right / Bottom / Left:** Adjust the space on each side of the accordion.
  {% endtab %}

{% tab title="Padding" %}
Controls the *inner* spacing between the accordion's content and its border.

* **Top / Right / Bottom / Left:** Adjust the inner spacing on each side.
  {% endtab %}

{% tab title="Border" %}
Customizes the border surrounding the accordion.

* **Color:** Set the color of the accordion's border.
* **Size:** Set the thickness of the accordion's border.
* **Style:** Set the border style (solid, dashed, dotted, etc.).
* **Radius:** Round the corners of the accordion's border.
  {% endtab %}

{% tab title="Size" %}
Controls the accordion's dimensions.

* **Width / Height:** Set fixed dimensions for the accordion.
* **Overflow:** Determine how content that extends beyond the set dimensions is handled (scroll, hidden, etc.).
* **Min Width / Max Width / Min Height / Max Height:** Constrain the size within bounds.
  {% endtab %}

{% tab title="Background" %}
Sets the accordion's background.

* **Color:** Set the background color of the accordion.
  {% endtab %}

{% tab title="Section" %}
Styles each accordion section and its parts.

* **Section:** Margin / Padding, Background Color, and Border (color, size, style, radius).
* **Section Header:** Margin / Padding, Background Color, and Border (color, size, style, radius).
* **Section Content:** Margin / Padding, Background Color, and Border (color, size, style, radius).
* **Section Title:** Color, Font Size, Font Style, Font Weight.
* **Section Icon:** Background Color, Foreground Color, Foreground Color Hover.
* **Section Icon Border:** Color, Size, Style, Radius.
  {% endtab %}
  {% endtabs %}

## Use Cases

* **Product details.** Show the description first and put specifications and shipping terms in their own sections.
* **FAQs.** Keep several answers open when readers need to compare them.
* **Guides.** Group instructions into steps that users can open in order.
* **Forms.** Group related fields into sections such as contact details and preferences.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/dynamic-components/components/accordion.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
