Start native apps faster with the Composables CLI ->
Object

CardDefaults

Contains the default values used by all card types.

Source set: Common
public object CardDefaults

Contains the default values used by all card types.

Properties

shape

Source set: Common
public val shape: Shape

Default shape for a card.

elevatedShape

Source set: Common
public val elevatedShape: Shape

Default shape for an elevated card.

outlinedShape

Source set: Common
public val outlinedShape: Shape

Default shape for an outlined card.

Functions

cardElevation

Source set: Common
@Composable
    public fun cardElevation(
        defaultElevation: Dp = FilledCardTokens.ContainerElevation,
        pressedElevation: Dp = FilledCardTokens.PressedContainerElevation,
        focusedElevation: Dp = FilledCardTokens.FocusContainerElevation,
        hoveredElevation: Dp = FilledCardTokens.HoverContainerElevation,
        draggedElevation: Dp = FilledCardTokens.DraggedContainerElevation,
        disabledElevation: Dp = FilledCardTokens.DisabledContainerElevation,
    ): CardElevation

Creates a CardElevation that will animate between the provided values according to the Material specification for a Card.

Parameters

defaultElevation the elevation used when the Card is has no other Interactions.
pressedElevation the elevation used when the Card is pressed.
focusedElevation the elevation used when the Card is focused.
hoveredElevation the elevation used when the Card is hovered.
draggedElevation the elevation used when the Card is dragged.
disabledElevation the elevation used when the Card is disabled.

elevatedCardElevation

Source set: Common
@Composable
    public fun elevatedCardElevation(
        defaultElevation: Dp = ElevatedCardTokens.ContainerElevation,
        pressedElevation: Dp = ElevatedCardTokens.PressedContainerElevation,
        focusedElevation: Dp = ElevatedCardTokens.FocusContainerElevation,
        hoveredElevation: Dp = ElevatedCardTokens.HoverContainerElevation,
        draggedElevation: Dp = ElevatedCardTokens.DraggedContainerElevation,
        disabledElevation: Dp = ElevatedCardTokens.DisabledContainerElevation,
    ): CardElevation

Creates a CardElevation that will animate between the provided values according to the Material specification for an ElevatedCard.

Parameters

defaultElevation the elevation used when the ElevatedCard is has no other Interactions.
pressedElevation the elevation used when the ElevatedCard is pressed.
focusedElevation the elevation used when the ElevatedCard is focused.
hoveredElevation the elevation used when the ElevatedCard is hovered.
draggedElevation the elevation used when the ElevatedCard is dragged.
disabledElevation the elevation used when the Card is disabled.

outlinedCardElevation

Source set: Common
@Composable
    public fun outlinedCardElevation(
        defaultElevation: Dp = OutlinedCardTokens.ContainerElevation,
        pressedElevation: Dp = defaultElevation,
        focusedElevation: Dp = defaultElevation,
        hoveredElevation: Dp = defaultElevation,
        draggedElevation: Dp = OutlinedCardTokens.DraggedContainerElevation,
        disabledElevation: Dp = OutlinedCardTokens.DisabledContainerElevation,
    ): CardElevation

Creates a CardElevation that will animate between the provided values according to the Material specification for an OutlinedCard.

Parameters

defaultElevation the elevation used when the OutlinedCard is has no other Interactions.
pressedElevation the elevation used when the OutlinedCard is pressed.
focusedElevation the elevation used when the OutlinedCard is focused.
hoveredElevation the elevation used when the OutlinedCard is hovered.
draggedElevation the elevation used when the OutlinedCard is dragged.

cardColors

Source set: Common
@Composable public fun cardColors(): CardColors

Creates a CardColors that represents the default container and content colors used in a Card.

cardColors

Source set: Common
@Composable
    public fun cardColors(
        containerColor: Color = Color.Unspecified,
        contentColor: Color = contentColorFor(containerColor),
        disabledContainerColor: Color = Color.Unspecified,
        disabledContentColor: Color = contentColor.copy(DisabledAlpha),
    ): CardColors

Creates a CardColors that represents the default container and content colors used in a Card.

Parameters

containerColor the container color of this Card when enabled.
contentColor the content color of this Card when enabled.
disabledContainerColor the container color of this Card when not enabled.
disabledContentColor the content color of this Card when not enabled.

elevatedCardColors

Source set: Common
@Composable
    public fun elevatedCardColors(): CardColors

Creates a CardColors that represents the default container and content colors used in an ElevatedCard.

elevatedCardColors

Source set: Common
@Composable
    public fun elevatedCardColors(
        containerColor: Color = Color.Unspecified,
        contentColor: Color = contentColorFor(containerColor),
        disabledContainerColor: Color = Color.Unspecified,
        disabledContentColor: Color = contentColor.copy(DisabledAlpha),
    ): CardColors

Creates a CardColors that represents the default container and content colors used in an ElevatedCard.

Parameters

containerColor the container color of this ElevatedCard when enabled.
contentColor the content color of this ElevatedCard when enabled.
disabledContainerColor the container color of this ElevatedCard when not enabled.
disabledContentColor the content color of this ElevatedCard when not enabled.

outlinedCardColors

Source set: Common
@Composable
    public fun outlinedCardColors(): CardColors

Creates a CardColors that represents the default container and content colors used in an OutlinedCard.

outlinedCardColors

Source set: Common
@Composable
    public fun outlinedCardColors(
        containerColor: Color = Color.Unspecified,
        contentColor: Color = contentColorFor(containerColor),
        disabledContainerColor: Color = Color.Unspecified,
        disabledContentColor: Color = contentColorFor(containerColor).copy(DisabledAlpha),
    ): CardColors

Creates a CardColors that represents the default container and content colors used in an OutlinedCard.

Parameters

containerColor the container color of this OutlinedCard when enabled.
contentColor the content color of this OutlinedCard when enabled.
disabledContainerColor the container color of this OutlinedCard when not enabled.
disabledContentColor the content color of this OutlinedCard when not enabled.

outlinedCardBorder

Source set: Common
@Composable
    public fun outlinedCardBorder(enabled: Boolean = true): BorderStroke

Creates a BorderStroke that represents the default border used in OutlinedCard.

Parameters

enabled whether the card is enabled