In Jetpack Compose, a jetpack compose card is built with the Material 3 Card composable, and a Surface is the more basic building block that supplies a background color, shape and elevation to whatever you place inside. Use Card for a self-contained piece of content such as a product or a profile summary, and use Surface when you need a themed container without card styling. Both come from the androidx.compose.material3 package.
The examples below use Material 3 with Kotlin and assume your project already has the Compose Material 3 dependency.
Surface draws a background using a color, clips content to a shape, applies elevation, and picks a readable content color for text and icons automatically. Most Material components are built on it.
The text color comes from contentColorFor the container color, so it stays readable in light and dark themes. tonalElevation tints the surface instead of relying only on a shadow, which is how Material 3 shows depth. shadowElevation adds a real shadow if you need one.
Reach for Surface for banners, chips of your own design, dialog bodies, or the root of a screen. It is also the right place to make something clickable with the onClick overload.
Card is a Surface with card defaults: a medium rounded shape, a container color and optional elevation. Its content lambda is a ColumnScope, so children stack vertically.
The outer padding on the modifier is space around the card. The inner padding on the Column is space between the card edge and its text. Without the inner padding the text touches the edges.
Material 3 has three card styles, each with its own composable and defaults.
| Composable | Look | Typical use |
|---|---|---|
Card | Filled with a container color, low elevation | Default grouping of content |
ElevatedCard | Filled with a shadow | Content that must stand out from the background |
OutlinedCard | Border, no fill emphasis | Dense lists and low emphasis items |
Customize colors and elevation with the CardDefaults helpers.
Prefer theme colors from MaterialTheme.colorScheme over hard-coded values so dark mode and dynamic color keep working.
The shape parameter accepts any Shape. Use the theme shapes or build your own.
The card clips its content to the shape, so images inside get rounded corners too.
Do not add Modifier.clickable to a card. Use the overload that takes onClick, which gives you the correct ripple, shape clipping and accessibility semantics.
Tapping anywhere on the card calls onOpen. The same onClick overload exists on Surface, ElevatedCard and OutlinedCard.
Cards are most often repeated inside a LazyColumn.
contentPadding and spacedBy handle spacing, so the cards need no outer padding of their own.
Card is a ready-made container with card shape, color and elevation defaults. Surface is the lower-level building block, and Card is built on top of it.
Material 3 uses tonal elevation, so the default card has little or no shadow. Use ElevatedCard or set CardDefaults.cardElevation(defaultElevation = ...) for a stronger effect.
Place an Image or an async image composable as the first child in the card content. The card clips it to its shape, so the top corners round automatically.
Use androidx.compose.material3 for new apps. The older androidx.compose.material library has a different Card API and does not follow current Material design.
Surface supplies color, shape, elevation and a matching content color.Card, ElevatedCard and OutlinedCard are the Material 3 card styles built on it.CardDefaults, shape and border, and use theme colors.onClick parameter for clickable cards, and LazyColumn with spacedBy for lists.