🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Modifier

toggleable

Configure component to make it toggleable via input and accessibility events This version has no MutableInteractionSource or Indication parameters, the default indication from LocalIndication will be used.

ToggleableSample

@Sampled
@Composable
fun ToggleableSample() {
    var checked by remember { mutableStateOf(false) }
    // content that you want to make toggleable
    Text(
        modifier = Modifier.toggleable(value = checked, onValueChange = { checked = it }),
        text = checked.toString(),
    )
}