Object

IconToggleButtonDefaults

Contains the default values used by IconToggleButton.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
public object IconToggleButtonDefaults

Contains the default values used by IconToggleButton.

Functions

iconSizeFor

public fun iconSizeFor(buttonSize: Dp): Dp

Recommended icon size for a given icon toggle button size.

Ensures that the minimum recommended icon size is applied.

Examples: for size SmallSize, returns SmallIconSize, for size ExtraLargeSize returns ExtraLargeIconSize.

Parameters

buttonSize The size of the icon toggle button

shapes

@Composable
public fun shapes(): IconToggleButtonShapes

Returns the default IconToggleButtonShapes for a static IconToggleButton.


shapes

@Composable
public fun shapes(shape: Shape): IconToggleButtonShapes

Returns an IconToggleButtonShapes for an IconToggleButton with a static shape.

Parameters

shape The normal shape of the IconToggleButton.

animatedShapes

@Composable
public fun animatedShapes(): IconToggleButtonShapes

Returns the default IconToggleButtonShapes with an animation between two CornerBasedShapes when pressed.

A simple icon toggle button using the default colors, animated when pressed.


animatedShapes

@Composable
public fun animatedShapes(
    shape: CornerBasedShape? = null,
    pressedShape: CornerBasedShape? = null,
): IconToggleButtonShapes

Returns an IconToggleButtonShapes for an IconToggleButton with an animation between two CornerBasedShapes.

A simple icon toggle button using the default colors, animated when pressed.

Parameters

shape The normal shape of the IconToggleButton when unpressed - if null, the default IconToggleButtonDefaults.shape is used.
pressedShape The pressed shape of the IconToggleButton - if null, the default IconToggleButtonDefaults.pressedShape is used.

variantAnimatedShapes

@Composable
public fun variantAnimatedShapes(): IconToggleButtonShapes

Returns the default IconToggleButtonShapes with an animation between three CornerSizes based on the pressed state and checked/unchecked.

A simple icon toggle button using the default colors, animated on Press and Check/Uncheck:


variantAnimatedShapes

@Composable
public fun variantAnimatedShapes(
    uncheckedShape: CornerBasedShape? = null,
    checkedShape: CornerBasedShape? = null,
): IconToggleButtonShapes

Returns an IconToggleButtonShapes with an animation between three CornerSizes based on the pressed state and checked/unchecked.

A simple icon toggle button using the default colors, animated on Press and Check/Uncheck:

Parameters

uncheckedShape the unchecked shape - if null, the default IconToggleButtonDefaults.shape is used.
checkedShape the checked shape - if null, the default IconToggleButtonDefaults.checkedShape is used.

colors

@Composable
public fun colors(): IconToggleButtonColors

Returns an IconToggleButtonColors for a IconToggleButton

  • by default, a colored background with a contrasting content color.

If the button is disabled, then the colors will have an alpha (DisabledContentAlpha and DisabledContainerAlpha) value applied.


colors

@Composable
public fun colors(
    checkedContainerColor: Color = Color.Unspecified,
    checkedContentColor: Color = Color.Unspecified,
    uncheckedContainerColor: Color = Color.Unspecified,
    uncheckedContentColor: Color = Color.Unspecified,
    disabledCheckedContainerColor: Color = Color.Unspecified,
    disabledCheckedContentColor: Color = Color.Unspecified,
    disabledUncheckedContainerColor: Color = Color.Unspecified,
    disabledUncheckedContentColor: Color = Color.Unspecified,
): IconToggleButtonColors

Returns an IconToggleButtonColors for a IconToggleButton

  • by default, a colored background with a contrasting content color.

If the button is disabled, then the colors will have an alpha (DisabledContentAlpha and DisabledContainerAlpha) value applied.

Parameters

checkedContainerColor The container color of this IconToggleButton when enabled and checked
checkedContentColor The content color of this IconToggleButton when enabled and checked
uncheckedContainerColor The container color of this IconToggleButton when enabled and unchecked
uncheckedContentColor The content color of this IconToggleButton when enabled and unchecked
disabledCheckedContainerColor The container color of this IconToggleButton when checked and not enabled
disabledCheckedContentColor The content color of this IconToggleButton when checked and not enabled
disabledUncheckedContainerColor The container color of this IconToggleButton when unchecked and not enabled
disabledUncheckedContentColor The content color of this IconToggleButton when unchecked and not enabled