Compose Component

SplitSwitchButton

The Wear Material SplitSwitchButton offers slots and a specific layout for a label and secondary label.

SplitSwitchButton social preview

SplitSwitchButtonSample

@Sampled
@Preview
@Composable
fun SplitSwitchButtonSample() {
    var checked by remember { mutableStateOf(true) }
    SplitSwitchButton(
        label = { Text("Split Switch Button", maxLines = 3, overflow = TextOverflow.Ellipsis) },
        checked = checked,
        onCheckedChange = { checked = it },
        toggleContentDescription = "Split Switch Button Sample",
        onContainerClick = { /* 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: