StylishCheckbox

fun StylishCheckbox(checked: Boolean, onCheckedChange: (Boolean) -> Unit?, modifier: Modifier = Modifier, enabled: Boolean = true, colors: CheckboxColors = CheckboxDefaults.colors(), interactionSource: MutableInteractionSource? = null)

A checkbox for marking an independent option as selected or not, wrapping the Material 3 Checkbox so it can be themed consistently with the rest of Stylish UI. Use a checkbox when the selection is confirmed elsewhere (e.g. on form submit); for immediate on/off behaviour prefer StylishSwitch, and for mutually exclusive choices prefer StylishRadioButton.

Parameters

checked

Whether the checkbox is currently checked.

onCheckedChange

Called with the new state when the user toggles the checkbox. null makes the checkbox display-only.

modifier

Modifier applied to the Checkbox root. The root carries the default test tag stylish_checkbox for UI tests; callers can override it by passing their own Modifier.testTag(...) here.

enabled

When false, the checkbox ignores pointer input and renders in the disabled color scheme.

colors

Colors used in each state. Defaults to CheckboxDefaults.colors.

interactionSource

The MutableInteractionSource for the checkbox, used to observe press/focus/hover interactions. When null, an internal one is remembered.

See also