Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
FormsWear OS

Wearable toggle

Change a controlled boolean setting from a wearable-sized row.

Public APILumenWearToggleWear OS / Compose

Wear OS availability

Use the dedicated Wear artifact

Add com.santi020k:lumen-compose-wear:6.0.0 to your Wear OS module and import this component from com.santi020k.lumen. Wrap content in LumenWearTheme, which defaults to dark appearance and uses LumenThemeScope for tokens, named themes, typography, shapes, and androidx.compose.material3.MaterialTheme roles. Your separate Wear Material provider remains application-owned. Wear UI primitives accept a Compose modifier with Modifier as its default.

The release plan targets this version; confirm Maven Central availability before pinning it.

Native example

Use Wearable toggle

Use for a boolean setting. Keep its value controlled, and persist or synchronize it in the application. Provide a concise label that remains meaningful in either state.

Wearable toggle rendered in the Wear OS emulator Lumen playground
Captured exampleWear OS emulator
kotlin
import androidx.compose.runtime.*
import com.santi020k.lumen.*

@Composable
fun WearToggleExample() {
    var reminders by remember { mutableStateOf(true) }
    LumenWearToggle(
        "Reminders",
        checked = reminders,
        onCheckedChange = { reminders = it },
        onLabel = "On",
        offLabel = "Off"
    )
}

Reference

Public API

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

APIValues or typeDefaultDescription
labelNative localized textRequiredNames the setting.
checked / onCheckedChangeBoolean binding / value and callbackRequiredKeeps state application-owned.
detailOptional native textnil / nullAdds supporting setting context.
enabledBooleantruePrevents changes while disabled.
onLabel / offLabelString? / String?nullLocalized state text. When set, TalkBack announces each change while the row keeps focus.

Native behavior

Design and accessibility

When to use it

Use for a boolean setting. Keep its value controlled, and persist or synchronize it in the application. Provide a concise label that remains meaningful in either state.

Accessibility

Exposes the setting name, checked state, and native toggle semantics in one touch target.

Shared component

Available on other platforms

Apple / SwiftUI
Android docsCompose module