Card
Cards contain contain content and actions that relate information about a subject. Filled cards provide subtle separation from the background. This has less emphasis than elevated or outlined cards.
This Card does not handle input events - see the other Card overloads if you want a clickable or selectable Card.
Card sample:
Parameters
the Modifier to be applied to this card
CardColors that will be used to resolve the colors used for this card in different states. See CardDefaults.cardColors.
CardElevation used to resolve the elevation for this card in different states. This controls the size of the shadow below the card. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. See also: Surface.
the border to draw around the container of this card
Samples
androidx.compose.material3.samples.CardSampleCards contain contain content and actions that relate information about a subject. Filled cards provide subtle separation from the background. This has less emphasis than elevated or outlined cards.
This Card handles click events, calling its onClick lambda.
Clickable card sample:
Parameters
called when this card is clicked
the Modifier to be applied to this card
controls the enabled state of this card. When false
, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
CardColors that will be used to resolve the color(s) used for this card in different states. See CardDefaults.cardColors.
CardElevation used to resolve the elevation for this card in different states. This controls the size of the shadow below the card. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. See also: Surface.
the border to draw around the container of this card
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.