Composable Component

ChildButton

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

ChildButtonSample

@Composable
fun ChildButtonSample(modifier: Modifier = Modifier.fillMaxWidth()) {
    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,
    )
}

SimpleChildButtonSample

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