public object OutlinedToggleButtonDefaults
Contains default values used by OutlinedToggleButton.
Properties
size
public val size: ToggleButtonSize = ToggleButtonDefaults.size
The default ToggleButtonSize of an OutlinedToggleButton.
MinHeight
public val MinHeight: Dp = ToggleButtonDefaults.MinHeight
The default min height applied for OutlinedToggleButton.
Override it by applying Modifier.heightIn directly on the toggle button composable.
IconSpacing
public val IconSpacing: Dp = ToggleButtonDefaults.IconSpacing
The default size of the spacing between an icon and a text when they are used inside an OutlinedToggleButton.
IconSize
public val IconSize: Dp = ToggleButtonDefaults.IconSize
The default size of an icon when used inside an OutlinedToggleButton.
shape
public val shape: Shape
The default unchecked shape for OutlinedToggleButton
pressedShape
public val pressedShape: Shape
The default pressed shape for OutlinedToggleButton
checkedShape
public val checkedShape: Shape
The default checked shape for OutlinedToggleButton
Functions
contentPaddingFor
public fun contentPaddingFor(
buttonHeight: Dp,
hasStartIcon: Boolean = false,
hasEndIcon: Boolean = false,
): PaddingValues
Recommended PaddingValues for a provided toggle button height.
The returned content padding is based on standard container height values and is not directly interpolated from the provided buttonHeight.
Parameters
| buttonHeight | the height of the toggle button |
| hasStartIcon | whether the toggle button has a leading icon |
| hasEndIcon | whether the toggle button has a trailing icon |
contentPaddingFor
public fun contentPaddingFor(
buttonSize: ToggleButtonSize,
hasStartIcon: Boolean = false,
hasEndIcon: Boolean = false,
): PaddingValues
Recommended PaddingValues for a provided buttonSize.
Parameters
| buttonSize | the ToggleButtonSize of the toggle button |
| hasStartIcon | whether the toggle button has a leading icon |
| hasEndIcon | whether the toggle button has a trailing icon |
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 |
shapesFor
@Composable
public fun shapesFor(buttonSize: ToggleButtonSize): ToggleButtonShapes
Resolves the recommended ToggleButtonShapes for a given buttonSize.
Parameters
| buttonSize | ToggleButtonSize used to resolve the shape bucket |
colors
@Composable
public fun colors(): ToggleButtonColors
Creates a ToggleButtonColors that represents the default container and content colors used in a OutlinedToggleButton.
colors
@Composable
public fun colors(
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 | the container color of this OutlinedToggleButton when enabled. |
| contentColor | the content color of this OutlinedToggleButton when enabled. |
| disabledContainerColor | the container color of this OutlinedToggleButton when not enabled. |
| disabledContentColor | the content color of this OutlinedToggleButton when not enabled. |
| checkedContainerColor | the container color of this OutlinedToggleButton when checked. |
| checkedContentColor | the content color of this OutlinedToggleButton when checked. |
border
@Composable
public fun border(enabled: Boolean, checked: Boolean): BorderStroke?
Resolves the default BorderStroke used in an OutlinedToggleButton.
Parameters
| enabled | controls the enabled state of the button |
| checked | controls the checked state of the button |