Accordion

A vertically stacked set of interactive headings that each reveal a section of content.

shadcn/ui docs →

Preview

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

Installation

terminal
$
Other package managers
bunx --bun shadcn@latest add https://trents.tech/r/accordion.json

Dependencies: @radix-ui/react-accordion

Usage

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

<Accordion type="single" collapsible className="w-full max-w-xl">
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>
      Yes. It adheres to the WAI-ARIA design pattern.
    </AccordionContent>
  </AccordionItem>
</Accordion>
0