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.

Properties

Link copied to clipboard
val ButtonWithIconContentPadding: PaddingValues

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

Link copied to clipboard
val ContentPadding: PaddingValues

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

Link copied to clipboard
@get:Composable
val elevatedShape: Shape

Default shape for an elevated button.

Link copied to clipboard
@get:Composable
val filledTonalShape: Shape

Default shape for a filled tonal button.

Link copied to clipboard
val IconSize: Dp

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

Link copied to clipboard
val IconSpacing: Dp

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

Link copied to clipboard
val MinHeight: Dp

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

Link copied to clipboard
val MinWidth: Dp

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

Link copied to clipboard
@get:Composable
val outlinedButtonBorder: BorderStroke

The default BorderStroke used by OutlinedButton.

Link copied to clipboard
@get:Composable
val outlinedShape: Shape

Default shape for an outlined button.

Link copied to clipboard
@get:Composable
val shape: Shape

Default shape for a button.

Link copied to clipboard
val TextButtonContentPadding: PaddingValues

The default content padding used by TextButton.

Link copied to clipboard

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

Link copied to clipboard
@get:Composable
val textShape: Shape

Default shape for a text button.

Functions

Link copied to clipboard
@Composable
fun buttonColors(): 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.

Link copied to clipboard
@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.

Link copied to clipboard
@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.

Link copied to clipboard
@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.

Link copied to clipboard
@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.

Link copied to clipboard
@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.

Link copied to clipboard
@Composable
fun outlinedButtonBorder(enabled: Boolean = true): BorderStroke

The default BorderStroke used by OutlinedButton.

Link copied to clipboard
@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.

Link copied to clipboard
@Composable
fun textButtonColors(): ButtonColors
@Composable
fun textButtonColors(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 TextButton.