---
title: "Accordion"
description: "A stack of collapsible sections."
---

> Documentation Index
> Fetch the complete documentation index at: https://gistui.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Accordion

```gistui
root = Accordion(Item("What is GistUI?", "A rendering engine for generative UI.", open), Item("Is it open source?", "Yes, under the MIT licence."), Item("Which frameworks?", "React, Vue, Svelte, Solid and vanilla JavaScript."))
```

## Signature

This is the line a model reads in the system prompt.

```gistui
Accordion(...Item, multiple)
```

- **Group:** Layout
- **Children:** Yes: Item
- **Positional arguments:** none

## Props

| Prop | Type | How to write it | Notes |
|---|---|---|---|
| `multiple` | flag | bare word: `multiple` |  |

## Use your own component

Keep the name and schema, swap what is drawn. The prompt and the model's output do not change.

### React

```tsx
import { ui } from "@gistui/react/ui";

const lib = ui.extend({ Accordion: MyAccordion });
<GistUI library={lib} stream={response.body} />;
```
### Vue

```vue
<GistUI :source="answer" :components="{ Accordion: MyAccordion }" />
```
### Svelte

```svelte
<GistUI source={answer} components={{ Accordion: MyAccordion }} />
```
### Solid

```tsx
<GistUI source={answer()} components={{ Accordion: MyAccordion }} />
```
### Vanilla

```ts
import { ui } from "@gistui/vanilla/ui";

const lib = ui.extend({ Accordion: (ctx) => ({ el: myElement(ctx) }) });
```

See [Custom components](/docs/guides/custom-components/) for the full contract. Style hook: `[data-gistui="Accordion"]`.

Source: https://gistui.com/docs/components/layout/accordion/index.mdx
