public object ToggleButtonDefaults
Contains the default values for all five toggle button types.
Properties
MinHeight
public val MinHeight: Dp = ButtonSmallTokens.ContainerHeight
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.
IconSpacing
public val IconSpacing: Dp = ButtonSmallTokens.IconLabelSpace
The default size of the spacing between an icon and a text when they used inside any toggle button.
IconSize
public val IconSize: Dp = ButtonSmallTokens.IconSize
The default size of the spacing between an icon and a text when they used inside any toggle button.
ContentPadding
public val ContentPadding: PaddingValues =
PaddingValues(
start = ToggleButtonStartPadding,
top = ButtonVerticalPadding,
end = ToggleButtonEndPadding,
bottom = ButtonVerticalPadding,
)
The default content padding used by all toggle buttons.
shape
public val shape: Shape
The default unchecked shape for ToggleButton
pressedShape
public val pressedShape: Shape
The default pressed shape for ToggleButton
checkedShape
public val checkedShape: Shape
The default checked shape for ToggleButton
Functions
shapes
@Deprecated(
"Maintained for binary compatibility.",
replaceWith = ReplaceWith("ToggleButtonShapes()"),
level = DeprecationLevel.HIDDEN,
)
@Composable
public fun shapes(): ToggleButtonShapes
Creates a ToggleButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton.
shapes
@Deprecated(
"Maintained for binary compatibility.",
replaceWith = ReplaceWith("ToggleButtonShapes(shape, pressedShape, checkedShape)"),
level = DeprecationLevel.HIDDEN,
)
@Composable
public fun shapes(
shape: Shape? = null,
pressedShape: Shape? = null,
checkedShape: Shape? = null,
): ToggleButtonShapes
Creates a ToggleButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton and its variants.
Parameters
| shape | the unchecked shape for ToggleButtonShapes |
| pressedShape | the unchecked shape for ToggleButtonShapes |
| checkedShape | the unchecked shape for ToggleButtonShapes |
toggleButtonColors
@Composable
public fun toggleButtonColors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a ToggleButton.
toggleButtonColors
@Composable
public 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 | the container color of this ToggleButton when enabled. |
| contentColor | the content color of this ToggleButton when enabled. |
| disabledContainerColor | the container color of this ToggleButton when not enabled. |
| disabledContentColor | the content color of this ToggleButton when not enabled. |
| checkedContainerColor | the container color of this ToggleButton when checked. |
| checkedContentColor | the content color of this ToggleButton when checked. |
elevatedToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun elevatedToggleButtonColors(): ToggleButtonColors
elevatedToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public 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
tonalToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun tonalToggleButtonColors(): ToggleButtonColors
tonalToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public 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
filledTonalToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun filledTonalToggleButtonColors(): ToggleButtonColors
filledTonalToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun filledTonalToggleButtonColors(
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
outlinedToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun outlinedToggleButtonColors(): ToggleButtonColors
outlinedToggleButtonColors
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public 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
outlinedToggleButtonBorder
@Deprecated("Maintained for binary compatibility.", level = DeprecationLevel.HIDDEN)
@Composable
public fun outlinedToggleButtonBorder(enabled: Boolean, checked: Boolean): BorderStroke?
shapesFor
@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 |