Object

CarouselDefaults

Source set: Android
@ExperimentalTvMaterial3Api
object CarouselDefaults

Properties

TimeToDisplayItemMillis

Source set: Android
const val TimeToDisplayItemMillis: Long

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

contentTransform

Source set: Android
val contentTransform: ContentTransform

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

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

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

Parameters

itemCount total number of items in the carousel
activeItemIndex the current active item index
modifier Modifier applied to the indicators' container
spacing spacing between the indicator dots
indicator indicator dot representing each item in the carousel

Last updated: