When to use it
Split related controls with separators. Keep labels short, and use icon buttons with names for dense editors.
Group compact buttons and toggles in one framed row or column.
Native example
Split related controls with separators. Keep labels short, and use icon buttons with names for dense editors.
@Composable
fun EditorToolbars(onUndo: () -> Unit, onRedo: () -> Unit, onPublish: () -> Unit) {
var italic by remember { mutableStateOf(false) }
var underline by remember { mutableStateOf(false) }
var lists by remember { mutableStateOf(setOf("bullets")) }
LumenToolbar(label = "Text formatting") {
LumenToggleButton("Italic", italic, { italic = it }, icon = LumenIconName.Italic, iconOnly = true)
LumenToggleButton("Underline", underline, { underline = it }, icon = LumenIconName.Underline, iconOnly = true)
LumenDivider()
LumenToggleGroup(
label = "Lists",
items = listOf(
LumenToggleOption("bullets", "Bullets", LumenIconName.List),
LumenToggleOption("numbers", "Numbers", LumenIconName.ListOrdered)
),
pressed = lists,
onPressedChange = { lists = it }
)
}
LumenToolbar(label = "Draft") {
LumenIconButton(LumenIconName.Undo2, "Undo", onClick = onUndo)
LumenIconButton(LumenIconName.Redo2, "Redo", onClick = onRedo)
LumenDivider()
LumenButton(onClick = onPublish) { LumenText("Publish") }
}
}Reference
The primary shared and platform-specific options exposed by LumenToolbar.
| API | Values or type | Default | Description |
|---|---|---|---|
| label / orientation / content | accessible name / row or column / controls | Toolbar / horizontal / required | Split related controls with separators. |
Native behavior
Split related controls with separators. Keep labels short, and use icon buttons with names for dense editors.
A named toolbar; each control keeps its own name and pressed state.
Shared component