Search documentation

Search components and pages

Accordion

A stacked set of headings that reveal a section of content.

Yes. It adheres to the WAI-ARIA design pattern.

01

Installation

Add the accordion component with the shadcn CLI.

bash
npx shadcn@latest add https://swiss.ui.unsanity.ai/r/accordion.json
02

Usage

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

Examples

Default

Yes. It adheres to the WAI-ARIA design pattern.

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

<Accordion defaultValue={["item-1"]} className="w-72">
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
  </AccordionItem>
</Accordion>