When to use it
Use single mode for one open section at a time. Keep titles short and put detail in the body.
Stack disclosure sections with single or multiple expansion.
Native example
Use single mode for one open section at a time. Keep titles short and put detail in the body.
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."
)
}
}Reference
The primary shared and platform-specific options exposed by LumenAccordion.
| API | Values or type | Default | Description |
|---|---|---|---|
| items / type / variant | sections / single or multiple / card, flush, or hairline | required / multiple / default | Use single mode for one open section at a time. |
Native behavior
Use single mode for one open section at a time. Keep titles short and put detail in the body.
Each header is a button with expanded state; collapsed content is hidden.
Shared component