Skip to content
  • Android
  • iOS
  • Web

Accordion

Expand a single section or group related panels with single or multiple expansion.

Engine API NAccordionnayan-ui/components

Live examples

Example.tsx
Single
Multiple

Attributes

NAccordion attributes
NameTypeDefaultDetails
itemsreadonly T[]RequiredPanels with a title, message, and optional id and disabled flag.
type"single" | "multiple"OptionalHow many panels can be open at once. Default: single.
defaultExpandedbooleanOptionalOpen the first enabled panel initially when expansion is uncontrolled.
expandedbooleanOptionalControl whether any panel is open. Opening selects the first enabled panel if no selection is saved.
onExpandedChange((expanded: boolean) => void)OptionalCalled when a user action opens the first panel or closes the last one.
variant"default" | "surface"OptionalSurface gives each panel its own background and border. Default: default.
classNamestringOptional
itemClassNamestringOptional
triggerClassNamestringOptional
contentClassNamestringOptional
indicatorClassNamestringOptional

Tags