Skip to content
🤔 Documentation issue? Report or edit

Button

Info

This is the API of version 1.0.0-beta07

A Button has a onClick-Function. You can add a Text-Composable or any other Composables as child elements of the Button.

@Composable
fun ButtonExample() {
    Button(onClick = { /* Do something! */ }, colors = ButtonDefaults.textButtonColors(
        backgroundColor = Color.Red
    )) {
        Text("Button")
    }
}

See also:


Last update: May 24, 2021