androidx.compose.material3
IconButtonDefaults
Object
No hand-written docs yet.
Contains the default values for all four icon and icon toggle button types.
object IconButtonDefaults
Properties
standardShapeSince 1.9
@Composable val standardShape: Shape
Default ripple shape for a standard icon button.
filledShape
@Composable val filledShape: Shape
Default shape for a filled icon button.
outlinedShape
@Composable val outlinedShape: Shape
Default shape for an outlined icon button.
extraSmallRoundShapeSince 1.10
@Composable val extraSmallRoundShape: Shape
Default round shape for any extra small icon button.
extraSmallSquareShapeSince 1.10
@Composable val extraSmallSquareShape: Shape
Default square shape for any extra small icon button.
extraSmallPressedShapeSince 1.10
@Composable val extraSmallPressedShape: Shape
Default pressed shape for any extra small icon button.
extraSmallSelectedRoundShapeSince 1.10
@Composable val extraSmallSelectedRoundShape: Shape
Default selected shape for any extra small icon button.
extraSmallSelectedSquareShapeSince 1.10
@Composable val extraSmallSelectedSquareShape: Shape
Default selected shape for any extra small, square icon button.
smallRoundShapeSince 1.10
@Composable val smallRoundShape: Shape
Default shape for any small icon button.
smallSquareShapeSince 1.10
@Composable val smallSquareShape: Shape
Default square shape for any small icon button.
smallPressedShapeSince 1.10
@Composable val smallPressedShape: Shape
Default pressed shape for any small icon button.
smallSelectedRoundShapeSince 1.10
@Composable val smallSelectedRoundShape: Shape
Default selected shape for any small icon button.
smallSelectedSquareShapeSince 1.11
@Composable val smallSelectedSquareShape: Shape
Default selected shape for any small, square icon button.
mediumRoundShapeSince 1.10
@Composable val mediumRoundShape: Shape
Default shape for any medium icon button.
mediumSquareShapeSince 1.10
@Composable val mediumSquareShape: Shape
Default shape for any medium icon button.
mediumPressedShapeSince 1.10
@Composable val mediumPressedShape: Shape
Default pressed shape for any medium icon button.
mediumSelectedRoundShapeSince 1.10
@Composable val mediumSelectedRoundShape: Shape
Default selected shape for any medium icon button.
mediumSelectedSquareShapeSince 1.10
@Composable val mediumSelectedSquareShape: Shape
Default selected shape for any medium, square icon button.
largeRoundShapeSince 1.10
@Composable val largeRoundShape: Shape
Default shape for any large icon button.
largeSquareShapeSince 1.10
@Composable val largeSquareShape: Shape
Default shape for any large icon button.
largePressedShapeSince 1.10
@Composable val largePressedShape: Shape
Default pressed shape for any large icon button.
largeSelectedRoundShapeSince 1.10
@Composable val largeSelectedRoundShape: Shape
Default selected shape for any large icon button.
largeSelectedSquareShapeSince 1.10
@Composable val largeSelectedSquareShape: Shape
Default selected shape for any large, square icon button.
extraLargeRoundShapeSince 1.10
@Composable val extraLargeRoundShape: Shape
Default shape for any extra large icon button.
extraLargeSquareShapeSince 1.10
@Composable val extraLargeSquareShape: Shape
Default shape for any extra large icon button.
extraLargePressedShapeSince 1.10
@Composable val extraLargePressedShape: Shape
Default pressed shape for any extra large icon button.
extraLargeSelectedRoundShapeSince 1.10
@Composable val extraLargeSelectedRoundShape: Shape
Default selected shape for any extra large icon button.
extraLargeSelectedSquareShapeSince 1.10
@Composable val extraLargeSelectedSquareShape: Shape
Default selected shape for any extra large, square icon button.
extraSmallIconSizeSince 1.10
val extraSmallIconSize: Dp
Default container for any extra small icon button.
smallIconSizeSince 1.10
val smallIconSize: Dp
Default size for any small icon button.
mediumIconSizeSince 1.10
val mediumIconSize: Dp
Default container size for any medium icon button.
largeIconSizeSince 1.10
val largeIconSize: Dp
Default size for any large icon button.
extraLargeIconSizeSince 1.10
val extraLargeIconSize: Dp
Default size for any xlarge icon button.
Functions
iconButtonColors
@Composable
fun iconButtonColors(): IconButtonColors
Contains the default values used by IconButton. LocalContentColor will be applied to the icon and down the UI tree.
@Composable
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.
iconButtonVibrantColorsSince 1.9
@Composable
fun iconButtonVibrantColors(): IconButtonColors
Creates a IconButtonColors that represents the recommended high contrast colors used in an IconButton.
@Composable
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.
iconToggleButtonColors
@Composable
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.
@Composable
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.
iconToggleButtonVibrantColorsSince 1.9
@Composable
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.
@Composable
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.
filledIconButtonColors
@Composable
fun filledIconButtonColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledIconButton.
@Composable
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.
filledIconToggleButtonColors
@Composable
fun filledIconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.
@Composable
fun filledIconToggleButtonColors(
containerColor: Color = Color.Unspecified,
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.
filledTonalIconButtonColors
@Composable
fun filledTonalIconButtonColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.
@Composable
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.
filledTonalIconToggleButtonColors
@Composable
fun filledTonalIconToggleButtonColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.
@Composable
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.
outlinedIconButtonColors
@Composable
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.
@Composable
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.
outlinedIconButtonVibrantColorsSince 1.9
@Composable
fun outlinedIconButtonVibrantColors(): IconButtonColors
Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.
@Composable
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.
outlinedIconToggleButtonColors
@Composable
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.
@Composable
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.
outlinedIconToggleButtonVibrantColorsSince 1.9
@Composable
fun outlinedIconToggleButtonVibrantColors(): IconToggleButtonColors
Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.
@Composable
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.
outlinedIconToggleButtonBorder
@Composable
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.
outlinedIconToggleButtonVibrantBorderSince 1.9
@Composable
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.
outlinedIconButtonBorder
@Composable
fun outlinedIconButtonBorder(enabled: Boolean): BorderStroke
Represents the BorderStroke for an OutlinedIconButton, depending on its enabled state. LocalContentColor will be used as the border color.
outlinedIconButtonVibrantBorderSince 1.9
@Composable
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.
shapesSince 1.10
@Composable
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.
@Composable
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.
toggleableShapesSince 1.10
@Composable
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.
@Composable
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.
extraSmallContainerSizeSince 1.10
fun extraSmallContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform,
): DpSize
Default container size for any extra small icon button.
smallContainerSizeSince 1.10
fun smallContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform,
): DpSize
Default container size for any small icon button.
mediumContainerSizeSince 1.10
fun mediumContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform,
): DpSize
Default container size for any medium icon button.
largeContainerSizeSince 1.10
fun largeContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform,
): DpSize
Default container size for any large icon button.
extraLargeContainerSizeSince 1.10
fun extraLargeContainerSize(
widthOption: IconButtonWidthOption = IconButtonWidthOption.Uniform,
): DpSize
Default container size for any extra large icon button.
Nested types
Library docs
Contains the default values for all four icon and icon toggle button types.