Accordion
@sushindustries/uidetails, stacked - every behaviour ships in the element, and items open independently on purpose.
Accordion renders a list of <details> elements, one per item, each opening
independently of the others. Reach for it when a page has several expandable
panels - an FAQ, a settings group - and more than one might need to stay open
at once. Reach for Collapsible instead for a single expandable line in prose.
tanstacktanstack add https://adamjurek.com/r/tanstack/accordion.jsonpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/accordion.jsonWhy it is built this way
Every behaviour - toggle, keyboard, screen-reader announcement, find-in-page
opening the right panel - ships in <details> itself, which is why this
component is markup and a chevron and nothing else. Items open independently
on purpose: an accordion that closes its neighbours when one opens is a radio
group wearing a disclosure costume, and it hides content a reader already
chose to see.
What it does not do
It takes no callback for open state and no controlled open prop past the
first render. defaultOpen seeds which ids start open; after that, each
<details> runs itself. An accordion that needs to know what is open, or
force an item shut from outside, needs different plumbing than this one.
Install commands are not written here
Anything in packages/ui/registry.ts gets its TanStack and shadcn commands
attached automatically, so there is nothing to keep in sync.
Install
tanstack add https://adamjurek.com/r/tanstack/accordion.jsonpnpm dlx shadcn@latest add https://adamjurek.com/r/shadcn/accordion.jsonpnpm add @sushindustries/ui @sushindustries/atomsWhat you get
| Version | 0.1.0 |
| Category | layout · Disclosure |
| Files | accordion.tsx |
| Dependencies | None |
| Also installs | iconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content |
| Tags | details, no-deps |
No runtime dependencies
It brings nothing with it beyond the stylesheet.