CheckboxLabelled

fun CheckboxLabelled(state: ToggleableState, onClick: () -> Unit?, modifier: Modifier = Modifier, enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, contentSide: ContentSide = ContentSide.End, intent: ToggleIntent = ToggleIntent.Basic, content: @Composable RowScope.() -> Unit)

Checkboxes allows users to select one or more items from a set. Checkboxes can turn an option on or off.

  • Toggle a single item on or off.

  • Require another action to activate or deactivate something.

Parameters

state

whether TriStateCheckbox is checked, unchecked or in indeterminate state

onClick

callback to be invoked when checkbox is being clicked, therefore the change of checked state in requested. If null, then this is passive and relies entirely on a higher-level component to control the "checked" state.

modifier

Modifier to be applied to the layout of the checkbox

enabled

whether the component is enabled or grayed out

interactionSource

the MutableInteractionSource representing the stream of Interactions for this Checkbox. You can create and pass in your own remembered MutableInteractionSource if you want to observe Interactions and customize the appearance / behavior of this Checkbox in different Interactions.

contentSide

The side where we want to show the label, default to ContentSide.End.

intent

The ToggleIntent to use to draw the checkbox

content

The content displayed after the checkbox, usually a Text composable shown at the end.

See also

if you require support for an indeterminate state, or more advanced color customization between states. Be aware that this is still an internal composable so if you need such state contact the Spark team