Accordion

Collapsible disclosure sections.

Usage

Import the namespace and compose Accordion.Root, Accordion.Item, Accordion.Header, Accordion.Trigger, and Accordion.Content. The type prop controls whether one or many items can be open at once.

Multiple

Set type="multiple" to allow several items to stay open simultaneously. Each item's open state is independent.

Props

Props for Accordion.Root. Each Accordion.Item requires a unique value string that pairs its Trigger with its Content. All parts accept class for custom overrides.

PropTypeDefault
type Single allows one open item at a time; multiple allows many.'single' | 'multiple''single'
value Controlled open item(s). Use bind:value for two-way binding.string | string[]
onValueChange Called when the open item(s) change.(value: string & string[]) => void
disabled Disables all triggers in the accordion.booleanfalse
loop Keyboard focus loops from last trigger back to first.booleantrue
class Extra classes merged onto the root.string
children Compose Accordion.Item blocks inside.Snippet