# Switch

> Switch from Material Compose (`androidx.compose.material:material`) for Jetpack Compose, with a code sample.

- Library: [Material Compose](https://composables.com/material-components/material-compose.md)
- Category: [Switches](https://composables.com/material-components/switches.md)
- API reference and more examples: [Switch](https://composables.com/jetpack-compose/androidx.compose.material/material/components/Switch/api.md)

## Code

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