androidx.compose.material3

OutlinedCard

Composable function

One of the card types. It works like Card. Only the parameters that differ are described here.

A card with an outline and no shadow.

An outlined card
An outlined card
OutlinedCard(Modifier.size(240.dp, 100.dp)) {
    Text("Outlined card", Modifier.padding(16.dp))
}

Basic

Not clickable. Use it to group content.

@Composable
fun OutlinedCard(
    modifier: Modifier = Modifier,
    shape: Shape = CardDefaults.outlinedShape,
    colors: CardColors = CardDefaults.outlinedCardColors(),
    elevation: CardElevation = CardDefaults.outlinedCardElevation(),
    border: BorderStroke = CardDefaults.outlinedCardBorder(),
    content: @Composable ColumnScope.() -> Unit,
)

border: BorderStrokeOptional

Default: CardDefaults.outlinedCardBorder()

Draws an outline. null means no outline. OutlinedCard has one by default.

A colored outline
A colored outline
Card(
    border = BorderStroke(2.dp, MaterialTheme.colorScheme.primary),
    modifier = Modifier.width(280.dp),
) {
    Text("Selected plan", Modifier.padding(16.dp))
}

Defaults that differ from Card:

Same as in Card: modifier, shape, colors, elevation, content.

Clickable

Takes onClick. The whole card reacts to clicks.

@Composable
fun OutlinedCard(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    shape: Shape = CardDefaults.outlinedShape,
    colors: CardColors = CardDefaults.outlinedCardColors(),
    elevation: CardElevation = CardDefaults.outlinedCardElevation(),
    border: BorderStroke = CardDefaults.outlinedCardBorder(enabled),
    interactionSource: MutableInteractionSource? = null,
    content: @Composable ColumnScope.() -> Unit,
)

Defaults that differ from Card:

Same as in Card: onClick, modifier, enabled, shape, colors, elevation, interactionSource, content.

Same as above: border.

Card types

See also