Accordion

@sushindustries/ui

details, stacked - every behaviour ships in the element, and items open independently on purpose.

4 min read
View as MarkdownEdit on GitHub

When not to use it

Every row here opens independently - opening one never closes another, and there is no prop to change that. If the actual requirement is "only one section open at a time", this is the wrong component: build it from individual CollapsibleCollapsibleOne details, dressed - a sentence that opens, for prose rather than lists.@sushindustries/ui · layout instances and lift the open id into state, rather than asking this one to fake exclusivity it was not built for.

Reduced motion

Only the chevron animates - a 180ms rotation when a row opens. Under prefers-reduced-motion: reduce the rotation is instant; the disclosure itself has no transition to remove, since <details> opens and closes without one on its own.

UsesIconIconThe glyph set, generated from a Markdown table where every drawing carries its reason. One component, typed names, no icon font.@sushindustries/ui · content
Mentioned inCollapsible