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

← Back to Tv Material

ImmersiveList

Component
in
Tv Material
. Since 1.0.0-alpha07

Overview

Code Examples

Video

Immersive List consists of a list with multiple items and a background that displays content based on the item in focus. To animate the background's entry and exit, use ImmersiveListBackgroundScope.AnimatedContent. To display the background only when the list is in focus, use ImmersiveListBackgroundScope.AnimatedVisibility.

Overloads

ImmersiveList

@Suppress("IllegalExperimentalApiUsage")
@OptIn(ExperimentalComposeUiApi::class)
@ExperimentalTvMaterial3Api
@Composable
fun ImmersiveList(
    background:
    @Composable ImmersiveListBackgroundScope.(index: Int, listHasFocus: Boolean) -> Unit,
    modifier: Modifier = Modifier,
    listAlignment: Alignment = Alignment.BottomEnd,
    list: @Composable ImmersiveListScope.() -> Unit,
)

Parameters

NameDescription
backgroundComposable defining the background to be displayed for a given item's index. listHasFocus argument can be used to hide the background when the list is not in focus
modifierapplied to Immersive List.
listAlignmentAlignment of the List with respect to the Immersive List.
listcomposable defining the list of items that has to be rendered