Android 12 Developer Preview is here! Try it out, and give us your feedback!

ButtonColors

@Stable interface ButtonColors
androidx.compose.material.ButtonColors

Represents the background and content colors used in a button in different states.

See ButtonDefaults.buttonColors for the default colors used in a Button. See ButtonDefaults.outlinedButtonColors for the default colors used in a OutlinedButton. See ButtonDefaults.textButtonColors for the default colors used in a TextButton.

Summary

Public methods
abstract State<Color>

Represents the background color for this button, depending on enabled.

abstract State<Color>

Represents the content color for this button, depending on enabled.

Public methods

backgroundColor

@Composable abstract fun backgroundColor(enabled: Boolean): State<Color>

Represents the background color for this button, depending on enabled.

Parameters
enabled: Boolean whether the button is enabled

contentColor

@Composable abstract fun contentColor(enabled: Boolean): State<Color>

Represents the content color for this button, depending on enabled.

Parameters
enabled: Boolean whether the button is enabled