Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
LayoutAndroid

Accordion

Stack disclosure sections with single or multiple expansion.

Public APILumenAccordionAndroid / Compose

Native example

Use Accordion

Use single mode for one open section at a time. Keep titles short and put detail in the body.

Accordion rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
import androidx.compose.runtime.*
import com.santi020k.lumen.*

@Composable
fun AccountAccordion() {
    var expanded by remember { mutableStateOf(setOf("account")) }
    LumenAccordion(
        items = listOf(
            LumenAccordionItem("account", "Account details", "Your workspace profile"),
            LumenAccordionItem("billing", "Billing and invoices"),
            LumenAccordionItem("locked", "Managed by your organization", disabled = true)
        ),
        expanded = expanded,
        onExpandedChange = { expanded = it },
        type = LumenAccordionType.Single
    ) { item ->
        LumenText(
            if (item.value == "account") "Update your display name and contact preferences in Settings."
            else "Your next invoice is available at the start of each month."
        )
    }
}
Android
A single-open accordion that keeps one section expanded, with a disabled section the organization manages.

Reference

Public API

The primary shared and platform-specific options exposed by LumenAccordion.

APIValues or typeDefaultDescription
items / type / variantsections / single or multiple / card, flush, or hairlinerequired / multiple / defaultUse single mode for one open section at a time.

Native behavior

Design and accessibility

When to use it

Use single mode for one open section at a time. Keep titles short and put detail in the body.

Accessibility

Each header is a button with expanded state; collapsed content is hidden.

Shared component

Available on other platforms

React NativeApple / SwiftUI Web
Android docsCompose module