OutlinedCard

Outlined Wear Material 3 Card that offers a single slot to take any content.

Android
@Composable
public fun OutlinedCard(
    modifier: Modifier = Modifier,
    shape: Shape = CardDefaults.shape,
    colors: CardColors = CardDefaults.outlinedCardColors(),
    border: BorderStroke = CardDefaults.outlinedCardBorder(),
    contentPadding: PaddingValues = CardDefaults.ContentPadding,
    transformation: SurfaceTransformation? = null,
    content: @Composable ColumnScope.() -> Unit,
)

Parameters

modifier Modifier to be applied to the card
shape Defines the card's shape. It is strongly recommended to use the default as this shape is a key characteristic of the Wear Material Theme
colors CardColors that will be used to resolve the colors used for this card. See CardDefaults.cardColors.
border A BorderStroke object which is used for the outline drawing.
contentPadding The spacing values to apply internally between the container and the content
transformation Transformation to be used when card appears inside a container that needs to dynamically change its content separately from the background.
content The main slot for a content of this card
Android
@Composable
public fun OutlinedCard(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    onLongClick: (() -> Unit)? = null,
    onLongClickLabel: String? = null,
    enabled: Boolean = true,
    shape: Shape = CardDefaults.shape,
    colors: CardColors = CardDefaults.outlinedCardColors(),
    border: BorderStroke = CardDefaults.outlinedCardBorder(),
    contentPadding: PaddingValues = CardDefaults.ContentPadding,
    interactionSource: MutableInteractionSource? = null,
    transformation: SurfaceTransformation? = null,
    content: @Composable ColumnScope.() -> Unit,
)

Parameters

onClick Will be called when the user clicks the card
modifier Modifier to be applied to the card
onLongClick Called when this card is long clicked (long-pressed). When this callback is set, onLongClickLabel should be set as well.
onLongClickLabel Semantic / accessibility label for the onLongClick action.
enabled Controls the enabled state of the card. When false, this card will not be clickable and there will be no ripple effect on click. Wear cards do not have any specific elevation or alpha differences when not enabled - they are simply not clickable.
shape Defines the card's shape. It is strongly recommended to use the default as this shape is a key characteristic of the Wear Material Theme
colors CardColors that will be used to resolve the colors used for this card in different states. See CardDefaults.cardColors.
border A BorderStroke object which is used for the outline drawing.
contentPadding The spacing values to apply internally between the container and the content
interactionSource an optional hoisted MutableInteractionSource for observing and emitting Interactions for this card. You can use this to change the card's appearance or preview the card in different states. Note that if null is provided, interactions will still happen internally.
transformation Transformation to be used when card appears inside a container that needs to dynamically change its content separately from the background.
content The main slot for a content of this card

Code Examples

NonClickableOutlinedCardSample

@Composable
fun NonClickableOutlinedCardSample() {
    OutlinedCard { Text("Non-clickable outlined card") }
}

OutlinedCardSample

@Composable
fun OutlinedCardSample() {
    OutlinedCard(onClick = { /* Do something */ }) { Text("Outlined card") }
}