Compose Component

CheckboxButton

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

CheckboxButton social preview

CheckboxButtonSample

@Sampled
@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,
    )
}
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: