androidx.compose.material3
Card
Composable function
A card groups content about one subject, like a message, a photo or a setting.

Card(modifier = Modifier.width(280.dp)) {
Column(Modifier.padding(16.dp)) {
Text("Trip to Lisbon", style = MaterialTheme.typography.titleMedium)
Text("3 nights · 12–15 May", style = MaterialTheme.typography.bodyMedium)
}
}
There are three card types. They differ only in color, shadow and outline. See Card types.

Row(horizontalArrangement = Arrangement.spacedBy(12.dp)) {
Card(Modifier.width(140.dp)) { Text("Filled", Modifier.padding(16.dp)) }
ElevatedCard(Modifier.width(140.dp)) { Text("Elevated", Modifier.padding(16.dp)) }
OutlinedCard(Modifier.width(140.dp)) { Text("Outlined", Modifier.padding(16.dp)) }
}
Basic
Not clickable. Use it to group content.
@Composable
fun Card(
modifier: Modifier = Modifier,
shape: Shape = CardDefaults.shape,
colors: CardColors = CardDefaults.cardColors(),
elevation: CardElevation = CardDefaults.cardElevation(),
border: BorderStroke? = null,
content: @Composable ColumnScope.() -> Unit,
)
modifier: ModifierOptional
modifier: ModifierOptionalDefault: Modifier
Changes size, padding, or position of the card. See the Modifier guide.
A card is as wide as its content by default. Use Modifier.fillMaxWidth() to stretch it.
shape: ShapeOptional
shape: ShapeOptionalDefault: CardDefaults.shape
Sets the outline of the card. Default: the theme's medium shape (12 dp corners).
See the Shapes guide.

Card(shape = MaterialTheme.shapes.extraLarge, modifier = Modifier.width(280.dp)) {
Text("28 dp corners", Modifier.padding(24.dp))
}
colors: CardColorsOptional
colors: CardColorsOptionalDefault: CardDefaults.cardColors()
Sets the background and content colors.
Make one with CardDefaults.cardColors. Each card type has its own function.

Card(
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.tertiaryContainer,
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
),
modifier = Modifier.width(280.dp),
) {
Text("Tip: drag to reorder", Modifier.padding(16.dp))
}
elevation: CardElevationOptional
elevation: CardElevationOptionalDefault: CardDefaults.cardElevation()
Sets the shadow height, also while pressed or dragged.
Make one with CardDefaults.cardElevation.

ElevatedCard(
elevation = CardDefaults.elevatedCardElevation(defaultElevation = 8.dp),
modifier = Modifier.width(280.dp),
) {
Text("Raised card", Modifier.padding(16.dp))
}
border: BorderStroke?Optional
border: BorderStroke?OptionalDefault: null
Draws an outline. null means no outline. OutlinedCard has one by default.

Card(
border = BorderStroke(2.dp, MaterialTheme.colorScheme.primary),
modifier = Modifier.width(280.dp),
) {
Text("Selected plan", Modifier.padding(16.dp))
}
content: @Composable ColumnScope.() -> UnitRequired
content: @Composable ColumnScope.() -> UnitRequiredWhat the card shows. Items are placed in a Column, top to bottom.
The card adds no padding. Add it yourself, usually 16 dp.

OutlinedCard(Modifier.width(280.dp)) {
Column(Modifier.padding(16.dp)) {
Text("Delete file?", style = MaterialTheme.typography.titleMedium)
Text("This can't be undone.", style = MaterialTheme.typography.bodyMedium)
}
Row(Modifier.padding(horizontal = 8.dp)) {
TextButton(onClick = {}) { Text("Cancel") }
TextButton(onClick = {}) { Text("Delete") }
}
}
Clickable
Takes onClick. The whole card reacts to clicks.
@Composable
fun Card(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
shape: Shape = CardDefaults.shape,
colors: CardColors = CardDefaults.cardColors(),
elevation: CardElevation = CardDefaults.cardElevation(),
border: BorderStroke? = null,
interactionSource: MutableInteractionSource? = null,
content: @Composable ColumnScope.() -> Unit,
)
onClick: () -> UnitRequired
onClick: () -> UnitRequiredCalled when the card is clicked. Only on the clickable form.

Card(onClick = { /* open details */ }, modifier = Modifier.width(280.dp)) {
Text("Tap to open", Modifier.padding(16.dp))
}
enabled: BooleanOptional
enabled: BooleanOptionalDefault: true
Set to false to make a clickable card gray and not clickable.

Card(onClick = {}, enabled = false, modifier = Modifier.width(280.dp)) {
Text("Not available", Modifier.padding(16.dp))
}
interactionSource: MutableInteractionSource?Optional
interactionSource: MutableInteractionSource?OptionalDefault: null
Lets you observe or control press, hover and focus states. Leave it null unless your code must react to them. See InteractionSource.
Same as above: modifier, shape, colors, elevation, border, content.
Card types
See also
CardDefaults: default values and helper functions forCard.