# CardDefaults

Artifact: [androidx.tv:tv-material](https://developer.android.com/jetpack/androidx/releases/tv) [View Source](https://cs.android.com/search?q=file:androidx/tv/material3/Card.kt+class:androidx.tv.material3.CardDefaults) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)


```
object CardDefaults
```

<br />

*** ** * ** ***

Contains the default values used by all card types.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#HorizontalImageAspectRatio()` Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` for horizontal images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#SquareImageAspectRatio() = 1.0f` Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` to get square images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#VerticalImageAspectRatio()` Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` for vertical images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardBorder` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#border(androidx.tv.material3.Border,androidx.tv.material3.Border,androidx.tv.material3.Border)(border: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border, focusedBorder: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border, pressedBorder: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border)` Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardBorder` that represents the border `https://developer.android.com/reference/kotlin/androidx/tv/material3/Border`s applied on a Card in different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction` states. |
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#colors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, pressedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, pressedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` that represents the default container \& content colors used in a Card. |
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#compactCardColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, focusedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, pressedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, pressedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Creates `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` that represents the default colors used in a Compact Card. |
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardGlow` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#glow(androidx.tv.material3.Glow,androidx.tv.material3.Glow,androidx.tv.material3.Glow)(glow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow, focusedGlow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow, pressedGlow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow)` Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardGlow` that represents the default `https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow`s used in a card. |
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardScale` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#scale(kotlin.Float,kotlin.Float,kotlin.Float)( scale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, focusedScale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, pressedScale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardScale` that represents the default scales used in a Card. |
| `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardShape` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#shape(androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Shape,androidx.compose.ui.graphics.Shape)(shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, focusedShape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape, pressedShape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape)` Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardShape` that represents the default container shapes used in a Card. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardDefaults#ScrimBrush()` Gradient used in cards to give more emphasis to the textual content that is generally displayed above an image. |

## Constants

### HorizontalImageAspectRatio

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

```
const val HorizontalImageAspectRatio: Float
```

Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` for horizontal images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`.

### SquareImageAspectRatio

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

```
const val SquareImageAspectRatio = 1.0f: Float
```

Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` to get square images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`.

### VerticalImageAspectRatio

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

```
const val VerticalImageAspectRatio: Float
```

Recommended aspect ratio `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` for vertical images, can be applied using the modifier `https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/aspectRatio.modifier#(androidx.compose.ui.Modifier).aspectRatio(kotlin.Float,kotlin.Boolean)`.

## Public functions

### border

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

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

Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardBorder` that represents the border `https://developer.android.com/reference/kotlin/androidx/tv/material3/Border`s applied on a Card in different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction` states.

| Parameters |
|---|---|
| `border: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border = Border.None` | the default `https://developer.android.com/reference/kotlin/androidx/tv/material3/Border` to be used for this Card. |
| `focusedBorder: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border = Border( border = BorderStroke(width = 3.dp, color = MaterialTheme.colorScheme.border), shape = ContainerShape, )` | the `https://developer.android.com/reference/kotlin/androidx/tv/material3/Border` to be used for this Card when focused. |
| `pressedBorder: https://developer.android.com/reference/kotlin/androidx/tv/material3/Border = focusedBorder` | the `https://developer.android.com/reference/kotlin/androidx/tv/material3/Border` to be used for this Card when pressed. |

### colors

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/tv#1.1.0)

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

Creates `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` that represents the default container \& content colors used in a Card.

| Parameters |
|---|---|
| `containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colorScheme.surfaceVariant` | the default container color of this Card. |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColorFor(containerColor)` | the default content color of this Card. |
| `focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = containerColor` | the container color of this Card when focused. |
| `focusedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColorFor(focusedContainerColor)` | the content color of this Card when focused. |
| `pressedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = focusedContainerColor` | the container color of this Card when pressed. |
| `pressedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColorFor(pressedContainerColor)` | the content color of this Card when pressed. |

### compactCardColors

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/tv#1.1.0)

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

Creates `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardColors` that represents the default colors used in a Compact Card.

| Parameters |
|---|---|
| `containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = MaterialTheme.colorScheme.surfaceVariant` | the default container color of this Card. |
| `contentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = Color.White` | the default content color of this Card. |
| `focusedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = containerColor` | the container color of this Card when focused. |
| `focusedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = contentColor` | the content color of this Card when focused. |
| `pressedContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = focusedContainerColor` | the container color of this Card when pressed. |
| `pressedContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color = focusedContentColor` | the content color of this Card when pressed. |

### glow

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

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

Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardGlow` that represents the default `https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow`s used in a card.

| Parameters |
|---|---|
| `glow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow = Glow.None` | the default `https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow` behind this Card. |
| `focusedGlow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow = glow` | the `https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow` behind this Card when focused. |
| `pressedGlow: https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow = glow` | the `https://developer.android.com/reference/kotlin/androidx/tv/material3/Glow` behind this Card when pressed. |

### scale

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

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

Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardScale` that represents the default scales used in a Card. Scales are used to modify the size of a composable in different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/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: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.0f` | the default scale to be used for this Card. |
| `focusedScale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 1.1f` | the scale to be used for this Card when focused. |
| `pressedScale: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = scale` | the scale to be used for this Card when pressed. |

### shape

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

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

Creates a `https://developer.android.com/reference/kotlin/androidx/tv/material3/CardShape` that represents the default container shapes used in a Card.

| Parameters |
|---|---|
| `shape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = ContainerShape` | the default shape used when the Card has no other `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s. |
| `focusedShape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = shape` | the shape used when the Card is focused. |
| `pressedShape: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape = shape` | the shape used when the Card is pressed. |

## Public properties

### ScrimBrush

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

```
val ScrimBrush: Brush
```

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