Composable Component

CheckboxButton

The Wear Material CheckboxButton offers three slots and a specific layout for an icon, a label, and a secondaryLabel.

CheckboxButtonSample

@Preview
@Composable
fun CheckboxButtonSample() {
    var checked by remember { mutableStateOf(true) }
    CheckboxButton(
        label = { Text("Checkbox Button", maxLines = 3, overflow = TextOverflow.Ellipsis) },
        secondaryLabel = {
            Text("With secondary label", maxLines = 2, overflow = TextOverflow.Ellipsis)
        },
        checked = checked,
        onCheckedChange = { checked = it },
        icon = { Icon(Icons.Filled.Favorite, contentDescription = "Favorite icon") },
        enabled = true,
    )
}