Compose Component

ChildButton

Base level Wear Material3 ChildButton that offers a single slot to take any content.

ChildButton social preview

SimpleChildButtonSample

@Sampled
@Composable
fun SimpleChildButtonSample() {
    ChildButton(
        onClick = { /* Do something */ },
        label = {
            Text("Child Button", textAlign = TextAlign.Center, modifier = Modifier.fillMaxWidth())
        },
        modifier = Modifier.fillMaxWidth(),
    )
}

ChildButtonSample

@Sampled
@Composable
fun ChildButtonSample() {
    ChildButton(
        onClick = { /* Do something */ },
        label = { Text("Child Button") },
        secondaryLabel = { Text("Secondary label") },
        icon = {
            Icon(
                painter = painterResource(R.drawable.ic_favorite_rounded),
                contentDescription = "Favorite icon",
                modifier = Modifier.size(ButtonDefaults.IconSize),
            )
        },
        modifier = Modifier.fillMaxWidth(),
    )
}
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: