OutlinedButtonDefaults


@ExperimentalTvMaterial3Api
object OutlinedButtonDefaults


Summary

Public functions

ButtonBorder
@Composable
border(
    border: Border,
    focusedBorder: Border,
    pressedBorder: Border,
    disabledBorder: Border,
    focusedDisabledBorder: Border
)

Creates a ButtonBorder that represents the default Borders applied on an OutlinedButton in different Interaction states.

ButtonColors
@Composable
colors(
    containerColor: Color,
    contentColor: Color,
    focusedContainerColor: Color,
    focusedContentColor: Color,
    pressedContainerColor: Color,
    pressedContentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

Creates a ButtonColors that represents the default colors used in a OutlinedButton.

ButtonGlow
glow(glow: Glow, focusedGlow: Glow, pressedGlow: Glow)

Creates a ButtonGlow that represents the default Glows used in an OutlinedButton.

ButtonScale
scale(
    scale: @FloatRange(from = 0.0) Float,
    focusedScale: @FloatRange(from = 0.0) Float,
    pressedScale: @FloatRange(from = 0.0) Float,
    disabledScale: @FloatRange(from = 0.0) Float,
    focusedDisabledScale: @FloatRange(from = 0.0) Float
)

Creates a ButtonScale that represents the default scales used in an OutlinedButton. scales are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc.

ButtonShape
shape(
    shape: Shape,
    focusedShape: Shape,
    pressedShape: Shape,
    disabledShape: Shape,
    focusedDisabledShape: Shape
)

Creates a ButtonShape that represents the default container shapes used in an OutlinedButton.

Public properties

PaddingValues

The default content padding used by OutlinedButton that contains an Icon.

PaddingValues
Dp

The default size of the icon when used inside any button.

Dp

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

Public functions

border

Added in 1.0.0-alpha10
@Composable
fun border(
    border: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.4f) ), shape = ContainerShape ),
    focusedBorder: Border = Border( border = BorderStroke( width = 1.65.dp, color = MaterialTheme.colorScheme.onSurfaceVariant ), shape = ContainerShape ),
    pressedBorder: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant ), shape = ContainerShape ),
    disabledBorder: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.2f) ), shape = ContainerShape ),
    focusedDisabledBorder: Border = disabledBorder
): ButtonBorder

Creates a ButtonBorder that represents the default Borders applied on an OutlinedButton in different Interaction states.

Parameters
border: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.4f) ), shape = ContainerShape )

the Border to be used for this Button when enabled

focusedBorder: Border = Border( border = BorderStroke( width = 1.65.dp, color = MaterialTheme.colorScheme.onSurfaceVariant ), shape = ContainerShape )

the Border to be used for this Button when focused

pressedBorder: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant ), shape = ContainerShape )

the Border to be used for this Button when pressed

disabledBorder: Border = Border( border = BorderStroke( width = 1.5.dp, color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.2f) ), shape = ContainerShape )

the Border to be used for this Button when disabled

focusedDisabledBorder: Border = disabledBorder

the Border to be used for this Button when disabled and focused

colors

@Composable
fun colors(
    containerColor: Color = Color.Transparent,
    contentColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.8f),
    focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface,
    focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface,
    pressedContainerColor: Color = focusedContainerColor,
    pressedContentColor: Color = focusedContentColor,
    disabledContainerColor: Color = containerColor,
    disabledContentColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.4f)
): ButtonColors

Creates a ButtonColors that represents the default colors used in a OutlinedButton.

Parameters
containerColor: Color = Color.Transparent

the container color of this Button when enabled

contentColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.8f)

the content color of this Button when enabled

focusedContainerColor: Color = MaterialTheme.colorScheme.onSurface

the container color of this Button when enabled and focused

focusedContentColor: Color = MaterialTheme.colorScheme.inverseOnSurface

the content color of this Button when enabled and focused

pressedContainerColor: Color = focusedContainerColor

the container color of this Button when enabled and pressed

pressedContentColor: Color = focusedContentColor

the content color of this Button when enabled and pressed

disabledContainerColor: Color = containerColor

the container color of this Button when not enabled

disabledContentColor: Color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.4f)

the content color of this Button when not enabled

glow

Added in 1.0.0-alpha10
fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow): ButtonGlow

Creates a ButtonGlow that represents the default Glows used in an OutlinedButton.

Parameters
glow: Glow = Glow.None

the Glow behind this Button when enabled

focusedGlow: Glow = glow

the Glow behind this Button when focused

pressedGlow: Glow = glow

the Glow behind this Button when pressed

scale

Added in 1.0.0-alpha10
fun scale(
    scale: @FloatRange(from = 0.0) Float = 1.0f,
    focusedScale: @FloatRange(from = 0.0) Float = 1.1f,
    pressedScale: @FloatRange(from = 0.0) Float = scale,
    disabledScale: @FloatRange(from = 0.0) Float = scale,
    focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale
): ButtonScale

Creates a ButtonScale that represents the default scales used in an OutlinedButton. scales are used to modify the size of a composable in different Interaction states e.g. 1f (original) in default state, 1.2f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc.

Parameters
scale: @FloatRange(from = 0.0) Float = 1.0f

the scale to be used for this Button when enabled

focusedScale: @FloatRange(from = 0.0) Float = 1.1f

the scale to be used for this Button when focused

pressedScale: @FloatRange(from = 0.0) Float = scale

the scale to be used for this Button when pressed

disabledScale: @FloatRange(from = 0.0) Float = scale

the scale to be used for this Button when disabled

focusedDisabledScale: @FloatRange(from = 0.0) Float = disabledScale

the scale to be used for this Button when disabled and focused

shape

Added in 1.0.0-alpha10
fun shape(
    shape: Shape = ContainerShape,
    focusedShape: Shape = shape,
    pressedShape: Shape = shape,
    disabledShape: Shape = shape,
    focusedDisabledShape: Shape = disabledShape
): ButtonShape

Creates a ButtonShape that represents the default container shapes used in an OutlinedButton.

Parameters
shape: Shape = ContainerShape

the shape used when the Button is enabled, and has no other Interactions.

focusedShape: Shape = shape

the shape used when the Button is enabled and focused.

pressedShape: Shape = shape

the shape used when the Button is enabled pressed.

disabledShape: Shape = shape

the shape used when the Button is not enabled.

focusedDisabledShape: Shape = disabledShape

the shape used when the Button is not enabled and focused.

Public properties

ButtonWithIconContentPadding

Added in 1.0.0-alpha10
val ButtonWithIconContentPaddingPaddingValues

The default content padding used by OutlinedButton that contains an Icon.

ContentPadding

Added in 1.0.0-alpha10
val ContentPaddingPaddingValues

IconSize

Added in 1.0.0-alpha10
val IconSizeDp

The default size of the icon when used inside any button.

IconSpacing

Added in 1.0.0-alpha10
val IconSpacingDp

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