Docs
手风琴

手风琴

一组垂直堆叠的互动标题,每个标题都能揭示一段内容。

安装

pnpm dlx shadcn@latest add accordion

使用方法

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion"
<Accordion type="single" collapsible>
  <AccordionItem value="item-1">
    <AccordionTrigger>是否可以访问?</AccordionTrigger>
    <AccordionContent>
      是的。它符合 WAI-ARIA 设计模式。
    </AccordionContent>
  </AccordionItem>
</Accordion>