# Accordion

> Several things that open one by one, like questions and answers: Disclosures in a column, a line between each.

| | |
|---|---|
| Kind | component |
| Contract | `review` · [accordion.contract.yaml](https://github.com/Runceanu/rost/blob/master/contracts/accordion.contract.yaml) |
| Guidance | `proposed` |
| Source | [Figma 745:29](https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=745-29) · read 2026-11-16 · frozen 2026-11-16 |
| Implemented in | nowhere yet |

## Install

It lands in `src/rost/accordion/`, with what it needs and its contract:

```sh
npx github:Runceanu/rost add accordion
```

Then import `src/rost/fonts.css` and `src/rost/tokens.css` once, at the root of the app. More on this in [Install](https://rost.build/docs/install.md).

## Props

| Prop | Type | Values | Default |
|---|---|---|---|
| `items` | slot |  |  |

## Anatomy

- `root`: A `<div>` holding the items in a column.
- `item`: A Disclosure, as it is, with 12px above and below and a 1px line under it.

## When to use

- **Questions and answers.** A few questions where most people need one answer: what counts as a business expense, when tax is due.

## When not to use

- **Things everyone needs.** If most people open every item, show them open.
- **One thing to hide.** A single detail out of the way is one **Disclosure**.

## Behaviour

Each item opens on its own; opening one doesn't close the others. It's Disclosures in a column with lines between them.

## Accessibility

- **Element**: A `<div>` of `<details>`, so each summary is a button the browser knows opens.
- **Keyboard**: Tab moves between summaries; Enter or Space opens and closes.
- **Colour**: The lines are decoration.

## Tokens

Every token this component uses, across all its variants.

| Token | Resolves to |
|---|---|
| `accordion/divider` | `#3a3a3a` |
| `spacing/gap/small-medium` | `12px` |
| `spacing/outline/small` | `1px` |

See it live, with every value of every variant: [rost.build/components/accordion/](https://rost.build/components/accordion/)
