Card

object Card(source)

Spark card component.

Cards contain content and actions that relate information about a subject. They provide visual separation from the background and can be static or interactive.

Variants: Flat, Elevated, Outlined, HighlightFlat, HighlightElevated.

Functions

Link copied to clipboard
fun Elevated(modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Elevated card with a drop shadow. More separation from the background than Flat, less than Outlined.

fun Elevated(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Clickable elevated card with a drop shadow. More separation from the background than Flat, less than Outlined.

Link copied to clipboard
fun Flat(modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Flat card with subtle separation from the background. Less emphasis than Elevated or Outlined.

fun Flat(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Clickable flat card with subtle separation from the background. Less emphasis than Elevated or Outlined.

Link copied to clipboard
fun HighlightElevated(modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.main, contentPadding: PaddingValues = CardDefaults.paddingValues(true), heading: @Composable () -> Unit = { }, content: @Composable ColumnScope.() -> Unit)

Highlight elevated card: colored top banner with drop shadow for maximum emphasis.

fun HighlightElevated(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.main, contentPadding: PaddingValues = CardDefaults.paddingValues(true), heading: @Composable () -> Unit = { }, content: @Composable ColumnScope.() -> Unit)

Clickable highlight elevated card: colored top banner with drop shadow for maximum emphasis.

Link copied to clipboard
fun HighlightFlat(modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.main, contentPadding: PaddingValues = CardDefaults.paddingValues(true), heading: @Composable () -> Unit = { }, content: @Composable ColumnScope.() -> Unit)

Highlight flat card with a colored banner at the top for additional emphasis.

fun HighlightFlat(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.main, contentPadding: PaddingValues = CardDefaults.paddingValues(true), heading: @Composable () -> Unit = { }, content: @Composable ColumnScope.() -> Unit)

Clickable highlight flat card with a colored banner at the top for additional emphasis.

Link copied to clipboard
fun Outlined(modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, borderColor: Color = SparkTheme.colors.outline, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Outlined card with a visual boundary around the container. Can provide greater emphasis than other types.

fun Outlined(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = SparkTheme.shapes.medium, colors: Color = SparkTheme.colors.surface, borderColor: Color = SparkTheme.colors.outline, contentPadding: PaddingValues = PaddingValues(16.dp), content: @Composable ColumnScope.() -> Unit)

Clickable outlined card with a visual boundary around the container. Can provide greater emphasis than other types.