State of Compose 2023 results are in! Click here to learn more

← Back to Tv Material

CarouselItem

Component
in
Tv Material
. Since 1.0.0-alpha01

Overview

Code Examples

Video

This composable is intended for use in Carousel. A composable that has

  • a background layer that is rendered as soon as the composable is visible.
  • an overlay layer that is rendered after a delay of overlayEnterTransitionStartDelayMillis.

@param overlayEnterTransitionStartDelayMillis time between the rendering of the background and the overlay. @param overlayEnterTransition animation used to bring the overlay into view. @param overlayExitTransition animation used to remove the overlay from view. @param background composable defining the background of the slide. @param overlay composable defining the content overlaid on the background.

Overloads

CarouselItem

@Suppress("IllegalExperimentalApiUsage")
@OptIn(ExperimentalComposeUiApi::class, ExperimentalFoundationApi::class)
@ExperimentalTvMaterialApi
@Composable
fun CarouselItem(
    background: @Composable () -> Unit,
    modifier: Modifier = Modifier,
    overlayEnterTransitionStartDelayMillis: Long =
        CarouselItemDefaults.OverlayEnterTransitionStartDelayMillis,
    overlayEnterTransition: EnterTransition = CarouselItemDefaults.OverlayEnterTransition,
    overlayExitTransition: ExitTransition = CarouselItemDefaults.OverlayExitTransition,
    overlay: @Composable () -> Unit
)

Parameters

NameDescription
overlayEnterTransitionStartDelayMillistime between the rendering of the background and the overlay.
overlayEnterTransitionanimation used to bring the overlay into view.
overlayExitTransitionanimation used to remove the overlay from view.
backgroundcomposable defining the background of the slide.
overlaycomposable defining the content overlaid on the background