CardDefaults
-
Cmn
object CardDefaults
Contains the default values used by all card types.
Summary
Public functions |
||
---|---|---|
CardColors |
Creates a |
Cmn
|
CardColors |
@Composable Creates a |
Cmn
|
CardElevation |
@Composable Creates a |
Cmn
|
CardColors |
Creates a |
Cmn
|
CardColors |
@Composable Creates a |
Cmn
|
CardElevation |
@Composable Creates a |
Cmn
|
BorderStroke |
@Composable Creates a |
Cmn
|
CardColors |
Creates a |
Cmn
|
CardColors |
@Composable Creates a |
Cmn
|
CardElevation |
@Composable Creates a |
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 |
contentColor: Color = contentColorFor(containerColor) |
the content color of this |
disabledContainerColor: Color = Color.Unspecified |
the container color of this |
disabledContentColor: Color = contentColor.copy(DisabledAlpha) |
the content color of this |
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 |
pressedElevation: Dp = FilledCardTokens.PressedContainerElevation |
the elevation used when the |
focusedElevation: Dp = FilledCardTokens.FocusContainerElevation |
the elevation used when the |
hoveredElevation: Dp = FilledCardTokens.HoverContainerElevation |
the elevation used when the |
draggedElevation: Dp = FilledCardTokens.DraggedContainerElevation |
the elevation used when the |
disabledElevation: Dp = FilledCardTokens.DisabledContainerElevation |
the elevation used when the |
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 |
contentColor: Color = contentColorFor(containerColor) |
the content color of this |
disabledContainerColor: Color = Color.Unspecified |
the container color of this |
disabledContentColor: Color = contentColor.copy(DisabledAlpha) |
the content color of this |
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 |
pressedElevation: Dp = ElevatedCardTokens.PressedContainerElevation |
the elevation used when the |
focusedElevation: Dp = ElevatedCardTokens.FocusContainerElevation |
the elevation used when the |
hoveredElevation: Dp = ElevatedCardTokens.HoverContainerElevation |
the elevation used when the |
draggedElevation: Dp = ElevatedCardTokens.DraggedContainerElevation |
the elevation used when the |
disabledElevation: Dp = ElevatedCardTokens.DisabledContainerElevation |
the elevation used when the |
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 |
contentColor: Color = contentColorFor(containerColor) |
the content color of this |
disabledContainerColor: Color = Color.Unspecified |
the container color of this |
disabledContentColor: Color = contentColorFor(containerColor).copy(DisabledAlpha) |
the content color of this |
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 |
pressedElevation: Dp = defaultElevation |
the elevation used when the |
focusedElevation: Dp = defaultElevation |
the elevation used when the |
hoveredElevation: Dp = defaultElevation |
the elevation used when the |
draggedElevation: Dp = OutlinedCardTokens.DraggedContainerElevation |
the elevation used when the |