androidx.compose.material3
ToggleButtonDefaultsSince 1.10
Object
No hand-written docs yet.
Contains the default values for all five toggle button types.
object ToggleButtonDefaults
Properties
MinHeight
val MinHeight: Dp
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
val IconSpacing: Dp
The default size of the spacing between an icon and a text when they used inside any toggle button.
IconSize
val IconSize: Dp
The default size of the spacing between an icon and a text when they used inside any toggle button.
ContentPadding
val ContentPadding: PaddingValues
The default content padding used by all toggle buttons.
roundShape
@Composable val roundShape: Shape
A round shape that can be used for all ToggleButtons and its variants
squareShape
@Composable val squareShape: Shape
A square shape that can be used for all ToggleButtons and its variants
shape
@Composable val shape: Shape
The default unchecked shape for ToggleButton
pressedShape
@Composable val pressedShape: Shape
The default pressed shape for ToggleButton
checkedShape
@Composable val checkedShape: Shape
The default checked shape for ToggleButton
extraSmallSquareShape
@Composable val extraSmallSquareShape: Shape
The default square shape for a extra small toggle button
mediumSquareShape
@Composable val mediumSquareShape: Shape
The default square shape for a medium toggle button
largeSquareShape
@Composable val largeSquareShape: Shape
The default square shape for a large toggle button
extraLargeSquareShape
@Composable val extraLargeSquareShape: Shape
The default square shape for a extra large toggle button
extraSmallPressedShape
@Composable val extraSmallPressedShape: Shape
The default pressed shape for a extra small toggle button
mediumPressedShape
@Composable val mediumPressedShape: Shape
The default pressed shape for a medium toggle button
largePressedShape
@Composable val largePressedShape: Shape
The default pressed shape for a large toggle button
extraLargePressedShape
@Composable val extraLargePressedShape: Shape
The default pressed shape for a extra large toggle button
extraSmallCheckedSquareShape
@Composable val extraSmallCheckedSquareShape: Shape
The default checked square shape for a extra small toggle button
mediumCheckedSquareShape
@Composable val mediumCheckedSquareShape: Shape
The default checked square shape for a medium toggle button
largeCheckedSquareShape
@Composable val largeCheckedSquareShape: Shape
The default checked square shape for a large toggle button
extraLargeCheckedSquareShape
@Composable val extraLargeCheckedSquareShape: Shape
The default checked square shape for a extra large toggle button
Functions
shapes
@Composable
fun shapes(): ToggleButtonShapes
Creates a ToggleButtonShapes that represents the default shape, pressedShape, and checkedShape used in a ToggleButton.
@Composable
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.
toggleButtonColors
@Composable
fun toggleButtonColors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a ToggleButton.
@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.
elevatedToggleButtonColors
@Composable
fun elevatedToggleButtonColors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a ElevatedToggleButton.
@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.
tonalToggleButtonColors
@Composable
fun tonalToggleButtonColors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a TonalToggleButton.
@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.
outlinedToggleButtonColors
@Composable
fun outlinedToggleButtonColors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a OutlinedToggleButton.
@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.
shapesFor
@Composable
fun shapesFor(buttonHeight: Dp): ToggleButtonShapes
Recommended ToggleButtonShapes for a provided toggle button height.
Library docs
Contains the default values for all five toggle button types.