Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
ActionsAndroid

Toolbar

Group compact buttons and toggles in one framed row or column.

Public APILumenToolbarAndroid / Compose

Native example

Use Toolbar

Split related controls with separators. Keep labels short, and use icon buttons with names for dense editors.

Toolbar rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
@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") }
    }
}
Android
A text formatting toolbar with compact icon toggles, a separator, and a list toggle group, plus a draft toolbar with undo, redo, and labeled actions.

Reference

Public API

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

APIValues or typeDefaultDescription
label / orientation / contentaccessible name / row or column / controlsToolbar / horizontal / requiredSplit related controls with separators.

Native behavior

Design and accessibility

When to use it

Split related controls with separators. Keep labels short, and use icon buttons with names for dense editors.

Accessibility

A named toolbar; each control keeps its own name and pressed state.

Shared component

Available on other platforms

React NativeApple / SwiftUI Web
Android docsCompose module