<div class='sourceset sourceset-android'>Android</div>

```kotlin
object CardDefaults
```

Contains the default values used by all card types.

## Properties

<div class='sourceset sourceset-android'>Android</div>

```kotlin
const val SquareImageAspectRatio = 1f
```

Recommended aspect ratio `Float` to get square images, can be applied using the modifier
[androidx.compose.foundation.layout.aspectRatio](/jetpack-compose/androidx.xr.compose/compose/functions/aspectRatio).

<div class='sourceset sourceset-android'>Android</div>

```kotlin
const val VerticalImageAspectRatio = 2f / 3
```

Recommended aspect ratio `Float` for vertical images, can be applied using the modifier
[androidx.compose.foundation.layout.aspectRatio](/jetpack-compose/androidx.xr.compose/compose/functions/aspectRatio).

<div class='sourceset sourceset-android'>Android</div>

```kotlin
const val HorizontalImageAspectRatio = 16f / 9
```

Recommended aspect ratio `Float` for horizontal images, can be applied using the modifier
[androidx.compose.foundation.layout.aspectRatio](/jetpack-compose/androidx.xr.compose/compose/functions/aspectRatio).

<div class='sourceset sourceset-android'>Android</div>

```kotlin
val ScrimBrush =
    Brush.verticalGradient(
        listOf(
            Color(red = 28, green = 27, blue = 31, alpha = 0),
            Color(red = 28, green = 27, blue = 31, alpha = 204),
        )
    )
```

Gradient used in cards to give more emphasis to the textual content that is generally
displayed above an image.

## Functions

<h2 id="shape-shape-focusedshape-pressedshape">shape</h2>

```kotlin
fun shape(
        shape: Shape = ContainerShape,
        focusedShape: Shape = shape,
        pressedShape: Shape = shape,
    ) = CardShape(shape = shape, focusedShape = focusedShape, pressedShape = pressedShape)
```

Creates a [CardShape](/jetpack-compose/androidx.tv/tv-material/classes/CardShape) that represents the default container shapes used in a Card.

#### Parameters

| | |
| --- | --- |
| shape | the default shape used when the Card has no other [Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction)s. |
| focusedShape | the shape used when the Card is focused. |
| pressedShape | the shape used when the Card is pressed. |

<hr class="docs-overload-divider">

<h2 id="colors-containercolor-contentcolor-focusedcontainercolor-focusedcontentcolor-pressedcontainercolor-pressedcontentcolor">colors</h2>

```kotlin
@ReadOnlyComposable
    @Composable
    fun colors(
        containerColor: Color = MaterialTheme.colorScheme.surfaceVariant,
        contentColor: Color = contentColorFor(containerColor),
        focusedContainerColor: Color = containerColor,
        focusedContentColor: Color = contentColorFor(focusedContainerColor),
        pressedContainerColor: Color = focusedContainerColor,
        pressedContentColor: Color = contentColorFor(pressedContainerColor),
    ) =
        CardColors(
            containerColor = containerColor,
            contentColor = contentColor,
            focusedContainerColor = focusedContainerColor,
            focusedContentColor = focusedContentColor,
            pressedContainerColor = pressedContainerColor,
            pressedContentColor = pressedContentColor,
        )
```

Creates [CardColors](/jetpack-compose/androidx.tv/tv-material/classes/CardColors) that represents the default container & content colors used in a Card.

#### Parameters

| | |
| --- | --- |
| containerColor | the default container color of this Card. |
| contentColor | the default content color of this Card. |
| focusedContainerColor | the container color of this Card when focused. |
| focusedContentColor | the content color of this Card when focused. |
| pressedContainerColor | the container color of this Card when pressed. |
| pressedContentColor | the content color of this Card when pressed. |

<hr class="docs-overload-divider">

<h2 id="compactcardcolors-containercolor-contentcolor-focusedcontainercolor-focusedcontentcolor-pressedcontainercolor-pressedcontentcolor">compactCardColors</h2>

```kotlin
@ReadOnlyComposable
    @Composable
    fun compactCardColors(
        containerColor: Color = MaterialTheme.colorScheme.surfaceVariant,
        contentColor: Color = Color.White,
        focusedContainerColor: Color = containerColor,
        focusedContentColor: Color = contentColor,
        pressedContainerColor: Color = focusedContainerColor,
        pressedContentColor: Color = focusedContentColor,
    ) =
        CardColors(
            containerColor = containerColor,
            contentColor = contentColor,
            focusedContainerColor = focusedContainerColor,
            focusedContentColor = focusedContentColor,
            pressedContainerColor = pressedContainerColor,
            pressedContentColor = pressedContentColor,
        )
```

Creates [CardColors](/jetpack-compose/androidx.tv/tv-material/classes/CardColors) that represents the default colors used in a Compact Card.

#### Parameters

| | |
| --- | --- |
| containerColor | the default container color of this Card. |
| contentColor | the default content color of this Card. |
| focusedContainerColor | the container color of this Card when focused. |
| focusedContentColor | the content color of this Card when focused. |
| pressedContainerColor | the container color of this Card when pressed. |
| pressedContentColor | the content color of this Card when pressed. |

<hr class="docs-overload-divider">

<h2 id="scale">scale</h2>

```kotlin
fun scale(
        @FloatRange(from = 0.0) scale: Float = 1f,
        @FloatRange(from = 0.0) focusedScale: Float = 1.1f,
        @FloatRange(from = 0.0) pressedScale: Float = scale,
    ) = CardScale(scale = scale, focusedScale = focusedScale, pressedScale = pressedScale)
```

Creates a [CardScale](/jetpack-compose/androidx.tv/tv-material/classes/CardScale) that represents the default scales used in a Card. Scales are used to
modify the size of a composable in different [Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction) states e.g. 1f (original) in
default state, 1.1f (scaled up) in focused state, 0.8f (scaled down) in pressed state, etc.

#### Parameters

| | |
| --- | --- |
| scale | the default scale to be used for this Card. |
| focusedScale | the scale to be used for this Card when focused. |
| pressedScale | the scale to be used for this Card when pressed. |

<hr class="docs-overload-divider">

<h2 id="border-border-focusedborder-pressedborder">border</h2>

```kotlin
@ReadOnlyComposable
    @Composable
    fun border(
        border: Border = Border.None,
        focusedBorder: Border =
            Border(
                border = BorderStroke(width = 3.dp, color = MaterialTheme.colorScheme.border),
                shape = ContainerShape,
            ),
        pressedBorder: Border = focusedBorder,
    ) = CardBorder(border = border, focusedBorder = focusedBorder, pressedBorder = pressedBorder)
```

Creates a [CardBorder](/jetpack-compose/androidx.tv/tv-material/classes/CardBorder) that represents the border [Border](/jetpack-compose/androidx.tv/tv-material/classes/Border)s applied on a Card in different
[Interaction](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Interaction) states.

#### Parameters

| | |
| --- | --- |
| border | the default [Border](/jetpack-compose/androidx.tv/tv-material/classes/Border) to be used for this Card. |
| focusedBorder | the [Border](/jetpack-compose/androidx.tv/tv-material/classes/Border) to be used for this Card when focused. |
| pressedBorder | the [Border](/jetpack-compose/androidx.tv/tv-material/classes/Border) to be used for this Card when pressed. |

<hr class="docs-overload-divider">

<h2 id="glow-glow-focusedglow-pressedglow">glow</h2>

```kotlin
fun glow(glow: Glow = Glow.None, focusedGlow: Glow = glow, pressedGlow: Glow = glow) =
        CardGlow(glow = glow, focusedGlow = focusedGlow, pressedGlow = pressedGlow)
```

Creates a [CardGlow](/jetpack-compose/androidx.tv/tv-material/classes/CardGlow) that represents the default [Glow](/jetpack-compose/androidx.tv/tv-material/classes/Glow)s used in a card.

#### Parameters

| | |
| --- | --- |
| glow | the default [Glow](/jetpack-compose/androidx.tv/tv-material/classes/Glow) behind this Card. |
| focusedGlow | the [Glow](/jetpack-compose/androidx.tv/tv-material/classes/Glow) behind this Card when focused. |
| pressedGlow | the [Glow](/jetpack-compose/androidx.tv/tv-material/classes/Glow) behind this Card when pressed. |