Object

ElevatedToggleButtonDefaults

Contains default values used by ElevatedToggleButton.

Source set: Common
public object ElevatedToggleButtonDefaults

Contains default values used by ElevatedToggleButton.

Properties

size

Source set: Common
public val size: ToggleButtonSize = ToggleButtonDefaults.size

The default ToggleButtonSize of an ElevatedToggleButton.

MinHeight

Source set: Common
public val MinHeight: Dp = ToggleButtonDefaults.MinHeight

The default min height applied for ElevatedToggleButton.

Override it by applying Modifier.heightIn directly on the toggle button composable.

IconSpacing

Source set: Common
public val IconSpacing: Dp = ToggleButtonDefaults.IconSpacing

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

IconSize

Source set: Common
public val IconSize: Dp = ToggleButtonDefaults.IconSize

The default size of an icon when used inside an ElevatedToggleButton.

shape

Source set: Common
public val shape: Shape

The default unchecked shape for ElevatedToggleButton

pressedShape

Source set: Common
public val pressedShape: Shape

The default pressed shape for ElevatedToggleButton

checkedShape

Source set: Common
public val checkedShape: Shape

The default checked shape for ElevatedToggleButton

Functions

contentPaddingFor

Source set: Common
public fun contentPaddingFor(
        buttonHeight: Dp,
        hasStartIcon: Boolean = false,
        hasEndIcon: Boolean = false,
    ): PaddingValues

Recommended PaddingValues for a provided toggle button height.

The returned content padding is based on standard container height values and is not directly interpolated from the provided buttonHeight.

Parameters

buttonHeight the height of the toggle button
hasStartIcon whether the toggle button has a leading icon
hasEndIcon whether the toggle button has a trailing icon

contentPaddingFor

Source set: Common
public fun contentPaddingFor(
        buttonSize: ToggleButtonSize,
        hasStartIcon: Boolean = false,
        hasEndIcon: Boolean = false,
    ): PaddingValues

Recommended PaddingValues for a provided buttonSize.

Parameters

buttonSize the ToggleButtonSize of the toggle button
hasStartIcon whether the toggle button has a leading icon
hasEndIcon whether the toggle button has a trailing icon

shapesFor

Source set: Common
@Composable
    public fun shapesFor(buttonHeight: Dp): ToggleButtonShapes

Resolves the recommended ToggleButtonShapes for a given toggle button height.

The input height is categorized into a shape bucket (such as extra small, small, medium, large, or extra large) based on the closest standard button height.

Parameters

buttonHeight height of the button used to resolve the shape bucket

shapesFor

Source set: Common
@Composable
    public fun shapesFor(buttonSize: ToggleButtonSize): ToggleButtonShapes

Resolves the recommended ToggleButtonShapes for a given buttonSize.

Parameters

buttonSize ToggleButtonSize used to resolve the shape bucket

colors

Source set: Common
@Composable
    public fun colors(): ToggleButtonColors

Creates a ToggleButtonColors that represents the default container and content colors used in a ElevatedToggleButton.

colors

Source set: Common
@Composable
    public fun colors(
        containerColor: Color = Color.Unspecified,
        contentColor: Color = Color.Unspecified,
        disabledContainerColor: Color = Color.Unspecified,
        disabledContentColor: Color = Color.Unspecified,
        checkedContainerColor: Color = Color.Unspecified,
        checkedContentColor: Color = Color.Unspecified,
    ): ToggleButtonColors

Creates a ToggleButtonColors that represents the default container and content colors used in a ElevatedToggleButton.

Parameters

containerColor the container color of this ElevatedToggleButton when enabled.
contentColor the content color of this ElevatedToggleButton when enabled.
disabledContainerColor the container color of this ElevatedToggleButton when not enabled.
disabledContentColor the content color of this ElevatedToggleButton when not enabled.
checkedContainerColor the container color of this ElevatedToggleButton when checked.
checkedContentColor the content color of this ElevatedToggleButton when checked.

elevation

Source set: Common
@Composable
    public fun elevation(
        defaultElevation: Dp = ElevatedButtonTokens.ContainerElevation,
        pressedElevation: Dp = ElevatedButtonTokens.PressedContainerElevation,
        focusedElevation: Dp = ElevatedButtonTokens.FocusedContainerElevation,
        hoveredElevation: Dp = ElevatedButtonTokens.HoveredContainerElevation,
        disabledElevation: Dp = ElevatedButtonTokens.DisabledContainerElevation,
    ): ToggleButtonElevation

Creates a ToggleButtonElevation that will animate between the provided values according to the Material specification for an ElevatedToggleButton.

Parameters

defaultElevation the elevation used when the ElevatedToggleButton is enabled, and has no other Interactions.
pressedElevation the elevation used when this ElevatedToggleButton is enabled and pressed.
focusedElevation the elevation used when the ElevatedToggleButton is enabled and focused.
hoveredElevation the elevation used when the ElevatedToggleButton is enabled and hovered.
disabledElevation the elevation used when the ElevatedToggleButton is not enabled.

Content updated: