CardDefaults


Contains the default values used by all card types.

Summary

Public functions

CardColors

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

Cmn
CardColors
@Composable
cardColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

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

Cmn
CardElevation
@Composable
cardElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    draggedElevation: Dp,
    disabledElevation: Dp
)

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

Cmn
CardColors

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

Cmn
CardColors
@Composable
elevatedCardColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

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

Cmn
CardElevation
@Composable
elevatedCardElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    draggedElevation: Dp,
    disabledElevation: Dp
)

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

Cmn
BorderStroke

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

Cmn
CardColors

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

Cmn
CardColors
@Composable
outlinedCardColors(
    containerColor: Color,
    contentColor: Color,
    disabledContainerColor: Color,
    disabledContentColor: Color
)

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

Cmn
CardElevation
@Composable
outlinedCardElevation(
    defaultElevation: Dp,
    pressedElevation: Dp,
    focusedElevation: Dp,
    hoveredElevation: Dp,
    draggedElevation: Dp,
    disabledElevation: Dp
)

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

Cmn

Public properties

Shape

Default shape for an elevated card.

Cmn
Shape

Default shape for an outlined card.

Cmn
Shape

Default shape for a card.

Cmn

Public functions

cardColors

@Composable
fun cardColors(): CardColors

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

cardColors

@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: Color = Color.Unspecified

the container color of this Card when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this Card when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this Card when not enabled.

disabledContentColor: Color = contentColor.copy(DisabledAlpha)

the content color of this Card when not enabled.

cardElevation

@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: Dp = FilledCardTokens.ContainerElevation

the elevation used when the Card is has no other Interactions.

pressedElevation: Dp = FilledCardTokens.PressedContainerElevation

the elevation used when the Card is pressed.

focusedElevation: Dp = FilledCardTokens.FocusContainerElevation

the elevation used when the Card is focused.

hoveredElevation: Dp = FilledCardTokens.HoverContainerElevation

the elevation used when the Card is hovered.

draggedElevation: Dp = FilledCardTokens.DraggedContainerElevation

the elevation used when the Card is dragged.

disabledElevation: Dp = FilledCardTokens.DisabledContainerElevation

the elevation used when the Card is disabled.

elevatedCardColors

@Composable
fun elevatedCardColors(): CardColors

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

elevatedCardColors

@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: Color = Color.Unspecified

the container color of this ElevatedCard when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this ElevatedCard when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this ElevatedCard when not enabled.

disabledContentColor: Color = contentColor.copy(DisabledAlpha)

the content color of this ElevatedCard when not enabled.

elevatedCardElevation

@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: Dp = ElevatedCardTokens.ContainerElevation

the elevation used when the ElevatedCard is has no other Interactions.

pressedElevation: Dp = ElevatedCardTokens.PressedContainerElevation

the elevation used when the ElevatedCard is pressed.

focusedElevation: Dp = ElevatedCardTokens.FocusContainerElevation

the elevation used when the ElevatedCard is focused.

hoveredElevation: Dp = ElevatedCardTokens.HoverContainerElevation

the elevation used when the ElevatedCard is hovered.

draggedElevation: Dp = ElevatedCardTokens.DraggedContainerElevation

the elevation used when the ElevatedCard is dragged.

disabledElevation: Dp = ElevatedCardTokens.DisabledContainerElevation

the elevation used when the Card is disabled.

outlinedCardBorder

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

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

Parameters
enabled: Boolean = true

whether the card is enabled

outlinedCardColors

@Composable
fun outlinedCardColors(): CardColors

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

outlinedCardColors

@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: Color = Color.Unspecified

the container color of this OutlinedCard when enabled.

contentColor: Color = contentColorFor(containerColor)

the content color of this OutlinedCard when enabled.

disabledContainerColor: Color = Color.Unspecified

the container color of this OutlinedCard when not enabled.

disabledContentColor: Color = contentColorFor(containerColor).copy(DisabledAlpha)

the content color of this OutlinedCard when not enabled.

outlinedCardElevation

@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: Dp = OutlinedCardTokens.ContainerElevation

the elevation used when the OutlinedCard is has no other Interactions.

pressedElevation: Dp = defaultElevation

the elevation used when the OutlinedCard is pressed.

focusedElevation: Dp = defaultElevation

the elevation used when the OutlinedCard is focused.

hoveredElevation: Dp = defaultElevation

the elevation used when the OutlinedCard is hovered.

draggedElevation: Dp = OutlinedCardTokens.DraggedContainerElevation

the elevation used when the OutlinedCard is dragged.

Public properties

elevatedShape

val elevatedShapeShape

Default shape for an elevated card.

outlinedShape

val outlinedShapeShape

Default shape for an outlined card.

shape

val shapeShape

Default shape for a card.