Card

A bordered, shadowed surface with composable slots for header, title, description, content, and footer.

Card is a Column-based container with a rounded border, a drop shadow, and a card background from the active theme. Five slot composables — CardHeader, CardTitle, CardDescription, CardContent, and CardFooter — provide consistent padding and typography without any required nesting order.

Basic usage

With background image

Pass any composable directly inside Card without using the slot helpers. Coil3's AsyncImage fills the card naturally since Card is a ColumnScope.

Custom radius

radius accepts any Dp value to override the default lg corner rounding.

Custom shadow

Pass a List<BoxShadow> to shadow to adjust depth or remove the shadow entirely. Use MaterialTheme.shadow presets or supply your own values.

Override the global shadow scale by extending BoxShadow and passing it to KomoTheme.

Centered header

CardHeader and CardContent accept horizontalAlignment so you can center content without extra wrappers.

API reference

Card

ParameterTypeDefaultDescription
modifierModifierModifierApplied to the inner Column content area.
radiusDpMaterialTheme.radius.lgCorner radius for the card border and clip.
shadowList<BoxShadow>MaterialTheme.styles.shadow()Drop shadow(s) drawn behind the card. Pass emptyList() to remove.
content@Composable ColumnScope.() -> UnitCard body; receives ColumnScope so standard column modifiers apply.

CardHeader

ParameterTypeDefaultDescription
modifierModifierModifierApplied after the default full-width 16 dp padding.
horizontalAlignmentAlignment.HorizontalAlignment.StartHorizontal alignment of header children.
content@Composable ColumnScope.() -> UnitHeader content; typically CardTitle and CardDescription.

CardTitle

ParameterTypeDefaultDescription
modifierModifierModifierApplied to the wrapper column.
content@Composable () -> UnitTitle content. Rendered semibold at 18 sp using cardForeground.

CardDescription

ParameterTypeDefaultDescription
modifierModifierModifierApplied to the wrapper column.
content@Composable () -> UnitDescription content. Rendered at 14 sp using mutedForeground.

CardContent

ParameterTypeDefaultDescription
modifierModifierModifierApplied after the default horizontal 16 dp padding.
horizontalAlignmentAlignment.HorizontalAlignment.StartHorizontal alignment of content children.
content@Composable ColumnScope.() -> UnitMain body content.

CardFooter

ParameterTypeDefaultDescription
modifierModifierModifierApplied after the default full-width 16 dp padding.
horizontalArrangementArrangement.HorizontalArrangement.StartHorizontal arrangement of footer children.
content@Composable RowScope.() -> UnitFooter content; laid out in a Row aligned to center vertically.
Edit this page on GitHub