ToggleButtonDefaults


Contains the default values for all five toggle button types.

Summary

Public functions

ToggleButtonShapes
@Composable
shapesFor(buttonHeight: Dp)

Resolves the recommended ToggleButtonShapes for a given toggle button height.

Cmn
ToggleButtonColors

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

Cmn
ToggleButtonColors
@Composable
toggleButtonColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color,
    checkedContainerColor: Color,
    checkedContentColor: Color
)

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

Cmn

Public properties

PaddingValues

The default content padding used by all toggle buttons.

Cmn
Dp

The default size of the spacing between an icon and a text when they used inside any toggle button.

Cmn
Dp

The default size of the spacing between an icon and a text when they used inside any toggle button.

Cmn
Dp

The default min height applied for all toggle buttons.

Cmn
Shape

The default checked shape for ToggleButton

Cmn
Shape

The default pressed shape for ToggleButton

Cmn
Shape

The default unchecked shape for ToggleButton

Cmn

Public functions

shapesFor

@Composable
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: Dp

height of the button used to resolve the shape bucket

toggleButtonColors

@Composable
fun toggleButtonColors(): ToggleButtonColors

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

toggleButtonColors

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

Parameters
containerColor: Color = Color.Unspecified

the container color of this ToggleButton when enabled.

contentColor: Color = Color.Unspecified

the content color of this ToggleButton when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this ToggleButton when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this ToggleButton when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this ToggleButton when checked.

checkedContentColor: Color = Color.Unspecified

the content color of this ToggleButton when checked.

Public properties

ContentPadding

val ContentPaddingPaddingValues

The default content padding used by all toggle buttons.

IconSize

val IconSizeDp

The default size of the spacing between an icon and a text when they used inside any toggle button.

IconSpacing

val IconSpacingDp

The default size of the spacing between an icon and a text when they used inside any toggle button.

MinHeight

val MinHeightDp

The default min height applied for all toggle buttons. Note that you can override it by applying Modifier.heightIn directly on the toggle button composable.

checkedShape

val checkedShapeShape

The default checked shape for ToggleButton

pressedShape

val pressedShapeShape

The default pressed shape for ToggleButton

shape

val shapeShape

The default unchecked shape for ToggleButton