Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
ActionsAndroid

Toggle button

Turn one option on or off with a pressed-state button.

Public APILumenToggleButtonAndroid / Compose

Native example

Use Toggle button

Use it for formatting or view options. Use a toggle switch for settings.

Toggle button 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 FavoriteToggle() {
    var favorite by remember { mutableStateOf(false) }
    LumenToggleButton(
        label = "Favorite",
        pressed = favorite,
        onPressedChange = { favorite = it },
        icon = LumenIconName.Star
    )
}
Android
A pressed-state Favorite button with a star icon that reports its new pressed value.

Reference

Public API

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

APIValues or typeDefaultDescription
pressed / label / iconcontrolled state / name / leading iconrequired / required / noneUse it for formatting or view options.

Native behavior

Design and accessibility

When to use it

Use it for formatting or view options. Use a toggle switch for settings.

Accessibility

Exposes pressed state; icon-only buttons keep the label as their name.

Shared component

Available on other platforms

React NativeApple / SwiftUI
Android docsCompose module