object CardDefaults


Contains the default values used by Card

Summary

Public functions

CardColors

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard.

CardColors
@Composable
cardColors(
    containerColor: Color,
    contentColor: Color,
    appNameColor: Color,
    timeColor: Color,
    titleColor: Color,
    subtitleColor: Color
)

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard.

CardColors
@Composable
imageCardColors(
    containerPainter: Painter,
    contentColor: Color,
    appNameColor: Color,
    timeColor: Color,
    titleColor: Color,
    subtitleColor: Color
)

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard with Image set as a background.

Painter
@Composable
imageWithScrimBackgroundPainter(
    backgroundImagePainter: Painter,
    backgroundImageScrimBrush: Brush
)

Creates a Painter for the background of a Card that displays an Image with a scrim over the image to make sure that any content above the background will be legible.

BorderStroke
@Composable
outlinedCardBorder(outlineColor: Color, borderWidth: Dp)

Creates a BorderStroke that represents the default border used in Outlined Cards.

CardColors

Creates a CardColors that represents the default container and content colors used in an OutlinedCard, outlined AppCard or TitleCard.

CardColors
@Composable
outlinedCardColors(
    contentColor: Color,
    appNameColor: Color,
    timeColor: Color,
    titleColor: Color,
    subtitleColor: Color
)

Creates a CardColors that represents the default container and content colors used in an OutlinedCard, outlined AppCard or TitleCard.

Public properties

Dp

The default size of the app icon/image when used inside a AppCard.

PaddingValues

The default content padding used by Card

Public functions

cardColors

Added in 1.0.0-alpha21
@Composable
fun cardColors(): CardColors

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard.

cardColors

@Composable
fun cardColors(
    containerColor: Color = Color.Unspecified,
    contentColor: Color = Color.Unspecified,
    appNameColor: Color = Color.Unspecified,
    timeColor: Color = Color.Unspecified,
    titleColor: Color = Color.Unspecified,
    subtitleColor: Color = Color.Unspecified
): CardColors

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard.

Parameters
containerColor: Color = Color.Unspecified

the container color of this Card.

contentColor: Color = Color.Unspecified

the content color of this Card.

appNameColor: Color = Color.Unspecified

the color used for appName, only applies to AppCard.

timeColor: Color = Color.Unspecified

the color used for time, applies to AppCard and TitleCard.

titleColor: Color = Color.Unspecified

the color used for title, applies to AppCard and TitleCard.

subtitleColor: Color = Color.Unspecified

the color used for subtitle, applies to TitleCard.

imageCardColors

@Composable
fun imageCardColors(
    containerPainter: Painter,
    contentColor: Color = Color.Unspecified,
    appNameColor: Color = Color.Unspecified,
    timeColor: Color = Color.Unspecified,
    titleColor: Color = Color.Unspecified,
    subtitleColor: Color = Color.Unspecified
): CardColors

Creates a CardColors that represents the default container and content colors used in a Card, AppCard or TitleCard with Image set as a background.

Parameters
containerPainter: Painter

a Painter which is used for background drawing.

contentColor: Color = Color.Unspecified

the content color of this Card.

appNameColor: Color = Color.Unspecified

the color used for appName, only applies to AppCard.

timeColor: Color = Color.Unspecified

the color used for time, applies to AppCard and TitleCard.

titleColor: Color = Color.Unspecified

the color used for title, applies to AppCard and TitleCard.

subtitleColor: Color = Color.Unspecified

the color used for subtitle, applies to TitleCard.

imageWithScrimBackgroundPainter

Added in 1.0.0-alpha21
@Composable
fun imageWithScrimBackgroundPainter(
    backgroundImagePainter: Painter,
    backgroundImageScrimBrush: Brush = SolidColor(OverlayScrimColor)
): Painter

Creates a Painter for the background of a Card that displays an Image with a scrim over the image to make sure that any content above the background will be legible.

An Image background is a means to reinforce the meaning of information in a Card, e.g. To help to contextualize the information in a TitleCard

Cards should have a content color that contrasts with the background image and scrim

Parameters
backgroundImagePainter: Painter

The Painter to use to draw the background of the Card

backgroundImageScrimBrush: Brush = SolidColor(OverlayScrimColor)

The Brush to use to paint a scrim over the background image to ensure that any text drawn over the image is legible

outlinedCardBorder

@Composable
fun outlinedCardBorder(
    outlineColor: Color = OutlinedCardTokens.ContainerBorderColor.value,
    borderWidth: Dp = OutlinedCardTokens.BorderWidth
): BorderStroke

Creates a BorderStroke that represents the default border used in Outlined Cards.

Parameters
outlineColor: Color = OutlinedCardTokens.ContainerBorderColor.value

The color to be used for drawing an outline.

borderWidth: Dp = OutlinedCardTokens.BorderWidth

width of the border in Dp.

outlinedCardColors

Added in 1.0.0-alpha21
@Composable
fun outlinedCardColors(): CardColors

Creates a CardColors that represents the default container and content colors used in an OutlinedCard, outlined AppCard or TitleCard.

outlinedCardColors

@Composable
fun outlinedCardColors(
    contentColor: Color = Color.Unspecified,
    appNameColor: Color = Color.Unspecified,
    timeColor: Color = Color.Unspecified,
    titleColor: Color = Color.Unspecified,
    subtitleColor: Color = Color.Unspecified
): CardColors

Creates a CardColors that represents the default container and content colors used in an OutlinedCard, outlined AppCard or TitleCard.

Parameters
contentColor: Color = Color.Unspecified

the content color of this OutlinedCard.

appNameColor: Color = Color.Unspecified

the color used for appName, only applies to AppCard.

timeColor: Color = Color.Unspecified

the color used for time, applies to AppCard and TitleCard.

titleColor: Color = Color.Unspecified

the color used for title, applies to AppCard and TitleCard.

subtitleColor: Color = Color.Unspecified

the color used for subtitle, applies to TitleCard.

Public properties

AppImageSize

Added in 1.0.0-alpha21
val AppImageSizeDp

The default size of the app icon/image when used inside a AppCard.

ContentPadding

Added in 1.0.0-alpha21
val ContentPaddingPaddingValues

The default content padding used by Card