---
title: Accordion
description: A vertically stacked set of interactive headings that each reveal a section of content.

link:
  doc: https://kobalte.dev/docs/core/components/accordion
  api: https://kobalte.dev/docs/core/components/accordion#api-reference
---

<ComponentPreview name="accordion-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/accordion-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/accordion" file=<rootDir>/apps/docs/src/registry/ui/accordion.tsx

    ```

    ```tsx title="components/ui/accordion" file=<rootDir>/apps/unocss-playground/src/registry/ui/accordion.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion"
```

```tsx
<Accordion>
  <AccordionItem value="item-1">
    <AccordionTrigger />
    <AccordionContent />
  </AccordionItem>
  <AccordionItem value="item-2">
    <AccordionTrigger />
    <AccordionContent />
  </AccordionItem>
</Accordion>
```
