---
title: "CompactButtonContent"
description: "Lays out the content of a CompactButton with support for an icon and a label."
type: "component"
lastmod: "2026-07-02T02:32:46.570590Z"
---
## API Reference

### CompactButtonContent

> Source set: Android

```kotlin
@Composable
public fun CompactButtonContent(
    modifier: Modifier = Modifier,
    icon: (@Composable BoxScope.() -> Unit)? = null,
    enabled: Boolean = true,
    colors: ButtonColors = ButtonDefaults.buttonColors(),
    label: (@Composable RowScope.() -> Unit)? = null,
)
```

#### Parameters

| | |
| --- | --- |
| modifier | Modifier to be applied to the compact button content layout. |
| icon | A slot for providing the button's icon. |
| enabled | Controls the enabled state of the button content. |
| colors | [ButtonColors](/jetpack-compose/androidx.wear.compose/compose-material3/classes/ButtonColors) that will be used to resolve the content and icon colors in different states. See [ButtonDefaults.buttonColors](/jetpack-compose/androidx.wear.compose/compose-material3/objects/ButtonDefaults). |
| label | A slot for providing the button's main label. |

## Code Examples
### CompactButtonContentWithOneHandedGestureSample
```kotlin
@Composable
fun CompactButtonContentWithOneHandedGestureSample() {
    var label by remember { mutableStateOf("Compact Button") }
    val onClick = remember { { label = "Gestured" } }
    val interactionSource = remember { MutableInteractionSource() }
    Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
        CompactButton(
            onClick = onClick,
            interactionSource = interactionSource,
            modifier =
                Modifier.oneHandedGesture(
                    action = GestureAction.Primary,
                    interactionSource = interactionSource,
                    onGesture = onClick,
                ),
        ) {
            OneHandedGestureIndicator(
                interactionSource = interactionSource,
                gestureIndicatorTint = MaterialTheme.colorScheme.onPrimary,
            ) {
                CompactButtonContent(
                    icon = {
                        Icon(
                            painter = painterResource(R.drawable.ic_favorite_rounded),
                            contentDescription = "Favorite icon",
                            modifier = Modifier.size(CompactButtonDefaults.ExtraSmallIconSize),
                        )
                    },
                    colors = ButtonDefaults.buttonColors(),
                    label = { Text(label) },
                )
            }
        }
    }
}
```
