Accordion
Yes. Every component is MIT licensed. Use it in personal and commercial projects, change whatever you like, and ship it without attribution.
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/accordion.jsonUsage
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion"
<Accordion defaultValue="free">
<AccordionItem value="free">
<AccordionTrigger>Is NeonKit free?</AccordionTrigger>
<AccordionContent>Yes. Every component is MIT licensed.</AccordionContent>
</AccordionItem>
</Accordion>Examples
Multiple
type="multiple" lets any number of sections stay open, like a filter panel.
Controlled
Drive value from state to expand or collapse everything at once.
API reference
Accordion
Renders a div and accepts every native div attribute.
| Prop | Type | Default |
|---|---|---|
type | "single"How many items can be open at once. | "single" |
defaultValue | stringInitially open item(s) when uncontrolled. A string for single, an array for multiple. | None |
value | stringOpen item(s) when controlled. "" means none in single mode. | None |
onValueChange | (value: string | string[]) => voidCalled with the new value, typed to match type. | None |
collapsible | booleanSingle only. Lets the open item close again. | true |
color | NeonColorPalette name or hex. Falls back to --neon-accent, then cyan. | inherited |
AccordionItem
Renders a div. Items are separated by hairlines.
| Prop | Type | Default |
|---|---|---|
value | stringUnique id for the item. | None |
disabled | booleanLocks the item in its current state. | false |
AccordionTrigger, AccordionContent
The trigger is a button inside an h3; the content is a div that animates its height.
| Prop | Type | Default |
|---|---|---|
className | stringMerged with the defaults. | None |
Accessibility
- Each trigger is a real button with aria-expanded and aria-controls, wrapped in an h3.
- Content has role="region" and is labelled by its trigger.
- Up and Down arrows move between triggers; Home and End jump to the first and last.
- When collapsible is false, the open trigger reports aria-disabled so screen readers know it cannot close.
- Height and opacity animations are skipped when the user prefers reduced motion.