# Accordion

Stacked sections that open from numbered headings, each with a glyph that turns.

[View Accordion on CyberSpec](https://www.cyberspec.dev/components/sidebar/accordion)

## Component

Accordion belongs to the Layout group in the CyberSpec catalog. It uses @ui-sdk/react/accordion.

## Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/accordion.json
```

## Example

```tsx
"use client"

import { Accordion } from "@/components/ui/accordion"

export default function AccordionDemo() {
  return (
    <>
      <Accordion
        role="group"
        aria-label="Deck details"
        defaultValue={["core"]}
        items={[
          {
            value: "core",
            label: "Core",
            meta: "12 threads",
            content:
              "Vanta Mk.II, second revision. Twelve threads and 64 units of buffer, enough to hold three daemons in memory and still answer a trace.",
          },
          {
            value: "daemons",
            label: "Daemons",
            meta: "3 loaded",
            content:
              "Ghostwrite, Static Bloom and Null Ping are loaded. Deadlock is on the shelf: it needs a slot this deck doesn't have.",
          },
          {
            value: "firmware",
            label: "Firmware",
            meta: "Sealed",
            disabled: true,
            content: "Sealed by Vanta Systems.",
          },
        ]}
      />
    </>
  )
}
```

## Install this example

```sh
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/accordion-demo.json
```

## Resources

- [Interactive Accordion preview](https://www.cyberspec.dev/preview/accordion)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Accordion source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/accordion.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/accordion.json)
