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

The default height for a extra large button container.

Link copied to clipboard
val ExtraLargeContentPadding: PaddingValues

Default content padding for an extra large button.

Link copied to clipboard

The default size of the icon used inside of a extra large button.

Link copied to clipboard

The default spacing between an icon and a text when they used inside any extra large button.

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

Pressed shape for extra large buttons.

Link copied to clipboard

The default height for a extra small button container.

Link copied to clipboard
val ExtraSmallContentPadding: PaddingValues

Default content padding for an extra small button.

Link copied to clipboard

The default size of the icon used inside of a extra small button.

Link copied to clipboard

The default spacing between an icon and a text when they used inside any extra small button.

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

Pressed shape for extra small buttons.

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 a small button.

Link copied to clipboard
val IconSpacing: Dp

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

Link copied to clipboard

The default height for a large button container.

Link copied to clipboard
val LargeContentPadding: PaddingValues

Default content padding for a large button.

Link copied to clipboard

The default size of the icon used inside of a large button.

Link copied to clipboard

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

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

Pressed shape for large buttons.

Link copied to clipboard

The default height for a medium button container.

Link copied to clipboard
val MediumContentPadding: PaddingValues

Default content padding for a medium button.

Link copied to clipboard

The default size of the icon used inside of a medium button.

Link copied to clipboard

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

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

Pressed shape for medium buttons.

Link copied to clipboard
val MinHeight: Dp

The default min height applied for small 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 small 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 pressedShape: Shape

Pressed shape for default buttons.

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

Default shape for a button.

Link copied to clipboard
val SmallContentPadding: PaddingValues

The default content padding used for small Button

Link copied to clipboard

The expressive size of the icon used inside a small button.

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

Square shape for default buttons.

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.FocusedContainerElevation, hoveredElevation: Dp = FilledButtonTokens.HoveredContainerElevation, 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
fun contentPaddingFor(buttonHeight: Dp): PaddingValues

Recommended PaddingValues for a provided button height.

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.FocusedContainerElevation, hoveredElevation: Dp = ElevatedButtonTokens.HoveredContainerElevation, 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
fun iconSizeFor(buttonHeight: Dp): Dp

Recommended Icon size for a provided button height.

Link copied to clipboard
fun iconSpacingFor(buttonHeight: Dp): Dp

Recommended spacing after an Icon for a provided button height.

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 shapes(): ButtonShapes

Creates a ButtonShapes that represents the default shape and pressed shape used in a button.

@Composable
fun shapes(shape: Shape? = null, pressedShape: Shape? = null): ButtonShapes

Creates a ButtonShapes that represents the default shape and pressedShape used in a Button and its variants.

Link copied to clipboard
@Composable
fun shapesFor(buttonHeight: Dp): ButtonShapes

Recommended ButtonShapes for a provided button height.

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.

Link copied to clipboard
@Composable
fun textStyleFor(buttonHeight: Dp): TextStyle

Recommended TextStyle for a Text provided a button height.