ToggleButtonDefaults


Contains the default values for all five toggle button types.

Summary

Public functions

ToggleButtonColors

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

Cmn
ToggleButtonColors
@Composable
elevatedToggleButtonColors(
    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 ElevatedToggleButton.

Cmn
ToggleButtonColors

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

Cmn
ToggleButtonColors
@Composable
outlinedToggleButtonColors(
    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 OutlinedToggleButton.

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

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

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
ToggleButtonColors

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

Cmn
ToggleButtonColors
@Composable
tonalToggleButtonColors(
    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 TonalToggleButton.

Cmn

Public properties

PaddingValues

The default content padding used by all toglge 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 checked shape for ElevatedToggleButton

Cmn
Shape

The default pressed shape for ElevatedToggleButton

Cmn
Shape

The default unchecked shape for ElevatedToggleButton

Cmn
Shape

The default checked shape for OutlinedToggleButton

Cmn
Shape

The default pressed shape for OutlinedToggleButton

Cmn
Shape

The default unchecked shape for OutlinedToggleButton

Cmn
Shape

The default pressed shape for ToggleButton

Cmn
Shape

A round shape that can be used for all ToggleButtons and its variants

Cmn
Shape

The default unchecked shape for ToggleButton

Cmn
Shape

A square shape that can be used for all ToggleButtons and its variants

Cmn
Shape

The default checked shape for TonalToggleButton

Cmn
Shape

The default pressed shape for TonalToggleButton

Cmn
Shape

The default unchecked shape for TonalToggleButton

Cmn

Public functions

elevatedToggleButtonColors

@Composable
fun elevatedToggleButtonColors(): ToggleButtonColors

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

elevatedToggleButtonColors

@Composable
fun elevatedToggleButtonColors(
    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: Color = Color.Unspecified

the container color of this ElevatedToggleButton when enabled.

contentColor: Color = Color.Unspecified

the content color of this ElevatedToggleButton when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this ElevatedToggleButton when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this ElevatedToggleButton when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this ElevatedToggleButton when checked.

checkedContentColor: Color = Color.Unspecified

the content color of this ElevatedToggleButton when checked.

outlinedToggleButtonColors

@Composable
fun outlinedToggleButtonColors(): ToggleButtonColors

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

outlinedToggleButtonColors

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

Parameters
containerColor: Color = Color.Unspecified

the container color of this OutlinedToggleButton when enabled.

contentColor: Color = Color.Unspecified

the content color of this OutlinedToggleButton when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this OutlinedToggleButton when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this OutlinedToggleButton when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this OutlinedToggleButton when checked.

checkedContentColor: Color = Color.Unspecified

the content color of this OutlinedToggleButton when checked.

shapes

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

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

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.

tonalToggleButtonColors

@Composable
fun tonalToggleButtonColors(): ToggleButtonColors

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

tonalToggleButtonColors

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

Parameters
containerColor: Color = Color.Unspecified

the container color of this TonalToggleButton when enabled.

contentColor: Color = Color.Unspecified

the content color of this TonalToggleButton when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this TonalToggleButton when not enabled.

disabledContentColor: Color = Color.Unspecified

the content color of this TonalToggleButton when not enabled.

checkedContainerColor: Color = Color.Unspecified

the container color of this TonalToggleButton when checked.

checkedContentColor: Color = Color.Unspecified

the content color of this TonalToggleButton when checked.

Public properties

ContentPadding

val ContentPaddingPaddingValues

The default content padding used by all toglge 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

elevatedCheckedShape

val elevatedCheckedShapeShape

The default checked shape for ElevatedToggleButton

elevatedPressedShape

val elevatedPressedShapeShape

The default pressed shape for ElevatedToggleButton

elevatedShape

val elevatedShapeShape

The default unchecked shape for ElevatedToggleButton

outlinedCheckedShape

val outlinedCheckedShapeShape

The default checked shape for OutlinedToggleButton

outlinedPressedShape

val outlinedPressedShapeShape

The default pressed shape for OutlinedToggleButton

outlinedShape

val outlinedShapeShape

The default unchecked shape for OutlinedToggleButton

pressedShape

val pressedShapeShape

The default pressed shape for ToggleButton

roundShape

val roundShapeShape

A round shape that can be used for all ToggleButtons and its variants

shape

val shapeShape

The default unchecked shape for ToggleButton

squareShape

val squareShapeShape

A square shape that can be used for all ToggleButtons and its variants

tonalCheckedShape

val tonalCheckedShapeShape

The default checked shape for TonalToggleButton

tonalPressedShape

val tonalPressedShapeShape

The default pressed shape for TonalToggleButton

tonalShape

val tonalShapeShape

The default unchecked shape for TonalToggleButton