AstraUI

Components

Accordion

A vertically stacked set of interactive headings that expand to reveal associated content.

Default Accordion

Default Accordion with Subtitle

Accordion with Multiple Open

Split Accordion

Props

NameTypeDefaultDescription
childrenReactNode-The AccordionItem components to be rendered.
classNamestring-Additional classes for styling the Accordion container.
itemClassNamestring-Additional classes for styling each AccordionItem.
borderstring-Border style for the accordion items.
selectionModesingle, multiplesingleDetermines if multiple items can be open simultaneously.
variantdefault, splitdefaultDetermines the layout style of the accordion.

Best Practices

  • Use accordions to organize content in a compact way, allowing users to expand sections as needed.
  • Ensure that the content of accordion items are descriptive and concise.
  • Use the multiple selection mode when users might need to compare information across different sections.
  • Use the split variant when you want to visually separate accordion items, especially for longer lists.