# Accordion

## Features

* Full keyboard navigation.
* Supports horizontal/vertical orientation.
* Supports Right to Left direction.
* Can expand one or multiple items.
* Can be controlled or uncontrolled.

## How to use the Radix UI Accordion

The Accordion Component is in the "Components Panel" under the "Radix" section. Click on it or drag it onto the canvas. The Accordion will populate a template that's easy to adjust for your needs.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-a832cd79276f1d1951c09a26446bf9106886aa24%2Fradix-components.png?alt=media" alt="" width="308"><figcaption><p>Radix UI components within Webstudio</p></figcaption></figure>

You can edit, delete or add more Accordions with ease by copying/pasting any of the "item" components within the Accordion.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-96a4c58ae421e6250d31b271cd4c5dcc7cef29eb%2Fradix-accordion.png?alt=media" alt=""><figcaption></figcaption></figure>

## Changing an Accordion's content

To change the content of an Accordion that isn't currently displayed in the canvas, click on the "item content" instance that you want to change and it will be displayed.

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-d30f76090249a0d3a891cdf06b637e542e4cbf16%2Fradix-accordion-content.png?alt=media" alt=""><figcaption></figcaption></figure>

## Using Collections within Accordions

To create an accordion with a [Collection](https://docs.webstudio.is/university/core-components/collection) that iterates over data and outputs an accordion item for each entry, ensure each item has a unique value set, like this:

<figure><img src="https://330243581-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTep4EGj6hSC54ozHujyK%2Fuploads%2Fgit-blob-d52a738867f36c6737a9d6f4595e0fbcea8bc9b6%2Faccordion-collection.png?alt=media" alt="accordion collection unique item"><figcaption></figcaption></figure>

## Related Videos

{% embed url="<https://www.youtube.com/watch?v=PhCRSML1-G8>" %}

## Related

* [Collapsible](https://docs.webstudio.is/university/radix/collapsible) – Single expandable/collapsible panel
* [Tabs](https://docs.webstudio.is/university/radix/tabs) – Organize content into switchable panels
* [Dialog](https://docs.webstudio.is/university/radix/dialog) – Modal window for focused content
* [Collection](https://docs.webstudio.is/university/core-components/collection) – Generate accordion items dynamically from data
