Skip to main content
Accordions let users expand and collapse sections to reveal content progressively. Each AccordionItem has a clickable title and hidden content that appears on expand.

Basic Usage

Default Open

Use default_open_items to expand items when the accordion first renders. Pass an index or title. You can also assign a stable value to items and reference them by name, which is useful when item order might change:

Multiple Open

Set multiple=True to allow more than one section open at a time.

API Reference

Accordion Parameters

int | str | list[int | str] | None
default:"None"
Initially expanded item(s). Pass an index to select by position, or a string to match by title.
bool
default:"False"
Allow multiple items to be open simultaneously.
bool
default:"True"
Whether the open item can be collapsed.
str | None
default:"None"
Additional Tailwind CSS classes.

AccordionItem Parameters

str
required
Trigger label text. Can be passed as a positional argument.
str | None
default:"None"
Unique value identifying this item. Defaults to the title.

Protocol Reference

Accordion
AccordionItem
For the complete protocol schema, see Accordion, AccordionItem.