Skip to content
🤔 Documentation issue? Report or edit

Switch

Info

This is the API of version 1.0.0-alpha08. Newer versions may have a different one

@Composable
fun SwitchDemo() {
    val checkedState = remember { mutableStateOf(true) }
    Switch(
        checked = checkedState.value,
        onCheckedChange = { checkedState.value = it }
    )
}

See also:


Last update: December 5, 2020