---
title: "Accordion"
subtitle: "<Accordion> and <AccordionGroup> are content blocks that start collapsed."
---

Collapsible content built on native `<details>`, so it works without JavaScript. `<AccordionGroup>` merges several accordions into one bordered group.

```mdx
<AccordionGroup>
  <Accordion title="Which package managers are supported?" icon="lucide:package" defaultOpen>
    npm, pnpm, and yarn can all install `bitidocs` globally.
  </Accordion>
  <Accordion title="Which Node.js version do I need?" description="A line of text below the title">
    22.13 or later.
  </Accordion>
  <Accordion title="Can only one be open at a time?" name="faq">
    Give accordions in the same group the same `name`; opening one automatically closes the others.
  </Accordion>
</AccordionGroup>
```

<AccordionGroup>
  <Accordion title="Which package managers are supported?" icon="lucide:package" defaultOpen>
    npm, pnpm, and yarn can all install `bitidocs` globally.
  </Accordion>
  <Accordion title="Which Node.js version do I need?" description="A line of text below the title">
    22.13 or later.
  </Accordion>
  <Accordion title="Can only one be open at a time?" name="faq">
    Give accordions in the same group the same `name`; opening one automatically closes the others.
  </Accordion>
</AccordionGroup>

## Accordion props

<ParamField path="title" type="string" required>Title.</ParamField>
<ParamField path="description" type="string">Subtitle below the title.</ParamField>
<ParamField path="defaultOpen" type="boolean" default="false">Open by default (`open` also works).</ParamField>
<ParamField path="icon" type="icon">Icon before the title.</ParamField>
<ParamField path="id" type="string">Anchor id, generated from the title by default; visiting `#id` opens it automatically.</ParamField>
<ParamField path="name" type="string">Exclusive group name: only one accordion with the same name is open at a time.</ParamField>

Alias: `<Collapse>`.
