Compose Component

CompactButton

Wear Material CompactButton that offers a single slot to take any content (text, icon or image).

CompactButtonWithIcon

@Sampled
@Composable
fun CompactButtonWithIcon() {
    CompactButton(onClick = { /* Do something */ }, enabled = true) {
        Icon(
            painter = painterResource(id = R.drawable.ic_airplanemode_active_24px),
            contentDescription = "airplane",
            modifier =
                Modifier.size(ButtonDefaults.SmallIconSize)
                    .wrapContentSize(align = Alignment.Center),
        )
    }
}
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: