Skip to content

Accordion

A collapsible content component that displays a list of expandable items. Each item consists of a header and content that can be shown or hidden.

The Accordion widget provides a flexible way to organize and present content in a compact format. It supports different styles, customizable appearance, and various configuration options.

  • Styles: Simple and Card
  • Content Types: Text content or custom widget content
  • Customizable: Supports custom styling, icons, and animations

Basic accordion with a clean, minimalist design.


Accordion items with elevated card-like appearance.


PropertyTypeDescription
itemsList<AccordionItem>Required. List of accordion items to display.
typeAccordionTypeStyle of the accordion (simple, card). Default: simple.
expandAllboolWhether all items should be expanded by default. Default: false.
borderRadiusBorderRadiusBorder radius of the accordion items. Default: 8px.
dividerColorColor?Color of the divider between items (simple style only).
headerBackgroundColorColor?Background color of the header sections.
headerTextStyleTextStyle?Text style for the header titles.
contentBackgroundColorColor?Background color of the content sections.
contentTextStyleTextStyle?Text style for the content text.
expandIconIconDataIcon shown when item is collapsed. Default: Icons.expand_more
collapseIconIconDataIcon shown when item is expanded. Default: Icons.expand_less
customExpandIconWidget?Custom widget to replace default expand icon.
customCollapseIconWidget?Custom widget to replace default collapse icon.
iconColorColor?Color of the expand/collapse icons.
paddingEdgeInsetsGeometryPadding around the header. Default: vertical: 16px
contentPaddingEdgeInsetsGeometryPadding around the content. Default: all sides: 16px
animationDurationDurationDuration of expand/collapse animation. Default: 300ms