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 every trigger in the accordion.boolean
loop Keyboard focus loops from the last trigger back to the first.boolean
class Extra classes merged onto the root.string
children Compose `Accordion.Item` blocks inside.Snippet