IconButtonDefaults


Contains the default values for all four icon and icon toggle button types.

Summary

Nested types

Class that describes the different supported widths of the IconButton.

Public functions

IconButtonColors

Creates a IconButtonColors that represents the default colors used in a FilledIconButton.

Cmn
IconButtonColors
@Composable
filledIconButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a IconButtonColors that represents the default colors used in a FilledIconButton.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.

Cmn
IconToggleButtonColors
@Composable
filledIconToggleButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    checkedContainerColor: Color,
    checkedContentColor: Color
)

Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.

Cmn
IconButtonColors

Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.

Cmn
IconButtonColors
@Composable
filledTonalIconButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.

Cmn
IconToggleButtonColors
@Composable
filledTonalIconToggleButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    checkedContainerColor: Color,
    checkedContentColor: Color
)

Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.

Cmn
IconButtonColors

Creates a IconButtonColors that represents the default colors used in a IconButton.

Cmn
IconButtonColors
@Composable
iconButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a IconButtonColors that represents the default colors used in a IconButton.

Cmn
IconButtonColors

Contains the default values used by IconButton.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton.

Cmn
IconToggleButtonColors
@Composable
iconToggleButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    checkedContainerColor: Color,
    checkedContentColor: Color
)

Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton.

Cmn
DpSize

Default container size for any large icon button.

Cmn
DpSize

Default container size for any medium icon button.

Cmn
BorderStroke

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled state.

Cmn
IconButtonColors

Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.

Cmn
IconButtonColors
@Composable
outlinedIconButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.

Cmn
BorderStroke?
Cmn
IconButtonColors

Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.

Cmn
BorderStroke?

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.

Cmn
IconToggleButtonColors
@Composable
outlinedIconToggleButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    checkedContainerColor: Color,
    checkedContentColor: Color
)

Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.

Cmn
BorderStroke?

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state.

Cmn
IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.

Cmn
IconButtonShapes
@ExperimentalMaterial3ExpressiveApi
@Composable
shapes(shape: Shape, pressedShape: Shape, checkedShape: Shape)

Creates a ButtonShapes that correspond to the shapes in the default, pressed, and checked states.

Cmn
DpSize

Default container size for any small icon button.

Cmn
DpSize

Default container size for any extra large icon button.

Cmn
DpSize

Default container size for any extra small icon button.

Cmn

Public properties

Shape

Default shape for a filled icon button.

Cmn
Dp

Default size for any large icon button.

Cmn
Shape

Default pressed shape for any large icon button.

Cmn
Shape

Default shape for any large icon button.

Cmn
Shape

Default shape for any large icon button.

Cmn
Dp

Default container size for any medium icon button.

Cmn
Shape

Default pressed shape for any medium icon button.

Cmn
Shape

Default shape for any medium icon button.

Cmn
Shape

Default shape for any medium icon button.

Cmn
Shape

Default shape for an outlined icon button.

Cmn
Dp

Default size for any small icon button.

Cmn
Shape

Default pressed shape for any small icon button.

Cmn
Shape

Default shape for any small icon button.

Cmn
Shape

Default shape for any small icon button.

Cmn
Shape

Default ripple shape for a standard icon button.

Cmn
Dp

Default size for any xlarge icon button.

Cmn
Shape

Default pressed shape for any extra large icon button.

Cmn
Shape

Default shape for any xlarge icon button.

Cmn
Shape

Default shape for any xlarge icon button.

Cmn
Dp

Default container for any extra small icon button.

Cmn
Shape

Default pressed shape for any extra small icon button.

Cmn
Shape

Default round shape for any extra small icon button.

Cmn
Shape

Default square shape for any extra small icon button.

Cmn

Public functions

filledIconButtonColors

@Composable
fun filledIconButtonColors(): IconButtonColors

Creates a IconButtonColors that represents the default colors used in a FilledIconButton.

filledIconButtonColors

@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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this icon button when not enabled.

filledIconToggleButtonColors

@Composable
fun filledIconToggleButtonColors(): IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a FilledIconToggleButton.

filledIconToggleButtonColors

@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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = Color.Unspecified

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this icon button when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this icon button when checked.

checkedContentColor: Color = contentColorFor(checkedContainerColor)

the content color of this icon button when checked.

filledTonalIconButtonColors

@Composable
fun filledTonalIconButtonColors(): IconButtonColors

Creates a IconButtonColors that represents the default colors used in a FilledTonalIconButton.

filledTonalIconButtonColors

@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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this icon button when not enabled.

filledTonalIconToggleButtonColors

@Composable
fun filledTonalIconToggleButtonColors(): IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a FilledTonalIconToggleButton.

filledTonalIconToggleButtonColors

@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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this icon button when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this icon button when checked.

checkedContentColor: Color = contentColorFor(checkedContainerColor)

the content color of this icon button when checked.

iconButtonColors

@Composable
fun iconButtonColors(): IconButtonColors

Creates a IconButtonColors that represents the default colors used in a IconButton. See iconButtonLocalContentColors for default values that applies LocalContentColor to the icon and down the UI tree.

iconButtonColors

@Composable
fun iconButtonColors(
    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 default colors used in a IconButton.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = Color.Unspecified

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity)

the content color of this icon button when not enabled.

iconButtonLocalContentColors

@Composable
fun iconButtonLocalContentColors(): IconButtonColors

Contains the default values used by IconButton. LocalContentColor will be applied to the icon and down the UI tree.

iconToggleButtonColors

@Composable
fun iconToggleButtonColors(): IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a IconToggleButton. See iconToggleButtonLocalContentColors for default values that applies LocalContentColor to the icon and down the UI tree.

iconToggleButtonColors

@Composable
fun iconToggleButtonColors(
    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 default colors used in a IconToggleButton.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = Color.Unspecified

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = contentColor.copy(alpha = StandardIconButtonTokens.DisabledOpacity)

the content color of this icon button when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this icon button when checked.

checkedContentColor: Color = Color.Unspecified

the content color of this icon button when checked.

iconToggleButtonLocalContentColors

@Composable
fun iconToggleButtonLocalContentColors(): 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.

largeContainerSize

@ExperimentalMaterial3ExpressiveApi
fun largeContainerSize(
    widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize

Default container size for any large icon button.

Parameters
widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform

the width of the container

mediumContainerSize

@ExperimentalMaterial3ExpressiveApi
fun mediumContainerSize(
    widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize

Default container size for any medium icon button.

Parameters
widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform

the width of the container

outlinedIconButtonBorder

@Composable
fun outlinedIconButtonBorder(enabled: Boolean): BorderStroke

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled state.

Parameters
enabled: Boolean

whether the icon button is enabled

outlinedIconButtonColors

@Composable
fun outlinedIconButtonColors(): IconButtonColors

Creates a IconButtonColors that represents the default colors used in a OutlinedIconButton.

See outlinedIconButtonLocalContentColors for default values that applies LocalContentColor to the icon and down the UI tree.

outlinedIconButtonColors

@Composable
fun outlinedIconButtonColors(
    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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = Color.Unspecified

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity)

the content color of this icon button when not enabled.

outlinedIconButtonLocalContentColorBorder

@Composable
fun outlinedIconButtonLocalContentColorBorder(enabled: Boolean): BorderStroke?

outlinedIconButtonLocalContentColors

@Composable
fun outlinedIconButtonLocalContentColors(): 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.

outlinedIconToggleButtonBorder

@Composable
fun outlinedIconToggleButtonBorder(enabled: Boolean, checked: Boolean): BorderStroke?

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state.

Parameters
enabled: Boolean

whether the icon button is enabled

checked: Boolean

whether the icon button is checked

outlinedIconToggleButtonColors

@Composable
fun outlinedIconToggleButtonColors(): IconToggleButtonColors

Creates a IconToggleButtonColors that represents the default colors used in a OutlinedIconToggleButton.

See outlinedIconToggleButtonLocalContentColors for default values that applies LocalContentColor to the icon and down the UI tree.

outlinedIconToggleButtonColors

@Composable
fun outlinedIconToggleButtonColors(
    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.

Parameters
containerColor: Color = Color.Unspecified

the container color of this icon button when enabled.

contentColor: Color = Color.Unspecified

the content color of this icon button when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this icon button when not enabled.

disabledContentColor: Color = contentColor.copy(alpha = OutlinedIconButtonTokens.DisabledOpacity)

the content color of this icon button when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this icon button when checked.

checkedContentColor: Color = contentColorFor(checkedContainerColor)

the content color of this icon button when checked.

outlinedIconToggleButtonLocalContentColorBorder

@Composable
fun outlinedIconToggleButtonLocalContentColorBorder(
    enabled: Boolean,
    checked: Boolean
): BorderStroke?

Represents the BorderStroke for an OutlinedIconButton, depending on its enabled and checked state.

Parameters
enabled: Boolean

whether the icon button is enabled

checked: Boolean

whether the icon button is checked

outlinedIconToggleButtonLocalContentColors

@Composable
fun outlinedIconToggleButtonLocalContentColors(): 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.

shapes

@ExperimentalMaterial3ExpressiveApi
@Composable
fun shapes(shape: Shape, pressedShape: Shape, checkedShape: Shape): IconButtonShapes

Creates a ButtonShapes that correspond to the shapes in the default, pressed, and checked states. Toggle button will morph between these shapes as long as the shapes are all CornerBasedShapes.

Parameters
shape: Shape

the unchecked shape for ButtonShapes

pressedShape: Shape

the unchecked shape for ButtonShapes

checkedShape: Shape

the unchecked shape for ButtonShapes

smallContainerSize

@ExperimentalMaterial3ExpressiveApi
fun smallContainerSize(
    widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize

Default container size for any small icon button.

Parameters
widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform

the width of the container

xLargeContainerSize

@ExperimentalMaterial3ExpressiveApi
fun xLargeContainerSize(
    widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize

Default container size for any extra large icon button.

Parameters
widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform

the width of the container

xSmallContainerSize

@ExperimentalMaterial3ExpressiveApi
fun xSmallContainerSize(
    widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform
): DpSize

Default container size for any extra small icon button.

Parameters
widthOption: IconButtonDefaults.IconButtonWidthOption = IconButtonWidthOption.Uniform

the width of the container

Public properties

filledShape

val filledShapeShape

Default shape for a filled icon button.

largeIconSize

@ExperimentalMaterial3ExpressiveApi
val largeIconSizeDp

Default size for any large icon button.

largePressedShape

@ExperimentalMaterial3ExpressiveApi
val largePressedShapeShape

Default pressed shape for any large icon button.

largeRoundShape

@ExperimentalMaterial3ExpressiveApi
val largeRoundShapeShape

Default shape for any large icon button.

largeSquareShape

@ExperimentalMaterial3ExpressiveApi
val largeSquareShapeShape

Default shape for any large icon button.

mediumIconSize

@ExperimentalMaterial3ExpressiveApi
val mediumIconSizeDp

Default container size for any medium icon button.

mediumPressedShape

@ExperimentalMaterial3ExpressiveApi
val mediumPressedShapeShape

Default pressed shape for any medium icon button.

mediumRoundShape

@ExperimentalMaterial3ExpressiveApi
val mediumRoundShapeShape

Default shape for any medium icon button.

mediumSquareShape

@ExperimentalMaterial3ExpressiveApi
val mediumSquareShapeShape

Default shape for any medium icon button.

outlinedShape

val outlinedShapeShape

Default shape for an outlined icon button.

smallIconSize

@ExperimentalMaterial3ExpressiveApi
val smallIconSizeDp

Default size for any small icon button.

smallPressedShape

@ExperimentalMaterial3ExpressiveApi
val smallPressedShapeShape

Default pressed shape for any small icon button.

smallRoundShape

@ExperimentalMaterial3ExpressiveApi
val smallRoundShapeShape

Default shape for any small icon button.

smallSquareShape

@ExperimentalMaterial3ExpressiveApi
val smallSquareShapeShape

Default shape for any small icon button.

standardShape

val standardShapeShape

Default ripple shape for a standard icon button.

xLargeIconSize

@ExperimentalMaterial3ExpressiveApi
val xLargeIconSizeDp

Default size for any xlarge icon button.

xLargePressedShape

@ExperimentalMaterial3ExpressiveApi
val xLargePressedShapeShape

Default pressed shape for any extra large icon button.

xLargeRoundShape

@ExperimentalMaterial3ExpressiveApi
val xLargeRoundShapeShape

Default shape for any xlarge icon button.

xLargeSquareShape

@ExperimentalMaterial3ExpressiveApi
val xLargeSquareShapeShape

Default shape for any xlarge icon button.

xSmallIconSize

@ExperimentalMaterial3ExpressiveApi
val xSmallIconSizeDp

Default container for any extra small icon button.

xSmallPressedShape

@ExperimentalMaterial3ExpressiveApi
val xSmallPressedShapeShape

Default pressed shape for any extra small icon button.

xSmallRoundShape

@ExperimentalMaterial3ExpressiveApi
val xSmallRoundShapeShape

Default round shape for any extra small icon button.

xSmallSquareShape

@ExperimentalMaterial3ExpressiveApi
val xSmallSquareShapeShape

Default square shape for any extra small icon button.