Stacked sections that open and close under their headings.
A Markdown brief for Claude, Cursor or v0: install, setup, props and a complete example.
For long content people only need parts of, such as FAQs or settings groups.
Content everyone needs? Show it. Views of the same thing? Tabs.
Each heading holds a button with aria-expanded that controls its section.
import { Accordion } from '@idyeah/diya'Stable since 1.0.0
itemsRequiredAccordionItem[]The sections, in order; all start closed.
disabledbooleanDisables every section's button.
Default false
dividedbooleanDraws lines between sections. Defaults to true.
Default true
headingLevel1 | 2 | 3 | 4 | 5 | 6Heading level of each section's button, h1 to h6. Defaults to 3.
Default 3
multiplebooleanLets several sections stay open at once; by default opening one closes the others.
Default false
Also takes every native <div> attribute, such as id, aria-* or data-*.