by @alexstyl
✉️ Leave your feedback

← Back to Material Compose

Button

Component
in
Material
. Since 0.1.0-dev15

Overview

Examples

Community Notes

Video

@Composable
fun ButtonSample() {
    Button(onClick = { /* Do something! */ }) {
        Text("Button")
    }
}
@Composable
fun ButtonWithIconSample() {
    Button(onClick = { /* Do something! */ }) {
        Icon(
            Icons.Filled.Favorite,
            contentDescription = null,
            modifier = Modifier.size(ButtonDefaults.IconSize)
        )
        Spacer(Modifier.size(ButtonDefaults.IconSpacing))
        Text("Like")
    }
}
Previous ComponentBottomSheetScaffold
Next ComponentCard