Skip to content
Selection & Inputs

Switch

Toggle a single setting on or off

Switches toggle the state of a single item on or off. They are the preferred control for settings rows where the change takes effect immediately.

Switch demos rendered in Compose Playground
Pixel-accurate preview · light theme

Examples

01

Settings rows

Pair each switch with a label in a Row.

Kotlin
var wifi by remember { mutableStateOf(true) }
Row(verticalAlignment = Alignment.CenterVertically) {
    Text("Wi-Fi", modifier = Modifier.weight(1f))
    Switch(checked = wifi, onCheckedChange = { wifi = it })
}