Compose Component

Checkbox

Checkbox provides an animated checkbox for use as a toggle control in ToggleChip or SplitToggleChip.

SplitToggleChipWithCheckbox

@Sampled
@Composable
fun SplitToggleChipWithCheckbox() {
    var checked by remember { mutableStateOf(true) }
    // The primary label should have a maximum 3 lines of text
    // and the secondary label should have max 2 lines of text.
    SplitToggleChip(
        label = { Text("Split with CheckboxIcon", maxLines = 3, overflow = TextOverflow.Ellipsis) },
        checked = checked,
        toggleControl = { Checkbox(checked = checked, enabled = true) },
        onCheckedChange = { checked = it },
        onClick = { /* Do something */ },
        enabled = true,
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: