public object IconButtonDefaults
Contains the default values for all four icon and icon toggle button types.
Properties
standardShape
public val standardShape: Shape
Default ripple shape for a standard icon button.
filledShape
public val filledShape: Shape
Default shape for a filled icon button.
outlinedShape
public val outlinedShape: Shape
Default shape for an outlined icon button.
extraSmallRoundShape
public val extraSmallRoundShape: Shape
Default round shape for any extra small icon button.
extraSmallSquareShape
public val extraSmallSquareShape: Shape
Default square shape for any extra small icon button.
extraSmallPressedShape
public val extraSmallPressedShape: Shape
Default pressed shape for any extra small icon button.
extraSmallSelectedRoundShape
public val extraSmallSelectedRoundShape: Shape
Default selected shape for any extra small icon button.
extraSmallSelectedSquareShape
public val extraSmallSelectedSquareShape: Shape
Default selected shape for any extra small, square icon button.
smallRoundShape
public val smallRoundShape: Shape
Default shape for any small icon button.
smallSquareShape
public val smallSquareShape: Shape
Default square shape for any small icon button.
smallPressedShape
public val smallPressedShape: Shape
Default pressed shape for any small icon button.
smallSelectedRoundShape
public val smallSelectedRoundShape: Shape
Default selected shape for any small icon button.
smallSelectedSquareShape
public val smallSelectedSquareShape: Shape
Default selected shape for any small, square icon button.
SmallSelectedSquareShape
@Deprecated(
message = "Use the camel case version",
replaceWith = ReplaceWith("smallSelectedSquareShape"),
level = DeprecationLevel.HIDDEN,
)
@get:JvmName("getSmallSelectedSquareShape_pascalName") // Renames the JVM signature
public val SmallSelectedSquareShape: Shape
mediumRoundShape
public val mediumRoundShape: Shape
Default shape for any medium icon button.
mediumSquareShape
public val mediumSquareShape: Shape
Default shape for any medium icon button.
mediumPressedShape
public val mediumPressedShape: Shape
Default pressed shape for any medium icon button.
mediumSelectedRoundShape
public val mediumSelectedRoundShape: Shape
Default selected shape for any medium icon button.
mediumSelectedSquareShape
public val mediumSelectedSquareShape: Shape
Default selected shape for any medium, square icon button.
largeRoundShape
public val largeRoundShape: Shape
Default shape for any large icon button.
largeSquareShape
public val largeSquareShape: Shape
Default shape for any large icon button.
largePressedShape
public val largePressedShape: Shape
Default pressed shape for any large icon button.
largeSelectedRoundShape
public val largeSelectedRoundShape: Shape
Default selected shape for any large icon button.
largeSelectedSquareShape
public val largeSelectedSquareShape: Shape
Default selected shape for any large, square icon button.
extraLargeRoundShape
public val extraLargeRoundShape: Shape
Default shape for any extra large icon button.
extraLargeSquareShape
public val extraLargeSquareShape: Shape
Default shape for any extra large icon button.
extraLargePressedShape
public val extraLargePressedShape: Shape
Default pressed shape for any extra large icon button.
extraLargeSelectedRoundShape
public val extraLargeSelectedRoundShape: Shape
Default selected shape for any extra large icon button.
extraLargeSelectedSquareShape
public val extraLargeSelectedSquareShape: Shape
Default selected shape for any extra large, square icon button.
extraSmallIconSize
public val extraSmallIconSize: Dp = XSmallIconButtonTokens.IconSize
Default container for any extra small icon button.
smallIconSize
public val smallIconSize: Dp = SmallIconButtonTokens.IconSize
Default size for any small icon button.
mediumIconSize
public val mediumIconSize: Dp = MediumIconButtonTokens.IconSize
Default container size for any medium icon button.
largeIconSize
public val largeIconSize: Dp = LargeIconButtonTokens.IconSize
Default size for any large icon button.
extraLargeIconSize
public val extraLargeIconSize: Dp = XLargeIconButtonTokens.IconSize
Default size for any xlarge icon button.
Functions
iconButtonColors
@Composable
public fun iconButtonColors(): IconButtonColors
Contains the default values used by IconButton. LocalContentColor will be applied to the icon and down the UI tree.
See iconButtonVibrantColors for default values that applies the recommended high contrast colors.
iconButtonColors
@Composable
public fun iconButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = LocalContentColor.current,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity),
): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a IconButton. LocalContentColor will be applied to the icon and down the UI tree unless a custom contentColor is provided.
See iconButtonVibrantColors for default values that applies the recommended high contrast colors.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. By default, this will use the current LocalContentColor value. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
iconButtonVibrantColors
@Composable
public fun iconButtonVibrantColors(): IconButtonColors
Creates a IconButtonColors that represents the recommended high contrast colors used in an IconButton.
See iconButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
iconButtonVibrantColors
@Composable
public fun iconButtonVibrantColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity),
): IconButtonColors
Creates a IconButtonColors that represents the recommended high contrast colors used in an IconButton.
See iconButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
iconToggleButtonColors
@Composable
public fun iconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton. LocalContentColor will be applied to the icon and down the UI tree.
See iconToggleButtonVibrantColors for default values that applies the recommended high contrast colors.
iconToggleButtonColors
@Composable
public fun iconToggleButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = LocalContentColor.current,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity),
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = Color.Unspecified,
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton. LocalContentColor will be applied to the icon and down the UI tree unless a custom contentColor is provided.
See iconToggleButtonVibrantColors for default values that applies the recommended high contrast colors.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
iconToggleButtonVibrantColors
@Composable
public fun iconToggleButtonVibrantColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the recommended high contrast colors used in a IconToggleButton. See iconToggleButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
iconToggleButtonVibrantColors
@Composable
public fun iconToggleButtonVibrantColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity),
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = Color.Unspecified,
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the recommended high contrast colors used in a IconToggleButton.
See iconToggleButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
filledIconButtonColors
@Composable
public fun filledIconButtonColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledIconButton.
filledIconButtonColors
@Composable
public fun filledIconButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = contentColorFor(containerColor),
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color = Color.Unspecified,
): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledIconButton.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
filledIconToggleButtonColors
@Composable
public fun filledIconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.
filledIconToggleButtonColors
@Composable
public fun filledIconToggleButtonColors(
containerColor: Color = Color.Unspecified,
// TODO(b/228455081): Using contentColorFor here will return OnSurfaceVariant,
// while the token value is Primary.
contentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color = Color.Unspecified,
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = contentColorFor(checkedContainerColor),
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
filledTonalIconButtonColors
@Composable
public fun filledTonalIconButtonColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.
filledTonalIconButtonColors
@Composable
public fun filledTonalIconButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = contentColorFor(containerColor),
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color = Color.Unspecified,
): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
filledTonalIconToggleButtonColors
@Composable
public fun filledTonalIconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.
filledTonalIconToggleButtonColors
@Composable
public fun filledTonalIconToggleButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = contentColorFor(containerColor),
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color = Color.Unspecified,
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = contentColorFor(checkedContainerColor),
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
outlinedIconButtonColors
@Composable
public fun outlinedIconButtonColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton. LocalContentColor will be applied to the icon and down the UI tree.
See outlinedIconButtonVibrantColors for default values that applies the recommended high contrast colors.
outlinedIconButtonColors
@Composable
public fun outlinedIconButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = LocalContentColor.current,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity),
): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.
See outlinedIconButtonVibrantColors for default values that applies the recommended high contrast colors.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
outlinedIconButtonVibrantColors
@Composable
public fun outlinedIconButtonVibrantColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.
See outlinedIconButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
outlinedIconButtonVibrantColors
@Composable
public fun outlinedIconButtonVibrantColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity),
): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.
See outlinedIconButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
outlinedIconToggleButtonColors
@Composable
public fun outlinedIconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton. LocalContentColor will be applied to the icon and down the UI tree.
See outlinedIconButtonVibrantColors for default values that applies the recommended high contrast colors.
outlinedIconToggleButtonColors
@Composable
public fun outlinedIconToggleButtonColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = LocalContentColor.current,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity),
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = contentColorFor(checkedContainerColor),
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton. LocalContentColor will be applied to the icon and down the UI tree.
See outlinedIconButtonVibrantColors for default values that applies the recommended high contrast colors.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
outlinedIconToggleButtonVibrantColors
@Composable
public fun outlinedIconToggleButtonVibrantColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.
See outlinedIconToggleButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
outlinedIconToggleButtonVibrantColors
@Composable
public fun outlinedIconToggleButtonVibrantColors(
containerColor: Color = Color.Unspecified,
contentColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
disabledContentColor: Color =
contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity),
checkedContainerColor: Color = Color.Unspecified,
checkedContentColor: Color = contentColorFor(checkedContainerColor),
): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.
See outlinedIconToggleButtonColors for default values that applies LocalContentColor to the icon and down the UI tree.
Parameters
| containerColor | the container color of this icon button when enabled. |
| contentColor | the content color of this icon button when enabled. |
| disabledContainerColor | the container color of this icon button when not enabled. |
| disabledContentColor | the content color of this icon button when not enabled. |
| checkedContainerColor | the container color of this icon button when checked. |
| checkedContentColor | the content color of this icon button when checked. |
outlinedIconToggleButtonBorder
@Composable
public fun outlinedIconToggleButtonBorder(enabled: Boolean, checked: Boolean): BorderStroke?
Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state. LocalContentColor will be used as the border color.
See outlinedIconToggleButtonVibrantBorder for a BorderStroke that uses the spec recommended color as the border color.
Parameters
| enabled | whether the icon button is enabled |
| checked | whether the icon button is checked |
outlinedIconToggleButtonVibrantBorder
@Composable
public fun outlinedIconToggleButtonVibrantBorder(
enabled: Boolean,
checked: Boolean,
): BorderStroke?
Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state. The spec recommended color will be used as the border color.
Parameters
| enabled | whether the icon button is enabled |
| checked | whether the icon button is checked |
outlinedIconButtonBorder
@Composable
public fun outlinedIconButtonBorder(enabled: Boolean): BorderStroke
Represents the BorderStroke for an OutlinedIconButton, depending on its enabled state. LocalContentColor will be used as the border color.
See outlinedIconToggleButtonVibrantBorder for a BorderStroke that uses the spec recommended color as the border color.
Parameters
| enabled | whether the icon button is enabled |
outlinedIconButtonVibrantBorder
@Composable
public fun outlinedIconButtonVibrantBorder(enabled: Boolean): BorderStroke
Represents the BorderStroke for an OutlinedIconButton, depending on its enabled state. The spec recommended color will be used as the border color.
Parameters
| enabled | whether the icon button is enabled |
shapes
@Composable
public fun shapes(shape: Shape? = null, pressedShape: Shape? = null): IconButtonShapes
Creates a IconButtonShapes that correspond to the shapes in the default or pressed states. Icon button will morph between these shapes as long as the shapes are all CornerBasedShapes.
Parameters
| shape | the unchecked shape for ButtonShapes |
| pressedShape | the unchecked shape for ButtonShapes |
shapes
@Composable public fun shapes(): IconButtonShapes
Creates a IconButtonShapes that correspond to a default IconButton in the active and pressed states. IconButton will morph between these shapes as long as the shapes are all CornerBasedShapes.
toggleableShapes
@Composable
public fun toggleableShapes(
shape: Shape? = null,
pressedShape: Shape? = null,
checkedShape: Shape? = null,
): IconToggleButtonShapes
Creates a IconToggleButtonShapes that correspond to the shapes in the default, pressed, and checked states. Icon button will morph between these shapes as long as the shapes are all CornerBasedShapes.
Parameters
| shape | the active shape for IconToggleButtonShapes |
| pressedShape | the pressed shape for IconToggleButtonShapes |
| checkedShape | the checked shape for IconToggleButtonShapes |
toggleableShapes
@Composable
public fun toggleableShapes(): IconToggleButtonShapes
Creates a ButtonShapes that correspond to a default IconToggleButton in the active, pressed and selected states. IconToggleButton will morph between these shapes as long as the shapes are all CornerBasedShapes.
extraSmallContainerSize
public fun extraSmallContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize
Default container size for any extra small icon button.
Parameters
| widthOption | the width of the container |
smallContainerSize
public fun smallContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize
Default container size for any small icon button.
Parameters
| widthOption | the width of the container |
mediumContainerSize
public fun mediumContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize
Default container size for any medium icon button.
Parameters
| widthOption | the width of the container |
largeContainerSize
public fun largeContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize
Default container size for any large icon button.
Parameters
| widthOption | the width of the container |
extraLargeContainerSize
public fun extraLargeContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize
Default container size for any extra large icon button.
Parameters
| widthOption | the width of the container |
Members
IconButtonWidthOption
public class IconButtonWidthOption private constructor(private val value: Int)
Class that describes the different supported widths of the IconButton.
Members
Companion
public companion object
Properties
Narrow
public val Narrow: IconButtonWidthOption
Uniform
public val Uniform: IconButtonWidthOption
Wide
public val Wide: IconButtonWidthOption