androidx.compose.material3

OutlinedButton

Composable function

One of the button types. It works like Button. Only the parameters that differ are described here.

A button with only an outline. Use it for secondary actions, like "Cancel" next to "Save".

An outlined button
An outlined button
OutlinedButton(onClick = {}) { Text("Cancel") }

Basic

Takes one shape.

@Composable
fun OutlinedButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shape: Shape = ButtonDefaults.outlinedShape,
    colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
    elevation: ButtonElevation? = null,
    border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled),
    contentPadding: PaddingValues = ButtonDefaults.ContentPadding,
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit,
)

Defaults that differ from Button:

Same as in Button: onClick, modifier, enabled, shape, colors, elevation, border, contentPadding, interactionSource, content.

ExpressiveSince 1.10

Takes shapes: one shape at rest and one while pressed. The button morphs between them.

@Composable
fun OutlinedButton(
    onClick: () -> Unit,
    shapes: ButtonShapes,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    colors: ButtonColors = ButtonDefaults.outlinedButtonColors(),
    elevation: ButtonElevation? = null,
    border: BorderStroke? = ButtonDefaults.outlinedButtonBorder(enabled),
    contentPadding: PaddingValues = ButtonDefaults.contentPaddingFor(ButtonDefaults.MinHeight),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable RowScope.() -> Unit,
)

Defaults that differ from Button:

Same as in Button: onClick, shapes, modifier, enabled, colors, elevation, border, contentPadding, interactionSource, content.

Button types

See also