Compose Component

Switch

Material Design switch Switches toggle the state of a single item on or off.

Switch social preview

SwitchSample

@Sampled
@Composable
fun SwitchSample() {
    val checkedState = remember { mutableStateOf(true) }
    Switch(checked = checkedState.value, onCheckedChange = { checkedState.value = it })
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: