Android 12 Developer Preview is here! Try it out, and give us your feedback!

LazyListScope

interface LazyListScope
androidx.compose.foundation.lazy.LazyListScope

Receiver scope which is used by LazyColumn and LazyRow.

Summary

Public methods
abstract Unit
item(key: Any? = null, content: LazyItemScope.() -> Unit)

Adds a single item.

abstract Unit
items(count: Int, key: (index: Int) -> Any = null, itemContent: LazyItemScope.(index: Int) -> Unit)

Adds a count of items.

abstract Unit
stickyHeader(key: Any? = null, content: LazyItemScope.() -> Unit)

Adds a sticky header item, which will remain pinned even when scrolling after it.

Extension functions
From androidx.compose.foundation.lazy
Unit
LazyListScope.items(items: List<T>, noinline key: (item: T) -> Any = null, crossinline itemContent: LazyItemScope.(item: T) -> Unit)

Adds a list of items.

Unit
LazyListScope.items(items: Array<T>, noinline key: (item: T) -> Any = null, crossinline itemContent: LazyItemScope.(item: T) -> Unit)

Adds an array of items.

Unit
LazyListScope.itemsIndexed(items: List<T>, noinline key: (index: Int, item: T) -> Any = null, crossinline itemContent: LazyItemScope.(index: Int, item: T) -> Unit)

Adds a list of items where the content of an item is aware of its index.

Unit
LazyListScope.itemsIndexed(items: Array<T>, noinline key: (index: Int, item: T) -> Any = null, crossinline itemContent: LazyItemScope.(index: Int, item: T) -> Unit)

Adds an array of items where the content of an item is aware of its index.

From androidx.paging.compose
Unit
LazyListScope.items(lazyPagingItems: LazyPagingItems<T>, itemContent: LazyItemScope.(value: T?) -> Unit)

Adds the LazyPagingItems and their content to the scope.

Unit