ElevatedCard
Functions summary
Unit |
@Composable |
Cmn
|
Unit |
@Composable |
Cmn
|
Functions
ElevatedCard
@Composable
fun ElevatedCard(
modifier: Modifier = Modifier,
shape: Shape = CardDefaults.elevatedShape,
colors: CardColors = CardDefaults.elevatedCardColors(),
elevation: CardElevation = CardDefaults.elevatedCardElevation(),
content: @Composable ColumnScope.() -> Unit
): Unit
Elevated cards contain content and actions that relate information about a subject. They have a drop shadow, providing more separation from the background than filled cards, but less than outlined cards.
This ElevatedCard does not handle input events - see the other ElevatedCard overloads if you want a clickable or selectable ElevatedCard.

Elevated card sample:
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.material3.Card import androidx.compose.material3.ElevatedCard import androidx.compose.material3.Text import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp ElevatedCard(Modifier.size(width = 180.dp, height = 100.dp)) { Box(Modifier.fillMaxSize()) { Text("Card content", Modifier.align(Alignment.Center)) } }
| Parameters | |
|---|---|
modifier: Modifier = Modifier |
the |
shape: Shape = CardDefaults.elevatedShape |
defines the shape of this card's container and shadow (when using |
colors: CardColors = CardDefaults.elevatedCardColors() |
|
elevation: CardElevation = CardDefaults.elevatedCardElevation() |
|
content: @Composable ColumnScope.() -> Unit |
The content displayed on the card |
ElevatedCard
@Composable
fun ElevatedCard(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
shape: Shape = CardDefaults.elevatedShape,
colors: CardColors = CardDefaults.elevatedCardColors(),
elevation: CardElevation = CardDefaults.elevatedCardElevation(),
interactionSource: MutableInteractionSource? = null,
content: @Composable ColumnScope.() -> Unit
): Unit
Elevated cards contain content and actions that relate information about a subject. They have a drop shadow, providing more separation from the background than filled cards, but less than outlined cards.
This ElevatedCard handles click events, calling its onClick lambda.

Clickable elevated card sample:
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.material3.Card import androidx.compose.material3.ElevatedCard import androidx.compose.material3.Text import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp ElevatedCard( onClick = { /* Do something */ }, modifier = Modifier.size(width = 180.dp, height = 100.dp), ) { Box(Modifier.fillMaxSize()) { Text("Clickable", Modifier.align(Alignment.Center)) } }
| Parameters | |
|---|---|
onClick: () -> Unit |
called when this card is clicked |
modifier: Modifier = Modifier |
the |
enabled: Boolean = true |
controls the enabled state of this card. When |
shape: Shape = CardDefaults.elevatedShape |
defines the shape of this card's container and shadow (when using |
colors: CardColors = CardDefaults.elevatedCardColors() |
|
elevation: CardElevation = CardDefaults.elevatedCardElevation() |
|
interactionSource: MutableInteractionSource? = null |
an optional hoisted |
content: @Composable ColumnScope.() -> Unit |
The content displayed on the card |