GuideMobile ComponentsMain ComponentAccordion

Accordion

The accordion component that allows users to expand and collapse content sections. It is commonly used to display a large amount of information in a compact space, making it easier for users to scan and consume content.

TypeResource
DesignFigma
MobileMobile Storybook
CodeGitlab

Accordion Preview

Usage

import id.co.biofarma.binduiandroid.components.accordion.Accordion
val items = remember {
  mutableStateListOf(
    AccordionItem(title = "List Item",
      content = "Content for section")
  )
}
Accordion(
  items = items,
  type = "default",
  onToggle = { index ->
    items[index] = items[index].copy(isExpanded = !items[index].isExpanded)
  }
)

Examples

Type (optional)

Use type default, border, or background to add content to the accordion type.

Accordion Example Type


Mode (optional)

Use mode dark or light to use acordion mode.

Accordion Example Mode


Props

PropsRequiredDefaultTypedescription
itemstrue-List<title: String, content: String, isExpanded: Boolean>The list of items containing a title and content for the accordion.
typefalsedefaultdefault, border, backgroundThe visual style variant of the accordion.
onTogglefalse-(Int) -> UnitThe callback is triggered when clicking expand and collapse.
stylefalse-ModifierCustom styles for the accordion component.
BIND © Biofarma Innovate Next-level Design .