Accordion
Preserves Base UI Accordion state management and accessibility relationships while rendering open items as inset surfaces. Supports both multiple selection and controlled or uncontrolled usage.
@neumorphism-ui/accordionPreview
Installation
Installation: accordion
npx shadcn@latest add @neumorphism-ui/accordionThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Import
Accordion import code
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "@/components/ui/accordion"Example
Accordion usage code
<Accordion defaultValue={["shipping"]}>
<AccordionItem value="shipping">
<AccordionTrigger>How long does shipping take?</AccordionTrigger>
<AccordionContent>
Orders ship within 2–3 business days.
</AccordionContent>
</AccordionItem>
<AccordionItem value="returns">
<AccordionTrigger>Can I return my order?</AccordionTrigger>
<AccordionContent>
You can request a return within 14 days of delivery.
</AccordionContent>
</AccordionItem>
</Accordion>API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Accordion | multiple | boolean | false | Allows multiple items to remain open at the same time. |
Accordion | value / defaultValue | string[] | — | The controlled value or initial uncontrolled value of the open items. |
Accordion | onValueChange | (value) => void | — | Called when the set of open items changes. |
AccordionItem | valuerequired | string | — | A unique value that identifies the item. |
AccordionItem | disabled | boolean | false | Disables the item trigger. |
AccordionContent | keepMounted | boolean | false | Keeps the panel in the DOM while it is closed. |
Accessibility
- 01
Base UI manages the aria-expanded and aria-controls relationships between each trigger and panel.
- 02
Move focus to a trigger with Tab, then press Enter or Space to open or close the item.
- 03
AccordionTrigger renders a real button, so do not place another button inside its heading.