ButtonDefaults


Contains the default values used by all 5 button types.

Default values that apply to all buttons types are MinWidth, MinHeight, IconSize, and IconSpacing.

A default value that applies only to Button, ElevatedButton, FilledTonalButton, and OutlinedButton is ContentPadding.

Default values that apply only to Button are buttonColors and buttonElevation. Default values that apply only to ElevatedButton are elevatedButtonColors and elevatedButtonElevation. Default values that apply only to FilledTonalButton are filledTonalButtonColors and filledTonalButtonElevation. A default value that applies only to OutlinedButton is outlinedButtonColors. Default values that apply only to TextButton are TextButtonContentPadding and textButtonColors.

Summary

Public functions

ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a Button.

Cmn
ButtonColors
@Composable
buttonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default container and content colors used in a Button.

Cmn
ButtonElevation
@Composable
buttonElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    disabledElevation: Dp
)

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a Button.

Cmn
ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an ElevatedButton.

Cmn
ButtonColors
@Composable
elevatedButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default container and content colors used in an ElevatedButton.

Cmn
ButtonElevation
@Composable
elevatedButtonElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    disabledElevation: Dp
)

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a ElevatedButton.

Cmn
ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an FilledTonalButton.

Cmn
ButtonColors
@Composable
filledTonalButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default container and content colors used in an FilledTonalButton.

Cmn
ButtonElevation
@Composable
filledTonalButtonElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    disabledElevation: Dp
)

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a FilledTonalButton.

Cmn
ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an OutlinedButton.

Cmn
ButtonColors
@Composable
outlinedButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default container and content colors used in an OutlinedButton.

Cmn
ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a TextButton.

Cmn
ButtonColors
@Composable
textButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default container and content colors used in a TextButton.

Cmn

Public properties

PaddingValues

The default content padding used by Button that contains an Icon.

Cmn
PaddingValues

The default content padding used by Button, ElevatedButton, FilledTonalButton, and OutlinedButton buttons.

Cmn
Dp

The default size of the icon when used inside any button.

Cmn
Dp

The default size of the spacing between an icon and a text when they used inside any button.

Cmn
Dp

The default min height applied for all buttons.

Cmn
Dp

The default min width applied for all buttons.

Cmn
PaddingValues

The default content padding used by TextButton.

Cmn
PaddingValues

The default content padding used by TextButton that contains an Icon.

Cmn
Shape

Default shape for an elevated button.

Cmn
Shape

Default shape for a filled tonal button.

Cmn
BorderStroke

The default BorderStroke used by OutlinedButton.

Cmn
Shape

Default shape for an outlined button.

Cmn
Shape

Default shape for a button.

Cmn
Shape

Default shape for a text button.

Cmn

Public functions

buttonColors

@Composable
fun buttonColors(): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a Button.

buttonColors

@Composable
fun buttonColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified
): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a Button.

Parameters
containerColor: Color = Color.Unspecified

the container color of this Button when enabled.

contentColor: Color = Color.Unspecified

the content color of this Button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this Button when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this Button when not enabled.

buttonElevation

@Composable
fun buttonElevation(
    defaultElevation: Dp = FilledButtonTokens.ContainerElevation,
    pressedElevation: Dp = FilledButtonTokens.PressedContainerElevation,
    focusedElevation: Dp = FilledButtonTokens.FocusContainerElevation,
    hoveredElevation: Dp = FilledButtonTokens.HoverContainerElevation,
    disabledElevation: Dp = FilledButtonTokens.DisabledContainerElevation
): ButtonElevation

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a Button.

Parameters
defaultElevation: Dp = FilledButtonTokens.ContainerElevation

the elevation used when the Button is enabled, and has no other Interactions.

pressedElevation: Dp = FilledButtonTokens.PressedContainerElevation

the elevation used when this Button is enabled and pressed.

focusedElevation: Dp = FilledButtonTokens.FocusContainerElevation

the elevation used when the Button is enabled and focused.

hoveredElevation: Dp = FilledButtonTokens.HoverContainerElevation

the elevation used when the Button is enabled and hovered.

disabledElevation: Dp = FilledButtonTokens.DisabledContainerElevation

the elevation used when the Button is not enabled.

elevatedButtonColors

@Composable
fun elevatedButtonColors(): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an ElevatedButton.

elevatedButtonColors

@Composable
fun elevatedButtonColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified
): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an ElevatedButton.

Parameters
containerColor: Color = Color.Unspecified

the container color of this ElevatedButton when enabled

contentColor: Color = Color.Unspecified

the content color of this ElevatedButton when enabled

disabledContainerColor: Color = Color.Unspecified

the container color of this ElevatedButton when not enabled

disabledContentColor: Color = Color.Unspecified

the content color of this ElevatedButton when not enabled

elevatedButtonElevation

@Composable
fun elevatedButtonElevation(
    defaultElevation: Dp = ElevatedButtonTokens.ContainerElevation,
    pressedElevation: Dp = ElevatedButtonTokens.PressedContainerElevation,
    focusedElevation: Dp = ElevatedButtonTokens.FocusContainerElevation,
    hoveredElevation: Dp = ElevatedButtonTokens.HoverContainerElevation,
    disabledElevation: Dp = ElevatedButtonTokens.DisabledContainerElevation
): ButtonElevation

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a ElevatedButton.

Parameters
defaultElevation: Dp = ElevatedButtonTokens.ContainerElevation

the elevation used when the ElevatedButton is enabled, and has no other Interactions.

pressedElevation: Dp = ElevatedButtonTokens.PressedContainerElevation

the elevation used when this ElevatedButton is enabled and pressed.

focusedElevation: Dp = ElevatedButtonTokens.FocusContainerElevation

the elevation used when the ElevatedButton is enabled and focused.

hoveredElevation: Dp = ElevatedButtonTokens.HoverContainerElevation

the elevation used when the ElevatedButton is enabled and hovered.

disabledElevation: Dp = ElevatedButtonTokens.DisabledContainerElevation

the elevation used when the ElevatedButton is not enabled.

filledTonalButtonColors

@Composable
fun filledTonalButtonColors(): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an FilledTonalButton.

filledTonalButtonColors

@Composable
fun filledTonalButtonColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified
): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an FilledTonalButton.

Parameters
containerColor: Color = Color.Unspecified

the container color of this FilledTonalButton when enabled

contentColor: Color = Color.Unspecified

the content color of this FilledTonalButton when enabled

disabledContainerColor: Color = Color.Unspecified

the container color of this FilledTonalButton when not enabled

disabledContentColor: Color = Color.Unspecified

the content color of this FilledTonalButton when not enabled

filledTonalButtonElevation

@Composable
fun filledTonalButtonElevation(
    defaultElevation: Dp = FilledTonalButtonTokens.ContainerElevation,
    pressedElevation: Dp = FilledTonalButtonTokens.PressedContainerElevation,
    focusedElevation: Dp = FilledTonalButtonTokens.FocusContainerElevation,
    hoveredElevation: Dp = FilledTonalButtonTokens.HoverContainerElevation,
    disabledElevation: Dp = 0.dp
): ButtonElevation

Creates a ButtonElevation that will animate between the provided values according to the Material specification for a FilledTonalButton.

Parameters
defaultElevation: Dp = FilledTonalButtonTokens.ContainerElevation

the elevation used when the FilledTonalButton is enabled, and has no other Interactions.

pressedElevation: Dp = FilledTonalButtonTokens.PressedContainerElevation

the elevation used when this FilledTonalButton is enabled and pressed.

focusedElevation: Dp = FilledTonalButtonTokens.FocusContainerElevation

the elevation used when the FilledTonalButton is enabled and focused.

hoveredElevation: Dp = FilledTonalButtonTokens.HoverContainerElevation

the elevation used when the FilledTonalButton is enabled and hovered.

disabledElevation: Dp = 0.dp

the elevation used when the FilledTonalButton is not enabled.

outlinedButtonColors

@Composable
fun outlinedButtonColors(): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an OutlinedButton.

outlinedButtonColors

@Composable
fun outlinedButtonColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    disabledContainerColor: Color = Color.Unspecified,
    disabledContentColor: Color = Color.Unspecified
): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in an OutlinedButton.

Parameters
containerColor: Color = Color.Unspecified

the container color of this OutlinedButton when enabled

contentColor: Color = Color.Unspecified

the content color of this OutlinedButton when enabled

disabledContainerColor: Color = Color.Unspecified

the container color of this OutlinedButton when not enabled

disabledContentColor: Color = Color.Unspecified

the content color of this OutlinedButton when not enabled

textButtonColors

@Composable
fun textButtonColors(): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a TextButton.

textButtonColors

@Composable
fun textButtonColors(
    containerColor: Color = Color.Transparent,
    contentColor: Color = TextButtonTokens.LabelTextColor.value,
    disabledContainerColor: Color = Color.Transparent,
    disabledContentColor: Color = TextButtonTokens.DisabledLabelTextColor .value .copy(alpha = TextButtonTokens.DisabledLabelTextOpacity)
): ButtonColors

Creates a ButtonColors that represents the default container and content colors used in a TextButton.

Parameters
containerColor: Color = Color.Transparent

the container color of this TextButton when enabled

contentColor: Color = TextButtonTokens.LabelTextColor.value

the content color of this TextButton when enabled

disabledContainerColor: Color = Color.Transparent

the container color of this TextButton when not enabled

disabledContentColor: Color = TextButtonTokens.DisabledLabelTextColor .value .copy(alpha = TextButtonTokens.DisabledLabelTextOpacity)

the content color of this TextButton when not enabled

Public properties

ButtonWithIconContentPadding

val ButtonWithIconContentPaddingPaddingValues

The default content padding used by Button that contains an Icon.

ContentPadding

val ContentPaddingPaddingValues

The default content padding used by Button, ElevatedButton, FilledTonalButton, and OutlinedButton buttons.

IconSize

val IconSizeDp

The default size of the icon when used inside any button.

IconSpacing

val IconSpacingDp

The default size of the spacing between an icon and a text when they used inside any button.

MinHeight

val MinHeightDp

The default min height applied for all buttons. Note that you can override it by applying Modifier.heightIn directly on the button composable.

MinWidth

val MinWidthDp

The default min width applied for all buttons. Note that you can override it by applying Modifier.widthIn directly on the button composable.

TextButtonContentPadding

val TextButtonContentPaddingPaddingValues

The default content padding used by TextButton.

TextButtonWithIconContentPadding

val TextButtonWithIconContentPaddingPaddingValues

The default content padding used by TextButton that contains an Icon.

elevatedShape

val elevatedShapeShape

Default shape for an elevated button.

filledTonalShape

val filledTonalShapeShape

Default shape for a filled tonal button.

outlinedButtonBorder

val outlinedButtonBorderBorderStroke

The default BorderStroke used by OutlinedButton.

outlinedShape

val outlinedShapeShape

Default shape for an outlined button.

shape

val shapeShape

Default shape for a button.

textShape

val textShapeShape

Default shape for a text button.