# CarouselDefaults

# CarouselDefaults

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/Carousel.kt+class:androidx.tv.material3.CarouselDefaults)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/tv#1.0.0)

<br />

```
@ExperimentalTvMaterial3Api
object CarouselDefaults
```

<br />

*** ** * ** ***

## Summary

|                                     ### Constants                                     |
|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [TimeToDisplayItemMillis](https://developer.android.com/reference/kotlin/androidx/tv/material3/CarouselDefaults#TimeToDisplayItemMillis())` = 5000` Default time for which the item is visible to the user. |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | `@`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable) [IndicatorRow](https://developer.android.com/reference/kotlin/androidx/tv/material3/CarouselDefaults#IndicatorRow(kotlin.Int,kotlin.Int,androidx.compose.ui.Modifier,androidx.compose.ui.unit.Dp,kotlin.Function1))`(` ` itemCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` activeItemIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` modifier: `[Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)`,` ` spacing: `[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)`,` ` indicator: @`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable)` (isActive: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) `)` An indicator showing the position of the current active item among the items of the carousel. |

|                                             ### Public properties                                              |
|----------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContentTransform](https://developer.android.com/reference/kotlin/androidx/compose/animation/ContentTransform) | [contentTransform](https://developer.android.com/reference/kotlin/androidx/tv/material3/CarouselDefaults#contentTransform()) Transition applied when bringing it into view and removing it from the view |

## Constants

### TimeToDisplayItemMillis

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

```
const val TimeToDisplayItemMillis = 5000: Long
```

Default time for which the item is visible to the user.  

## Public functions

### IndicatorRow

```
@Composable
fun IndicatorRow(
    itemCount: Int,
    activeItemIndex: Int,
    modifier: Modifier = Modifier,
    spacing: Dp = 8.dp,
    indicator: @Composable (isActive: Boolean) -> Unit = { isActive ->
            val activeColor = Color.White
            val inactiveColor = activeColor.copy(alpha = 0.3f)
            Box(
                modifier =
                    Modifier.size(8.dp)
                        .background(
                            color = if (isActive) activeColor else inactiveColor,
                            shape = CircleShape,
                        ),
            )
        }
): Unit
```

An indicator showing the position of the current active item among the items of the carousel.  

|                                                                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
| `itemCount: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                                                                                                                                                    | total number of items in the carousel                |
| `activeItemIndex: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                                                                                                                                                                                                                                                                                                                                              | the current active item index                        |
| `modifier: `[Modifier](https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier)` = Modifier`                                                                                                                                                                                                                                                                                                                                                                                                                            | Modifier applied to the indicators' container        |
| `spacing: `[Dp](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp)` = 8.dp`                                                                                                                                                                                                                                                                                                                                                                                                                                        | spacing between the indicator dots                   |
| `indicator: @`[Composable](https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable)` (isActive: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`) `->` `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` = { isActive -> val activeColor = Color.White val inactiveColor = activeColor.copy(alpha = 0.3f) Box( modifier = Modifier.size(8.dp) .background( color = if (isActive) activeColor else inactiveColor, shape = CircleShape, ), ) }` | indicator dot representing each item in the carousel |

## Public properties

### contentTransform

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

```
val contentTransform: ContentTransform
```

Transition applied when bringing it into view and removing it from the view