Switch

fun Switch(checked: Boolean, onCheckedChange: (Boolean) -> Unit?, modifier: Modifier = Modifier, colors: SwitchColors = SwitchDefaults.switchColors(), enabled: Boolean = true, isLoading: Boolean = false)

A Switch component with COUI style.

Parameters

checked

The checked state of the Switch.

onCheckedChange

The callback to be called when the state of the Switch changes.

modifier

The modifier to be applied to the Switch.

colors

The SwitchColors of the Switch.

enabled

Whether the Switch is enabled.

isLoading

Whether the Switch is in the COUI loading state: the thumb shrinks away and is replaced by a spinning gradient arc; touch input is swallowed while loading.