Object

CardDefaults

Contains the default values used by all card types.

Source set: Common

Added in 1.5.0-alpha17

object CardDefaults

Contains the default values used by all card types.

Properties

shape

Source set: Common

Added in 1.5.0-alpha17

val shape: Shape

Default shape for a card.

elevatedShape

Source set: Common

Added in 1.5.0-alpha17

val elevatedShape: Shape

Default shape for an elevated card.

outlinedShape

Source set: Common

Added in 1.5.0-alpha17

val outlinedShape: Shape

Default shape for an outlined card.

Functions

cardElevation

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable fun cardColors() = MaterialTheme.colorScheme.defaultCardColors

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

cardColors

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable fun elevatedCardColors() = MaterialTheme.colorScheme.defaultElevatedCardColors

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

elevatedCardColors

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable fun outlinedCardColors() = MaterialTheme.colorScheme.defaultOutlinedCardColors

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

outlinedCardColors

Added in 1.5.0-alpha17

@Composable
    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

Added in 1.5.0-alpha17

@Composable
    fun outlinedCardBorder(enabled: Boolean = true): BorderStroke

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

Parameters

enabled whether the card is enabled