# ScalingLazyListScope

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/lazy/ScalingLazyColumn.kt+class:androidx.wear.compose.foundation.lazy.ScalingLazyListScope) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

<br />

```
@ScalingLazyScopeMarker
sealed interface ScalingLazyListScope
```

<br />

*** ** * ** ***

Receiver scope which is used by `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyColumn.composable#ScalingLazyColumn(androidx.compose.ui.Modifier,androidx.wear.compose.foundation.lazy.ScalingLazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.wear.compose.foundation.lazy.ScalingParams,androidx.wear.compose.foundation.lazy.ScalingLazyListAnchorType,androidx.wear.compose.foundation.lazy.AutoCenteringParams,androidx.wear.compose.foundation.rotary.RotaryScrollableBehavior,androidx.compose.foundation.OverscrollEffect,kotlin.Function1)`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#item(kotlin.Any,kotlin.Function1)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Adds a single item. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function2)( count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?, itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function2)` of items. |

| ### Extension functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).expandableButton(androidx.wear.compose.foundation.ExpandableState,kotlin.Any,kotlin.Function0)( state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState, key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a single item, for the button that controls expandable item(s). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).expandableItem(androidx.wear.compose.foundation.ExpandableState,kotlin.Any,kotlin.Function1)( state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState, key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a single item, that will be expanded/collapsed according to the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).expandableItems(androidx.wear.compose.foundation.ExpandableState,kotlin.Int,kotlin.Function1,kotlin.Function2)( state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState, count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)?, itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds a series of items, that will be expanded/collapsed according to the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` |
| `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/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).items(kotlin.Array,kotlin.Function1,kotlin.Function2)( items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<T>, noinline key: ((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/wear/compose/foundation/lazy/ScalingLazyListItemScope.(item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` Adds an array 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/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).items(kotlin.collections.List,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)?, crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(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/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).itemsIndexed(kotlin.Array,kotlin.Function2,kotlin.Function3)( items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/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 itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(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 an array of items where the content of an item is aware of its index. |
| `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/wear/compose/foundation/lazy/ScalingLazyListScope.https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#(androidx.wear.compose.foundation.lazy.ScalingLazyListScope).itemsIndexed(kotlin.collections.List,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 itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(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. |

## Public functions

### item

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

```
fun item(key: Any? = null, content: @Composable ScalingLazyListItemScope.() -> Unit): Unit
```

Adds a single item.

| Parameters |
|---|---|
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? = null` | a stable and unique key 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. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content of the item |

### items

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.2.0)

```
fun items(
    count: Int,
    key: ((index: Int) -> Any)? = null,
    itemContent: @Composable ScalingLazyListItemScope.(index: Int) -> Unit
): Unit
```

Adds a `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function2)` of items.

| Parameters |
|---|---|
| `count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the items count |
| `key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> 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. |
| `itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |

## Extension functions

### ScalingLazyListScope.expandableButton

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/Expandable.kt+function:expandableButton)

```
fun ScalingLazyListScope.expandableButton(
    state: ExpandableState,
    key: Any? = null,
    content: @Composable () -> Unit
): Unit
```

Adds a single item, for the button that controls expandable item(s). The button will be animated out when the corresponding expandables are expanded.

Example of an expandable text:

```kotlin
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.wear.compose.foundation.expandableButton
import androidx.wear.compose.foundation.expandableItem
import androidx.wear.compose.foundation.lazy.ScalingLazyColumn
import androidx.wear.compose.foundation.rememberExpandableState
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.OutlinedCompactChip
import androidx.wear.compose.material.Text

val expandableState = rememberExpandableState()

ScalingLazyColumn(modifier = Modifier.fillMaxSize()) {
    expandableItem(expandableState) { expanded ->
        Text(
            "Account Alert: you have made a large purchase.\n" +
                "We have noticed that a large purchase was charged to " +
                "your credit card account. " +
                "Please contact us if you did not perform this purchase. " +
                "Our Customer Service team is available 24 hours a day, " +
                "7 days a week to answer your account or product support question.",
            maxLines = if (expanded) 20 else 3,
            modifier = Modifier.padding(horizontal = 10.dp),
        )
    }

    expandableButton(expandableState) {
        OutlinedCompactChip(
            label = {
                Text("Show More")
                Spacer(Modifier.size(6.dp))
                Icon(painterResource(R.drawable.ic_expand_more_24), "Expand")
            },
            onClick = { expandableState.expanded = true },
        )
    }
}
```

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` | The `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` to connect this button to. |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? = null` | A stable and unique key 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. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable () -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed, this should usually be a CompactChip or OutlineCompactChip. |

### ScalingLazyListScope.expandableItem

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/Expandable.kt+function:expandableItem)

```
fun ScalingLazyListScope.expandableItem(
    state: ExpandableState,
    key: Any? = null,
    content: @Composable (expanded: Boolean) -> Unit
): Unit
```

Adds a single item, that will be expanded/collapsed according to the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState`.

Example of an expandable text:

```kotlin
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.wear.compose.foundation.expandableButton
import androidx.wear.compose.foundation.expandableItem
import androidx.wear.compose.foundation.lazy.ScalingLazyColumn
import androidx.wear.compose.foundation.rememberExpandableState
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.OutlinedCompactChip
import androidx.wear.compose.material.Text

val expandableState = rememberExpandableState()

ScalingLazyColumn(modifier = Modifier.fillMaxSize()) {
    expandableItem(expandableState) { expanded ->
        Text(
            "Account Alert: you have made a large purchase.\n" +
                "We have noticed that a large purchase was charged to " +
                "your credit card account. " +
                "Please contact us if you did not perform this purchase. " +
                "Our Customer Service team is available 24 hours a day, " +
                "7 days a week to answer your account or product support question.",
            maxLines = if (expanded) 20 else 3,
            modifier = Modifier.padding(horizontal = 10.dp),
        )
    }

    expandableButton(expandableState) {
        OutlinedCompactChip(
            label = {
                Text("Show More")
                Spacer(Modifier.size(6.dp))
                Icon(painterResource(R.drawable.ic_expand_more_24), "Expand")
            },
            onClick = { expandableState.expanded = true },
        )
    }
}
```

The item should support two levels of information display (for example, a text showing a few lines in the collapsed state, and more in the expanded state)

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` | The `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` connected to this item. |
| `key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html? = null` | A stable and unique key 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. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (expanded: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by the item, according to its expanded/collapsed state. |

### ScalingLazyListScope.expandableItems

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/Expandable.kt+function:expandableItems)

```
fun ScalingLazyListScope.expandableItems(
    state: ExpandableState,
    count: Int,
    key: ((index: Int) -> Any)? = null,
    itemContent: @Composable BoxScope.(index: Int) -> Unit
): Unit
```

Adds a series of items, that will be expanded/collapsed according to the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState`

Example of an expandable list:

```kotlin
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import androidx.wear.compose.foundation.expandableButton
import androidx.wear.compose.foundation.expandableItem
import androidx.wear.compose.foundation.expandableItems
import androidx.wear.compose.foundation.lazy.ScalingLazyColumn
import androidx.wear.compose.foundation.rememberExpandableState
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.Icon
import androidx.wear.compose.material.OutlinedCompactChip
import androidx.wear.compose.material.Text

val expandableState = rememberExpandableState()

val sampleItem: @Composable (String) -> Unit = { label ->
    Chip(label = { Text(label) }, onClick = {}, secondaryLabel = { Text("line 2 - Secondary") })
}

val items = List(10) { "Item $it" }
val top = items.take(3)
val rest = items.drop(3)

ScalingLazyColumn(modifier = Modifier.fillMaxSize()) {
    items(top.size) { sampleItem(top[it]) }
    expandableItems(expandableState, rest.size) { sampleItem(rest[it]) }
    expandableButton(expandableState) {
        OutlinedCompactChip(
            label = {
                Text("Show More")
                Spacer(Modifier.size(6.dp))
                Icon(painterResource(R.drawable.ic_expand_more_24), "Expand")
            },
            onClick = { expandableState.expanded = true },
        )
    }
}
```

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` | The `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/ExpandableState` connected to these items. |
| `count: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of items |
| `key: ((index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> 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. |
| `itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/layout/BoxScope.(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |

### ScalingLazyListScope.items

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/lazy/ScalingLazyColumn.kt+function:items)

```
inline fun <T : Any?> ScalingLazyListScope.items(
    items: Array<T>,
    noinline key: ((item) -> Any)? = null,
    crossinline itemContent: @Composable ScalingLazyListItemScope.(item) -> Unit
): Unit
```

Adds an array of items.

| Parameters |
|---|---|
| `items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<T>` | the data array |
| `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. |
| `crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |

### ScalingLazyListScope.items

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/lazy/ScalingLazyColumn.kt+function:items)

```
inline fun <T : Any?> ScalingLazyListScope.items(
    items: List<T>,
    noinline key: ((item) -> Any)? = null,
    crossinline itemContent: @Composable ScalingLazyListItemScope.(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. |
| `crossinline itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(item) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | the content displayed by a single item |

### ScalingLazyListScope.itemsIndexed

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/lazy/ScalingLazyColumn.kt+function:itemsIndexed)

```
inline fun <T : Any?> ScalingLazyListScope.itemsIndexed(
    items: Array<T>,
    noinline key: ((index: Int, item) -> Any)? = null,
    crossinline itemContent: @Composable ScalingLazyListItemScope.(index: Int, item) -> Unit
): Unit
```

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

| Parameters |
|---|---|
| `items: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<T>` | the data array |
| `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 itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(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 |

### ScalingLazyListScope.itemsIndexed

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/lazy/ScalingLazyColumn.kt+function:itemsIndexed)

```
inline fun <T : Any?> ScalingLazyListScope.itemsIndexed(
    items: List<T>,
    noinline key: ((index: Int, item) -> Any)? = null,
    crossinline itemContent: @Composable ScalingLazyListItemScope.(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 itemContent: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/lazy/ScalingLazyListItemScope.(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 |