CarouselDefaults

@ExperimentalTvMaterial3Api
object CarouselDefaults


Summary

Constants

const Long

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

Public functions

Unit
@Composable
IndicatorRow(
    itemCount: Int,
    activeItemIndex: Int,
    modifier: Modifier,
    spacing: Dp,
    indicator: @Composable (isActive: Boolean) -> Unit
)

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

Public properties

ContentTransform

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

Constants

TimeToDisplayItemMillis

Added in 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

total number of items in the carousel

activeItemIndex: Int

the current active item index

modifier: Modifier = Modifier

Modifier applied to the indicators' container

spacing: Dp = 8.dp

spacing between the indicator dots

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, ), ) }

indicator dot representing each item in the carousel

Public properties

contentTransform

Added in 1.0.0
val contentTransformContentTransform

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