public object ButtonDefaults
Contains the default values used by Button.
Functions
primaryButtonColors
@Composable
public fun primaryButtonColors(
backgroundColor: Color = MaterialTheme.colors.primary,
contentColor: Color = contentColorFor(backgroundColor),
): ButtonColors
Creates a ButtonColors that represents the default background and content colors for a primary Button. Primary buttons have a colored background with a contrasting content color. If a button is disabled then the colors will have an alpha (ContentAlpha.disabled) value applied.
Parameters
| backgroundColor | The background color of this Button when enabled |
| contentColor | The content color of this Button when enabled |
secondaryButtonColors
@Composable
public fun secondaryButtonColors(
backgroundColor: Color = MaterialTheme.colors.surface,
contentColor: Color = contentColorFor(backgroundColor),
): ButtonColors
Creates a ButtonColors that represents the default background and content colors for a secondary Button. Secondary buttons have a muted background with a contrasting content color. If a button is disabled then the colors will have an alpha (ContentAlpha.disabled) value applied.
Parameters
| backgroundColor | The background color of this Button when enabled |
| contentColor | The content color of this Button when enabled |
iconButtonColors
@Composable
public fun iconButtonColors(
contentColor: Color = MaterialTheme.colors.onSurface
): ButtonColors
Creates a ButtonColors that represents the content colors for an icon-only Button. If a button is disabled then the colors will have an alpha (ContentAlpha.disabled) value applied.
Parameters
| contentColor | The content color of this Button when enabled |
outlinedButtonColors
@Composable
public fun outlinedButtonColors(
contentColor: Color = MaterialTheme.colors.primary
): ButtonColors
Creates a ButtonColors that represents the content colors for an OutlinedButton. If a button is disabled then the colors will have an alpha (ContentAlpha.disabled) value applied.
Parameters
| contentColor | The content color of this OutlinedButton when enabled |
buttonBorder
@Composable
public fun buttonBorder(
borderStroke: BorderStroke? = null,
disabledBorderStroke: BorderStroke? = borderStroke,
): ButtonBorder
Creates a ButtonBorder for the default border used in most Button
Parameters
| borderStroke | The border of this Button when enabled - or no border if null |
| disabledBorderStroke | The border of this Button when disabled - or no border if null |
outlinedButtonBorder
@Composable
public fun outlinedButtonBorder(
borderColor: Color = MaterialTheme.colors.primaryVariant.copy(alpha = 0.6f),
disabledBorderColor: Color = borderColor.copy(alpha = ContentAlpha.disabled),
borderWidth: Dp = 1.dp,
): ButtonBorder
Creates a ButtonBorder for the OutlinedButton
Parameters
| borderColor | The color to use for the border for this OutlinedButton when enabled |
| disabledBorderColor | The color to use for the border for this OutlinedButton when disabled |
| borderWidth | The width to use for the border for this OutlinedButton |
buttonColors
@Composable
public fun buttonColors(
backgroundColor: Color = MaterialTheme.colors.primary,
contentColor: Color = contentColorFor(backgroundColor),
disabledBackgroundColor: Color = backgroundColor.copy(alpha = ContentAlpha.disabled),
disabledContentColor: Color = contentColor.copy(alpha = ContentAlpha.disabled),
): ButtonColors
Creates a ButtonColors that represents the default background and content colors used in a Button.
Parameters
| backgroundColor | the background color of this Button when enabled |
| contentColor | the content color of this Button when enabled |
| disabledBackgroundColor | the background color of this Button when not enabled |
| disabledContentColor | the content color of this Button when not enabled |