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.
Change a controlled boolean setting from a wearable-sized row.
Wear OS availability
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 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.
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
The primary shared and platform-specific options exposed by LumenWearToggle.
| API | Values or type | Default | Description |
|---|---|---|---|
| label | Native localized text | Required | Names the setting. |
| checked / onCheckedChange | Boolean binding / value and callback | Required | Keeps state application-owned. |
| detail | Optional native text | nil / null | Adds supporting setting context. |
| enabled | Boolean | true | Prevents changes while disabled. |
| onLabel / offLabel | String? / String? | null | Localized state text. When set, TalkBack announces each change while the row keeps focus. |
Native behavior
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.
Exposes the setting name, checked state, and native toggle semantics in one touch target.
Shared component