shadimage
Spectrum UI
componentaccordionsource: ok · hit

Accordion

component for the Accordion

npx shadcn add "https://ui.spectrumhq.in/r/accordion.json"
free

Interaction

accordion

Tags auto-generated by rules on 9/24/2026 — empty means no evidence, not lack of support.

Dependencies

Bundle weight · light

Registry dependencies

@spectrumui/accordion-dependencies

Files1 · source cached 10/9/2026, 6:46:56 PM

app/registry/accordion/accordion-demo.tsx
import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/ui/accordion";

export function AccordionDemo() {
  return (
    <Accordion type="single" collapsible className="w-full max-w-lg">
      <AccordionItem value="item-1">
        <AccordionTrigger>Is it accessible?</AccordionTrigger>
        <AccordionContent>
          Yes. It follows the WAI-ARIA disclosure pattern, so headings stay
          focusable and every panel is reachable with the keyboard.
        </AccordionContent>
      </AccordionItem>
      <AccordionItem value="item-2">
        <AccordionTrigger>Is it styled?</AccordionTrigger>
        <AccordionContent>
          Yes. Four variants ship with it — line, card, filled, and ghost — and
          every class stays editable in the copied source.
        </AccordionContent>
      </AccordionItem>
      <AccordionItem value="item-3">
        <AccordionTrigger>Is it animated?</AccordionTrigger>
        <AccordionContent>
          Yes. Panels expand on a height transition and the indicator rotates
          with it. Both respect a reduced-motion preference.
        </AccordionContent>
      </AccordionItem>
    </Accordion>
  );
}

More from Spectrum UI

Browse all components in this library →