OutlinedToggleButtonDefaults


Contains default values used by OutlinedToggleButton.

Summary

Public functions

BorderStroke?
@Composable
border(enabled: Boolean, checked: Boolean)

Resolves the default BorderStroke used in an OutlinedToggleButton.

Cmn
ToggleButtonColors

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

Cmn
ToggleButtonColors
@Composable
colors(
    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
PaddingValues
contentPaddingFor(
    buttonHeight: Dp,
    hasStartIcon: Boolean,
    hasEndIcon: Boolean
)

Recommended PaddingValues for a provided toggle button height.

Cmn
PaddingValues
contentPaddingFor(
    buttonSize: ToggleButtonSize,
    hasStartIcon: Boolean,
    hasEndIcon: Boolean
)

Recommended PaddingValues for a provided buttonSize.

Cmn
ToggleButtonShapes
@Composable
shapesFor(buttonHeight: Dp)

Resolves the recommended ToggleButtonShapes for a given toggle button height.

Cmn
ToggleButtonShapes

Resolves the recommended ToggleButtonShapes for a given buttonSize.

Cmn

Public properties

Dp

The default size of an icon when used inside an OutlinedToggleButton.

Cmn
Dp

The default size of the spacing between an icon and a text when they are used inside an OutlinedToggleButton.

Cmn
Dp

The default min height applied for OutlinedToggleButton.

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
ToggleButtonSize

The default ToggleButtonSize of an OutlinedToggleButton.

Cmn

Public functions

border

@Composable
fun border(enabled: Boolean, checked: Boolean): BorderStroke?

Resolves the default BorderStroke used in an OutlinedToggleButton.

Parameters
enabled: Boolean

controls the enabled state of the button

checked: Boolean

controls the checked state of the button

colors

@Composable
fun colors(): ToggleButtonColors

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

colors

@Composable
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: 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.

contentPaddingFor

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

the height of the toggle button

hasStartIcon: Boolean = false

whether the toggle button has a leading icon

hasEndIcon: Boolean = false

whether the toggle button has a trailing icon

contentPaddingFor

fun contentPaddingFor(
    buttonSize: ToggleButtonSize,
    hasStartIcon: Boolean = false,
    hasEndIcon: Boolean = false
): PaddingValues

Recommended PaddingValues for a provided buttonSize.

Parameters
buttonSize: ToggleButtonSize

the ToggleButtonSize of the toggle button

hasStartIcon: Boolean = false

whether the toggle button has a leading icon

hasEndIcon: Boolean = false

whether the toggle button has a trailing icon

shapesFor

@Composable
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: Dp

height of the button used to resolve the shape bucket

shapesFor

@Composable
fun shapesFor(buttonSize: ToggleButtonSize): ToggleButtonShapes

Resolves the recommended ToggleButtonShapes for a given buttonSize.

Parameters
buttonSize: ToggleButtonSize

ToggleButtonSize used to resolve the shape bucket

Public properties

IconSize

val IconSizeDp

The default size of an icon when used inside an OutlinedToggleButton.

IconSpacing

val IconSpacingDp

The default size of the spacing between an icon and a text when they are used inside an OutlinedToggleButton.

MinHeight

val MinHeightDp

The default min height applied for OutlinedToggleButton.

Override it by applying Modifier.heightIn directly on the toggle button composable.

checkedShape

val checkedShapeShape

The default checked shape for OutlinedToggleButton

pressedShape

val pressedShapeShape

The default pressed shape for OutlinedToggleButton

shape

val shapeShape

The default unchecked shape for OutlinedToggleButton

size

val sizeToggleButtonSize

The default ToggleButtonSize of an OutlinedToggleButton.