Uqudo UIregistry

Accordion

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

Yes. It adheres to the WAI-ARIA design pattern and can be fully operated with the keyboard.

Installation

npx shadcn@latest add @uqudo/accordion

Usage

import {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
} from "@/components/uqudo/ui/accordion"
<Accordion type="single" collapsible>
  <AccordionItem value="item-1">
    <AccordionTrigger>Is it accessible?</AccordionTrigger>
    <AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
  </AccordionItem>
</Accordion>

type="single" opens one item at a time; add collapsible so the open item can be closed again. Use type="multiple" to let several items stay open.

Examples

Multiple

Several sections can be expanded at once. defaultValue takes an array in this mode.

Orders ship within two business days and arrive in three to five.

Return any item within 30 days for a full refund.

API Reference

Accordion

The root. Renders a bordered, rounded container and manages which items are open.

Prop

Type

AccordionItem

One collapsible section. Gets a bottom border except on the last item and a subtle background while open.

Prop

Type

AccordionTrigger

The clickable heading. Wraps AccordionPrimitive.Header and Trigger and appends a chevron that flips between down and up as the item toggles.

Prop

Type

AccordionContent

The revealed panel. Animates its height on open and close; className is applied to the inner padding wrapper.

Prop

Type

Data attributes

Componentdata-slot
Accordionaccordion
AccordionItemaccordion-item
AccordionTriggeraccordion-trigger
Chevron iconsaccordion-trigger-icon
AccordionContentaccordion-content

On this page