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

← Back to Foundation

LazyColumnItems

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

A vertically scrolling list that only composes and lays out the currently visible items.

@param items the backing list of data to display @param modifier the modifier to apply to this layout @param contentPadding convenience param to specify a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. Note that it isnot* a padding applied for each item's content @param itemContent emits the UI for an item from items list. May emit any number of components, which will be stacked vertically. Note that LazyColumnItems can start scrolling incorrectly if you emit nothing and then lazily recompose with the real content, so even if you load the content asynchronously please reserve some space for the item, for example using Spacer.

Overloads

LazyColumnItems

@Composable
fun <T> LazyColumnItems(
    items: List<T>,
    modifier: Modifier = Modifier,
    contentPadding: InnerPadding = InnerPadding(0.dp),
    itemContent: @Composable (T) -> Unit
)

Parameters

NameDescription
itemsthe backing list of data to display
modifierthe modifier to apply to this layout
contentPaddingconvenience param to specify a padding around the whole content. This will add padding for the content after it has been clipped, which is not possible via modifier param. Note that it isnot* a padding applied for each item's content
itemContentemits the UI for an item from items list. May emit any number of components, which will be stacked vertically. Note that LazyColumnItems can start scrolling incorrectly if you emit nothing and then lazily recompose with the real content, so even if you load the content asynchronously please reserve some space for the item, for example using Spacer