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

Creates a ButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton.

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

Creates a ButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton and its variants.

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

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(): ButtonShapes

Creates a ButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton.

shapes

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

Creates a ButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton and its variants.

Parameters
shape: Shape? = null

the unchecked shape for ButtonShapes

pressedShape: Shape? = null

the unchecked shape for ButtonShapes

checkedShape: Shape? = null

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

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