# androidx.xr.glimmer.list

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemInfo` | Contains useful information about an individual item in a `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemScope` | Receiver scope being used by the item content parameter of `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListLayoutInfo` | Information about the layout of the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListScope` | Receiver scope which is used by `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListState` | A state object that can be hoisted to control and observe scrolling. |

## Objects

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumnDefaults` | Contains the default values used by `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListScopeMarker` | DSL marker used to distinguish between list layout scope and the item scope. |

## Composables

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable` | This is a scrolling list component that only composes and lays out the currently visible items. |
| `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/rememberGlimmerLazyListState.composable` | Creates a `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListState` that is remembered across compositions. |

## Top-level functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/gestures/snapping/SnapLayoutInfoProvider` | `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/package-summary#SnapLayoutInfoProvider(androidx.xr.glimmer.list.GlimmerLazyListState)(state: https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListState)` Creates a default instance of `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/package-summary#SnapLayoutInfoProvider(androidx.xr.glimmer.list.GlimmerLazyListState)` for the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`. |

## Extension functions summary

|---|---|
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListScope.https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/package-summary#(androidx.xr.glimmer.list.GlimmerLazyListScope).items(kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function2)( items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<T>, noinline key: ((item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?, noinline contentType: (item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemScope.(item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a list of items. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListScope.https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/package-summary#(androidx.xr.glimmer.list.GlimmerLazyListScope).itemsIndexed(kotlin.collections.List,kotlin.Function2,kotlin.Function2,kotlin.Function3)( items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<T>, noinline key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?, crossinline contentType: (index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a list of items where the content of an item is aware of its index. |

## Top-level functions

### SnapLayoutInfoProvider

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/list/GlimmerLazyListSnapLayoutInfoProvider.kt+function:SnapLayoutInfoProvider) Added in [1.0.0-alpha22](https://developer.android.com/jetpack/androidx/releases/xr-glimmer#1.0.0-alpha22)

```
fun SnapLayoutInfoProvider(state: GlimmerLazyListState): SnapLayoutInfoProvider
```

Creates a default instance of `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/package-summary#SnapLayoutInfoProvider(androidx.xr.glimmer.list.GlimmerLazyListState)` for the `https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyColumn.composable#GlimmerLazyColumn(androidx.compose.ui.Modifier,androidx.xr.glimmer.list.GlimmerLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,kotlin.Function1)`.

## Extension functions

### GlimmerLazyListScope.items

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/list/GlimmerLazyListScopes.kt+function:items)

```
inline fun <T : Any?> GlimmerLazyListScope.items(
    items: List<T>,
    noinline key: ((item) -> Any)? = null,
    noinline contentType: (item) -> Any? = { null },
    crossinline itemContent: @Composable GlimmerLazyListItemScope.(item) -> Unit
): Unit
```

Adds a list of items.

| Parameters |
|---|---|
| `items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<T>` | the data list |
| `noinline key: ((item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)? = null` | a factory of stable and unique keys representing the item. Using the same key for multiple items in the list is not allowed. Type of the key should be saveable via Bundle on Android. If null is passed the position in the list will represent the key. When you specify the key the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one. This can be overridden by calling 'requestScrollToItem' on the 'GlimmerLazyListState'. |
| `noinline contentType: (item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? = { null }` | a factory of the content types for the item. The item compositions of the same type could be reused more efficiently. Note that null is a valid type and items of such type will be considered compatible. |
| `crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemScope.(item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |

### GlimmerLazyListScope.itemsIndexed

Artifact: [androidx.xr.glimmer:glimmer](https://developer.android.com/jetpack/androidx/releases/xr-glimmer) [View Source](https://cs.android.com/search?q=file:androidx/xr/glimmer/list/GlimmerLazyListScopes.kt+function:itemsIndexed)

```
inline fun <T : Any?> GlimmerLazyListScope.itemsIndexed(
    items: List<T>,
    noinline key: ((index: Int, item) -> Any)? = null,
    crossinline contentType: (index: Int, item) -> Any? = { _, _ -> null },
    crossinline itemContent: @Composable GlimmerLazyListItemScope.(index: Int, item) -> Unit
): Unit
```

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

| Parameters |
|---|---|
| `items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<T>` | the data list |
| `noinline key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)? = null` | a factory of stable and unique keys representing the item. Using the same key for multiple items in the list is not allowed. Type of the key should be saveable via Bundle on Android. If null is passed the position in the list will represent the key. When you specify the key the scroll position will be maintained based on the key, which means if you add/remove items before the current visible item the item with the given key will be kept as the first visible one. |
| `crossinline contentType: (index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? = { _, _ -> null }` | a factory of the content types for the item. The item compositions of the same type could be reused more efficiently. Note that null is a valid type and items of such type will be considered compatible. |
| `crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/xr/glimmer/list/GlimmerLazyListItemScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |