blob: 631957b28408e6d9c1c6d8c75b5792d0350e7483 [file] [log] [blame]
<html devsite="true">
<head>
<title>LazyStaggeredGridScope</title>
{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %}
{% include "_shared/_reference-head-tags.html" %}
</head>
<body>
<div itemscope="" itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="LazyStaggeredGridScope">
<meta itemprop="path" content="androidx.compose.foundation.lazy.staggeredgrid">
<meta itemprop="property" content="item(kotlin.Any,kotlin.Any,androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan,kotlin.Function1)">
<meta itemprop="property" content="items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">
<meta itemprop="property" content="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.Array,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">
<meta itemprop="property" content="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">
<meta itemprop="property" content="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.Array,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">
<meta itemprop="property" content="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.collections.List,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">
<meta itemprop="language" content="JAVA">
</div>
<div id="header-block">
<div>
<h1>LazyStaggeredGridScope</h1>
</div>
<div id="metadata-info-block">
<div id="source-link"><a href="https://cs.android.com/search?q=file:androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDsl.kt+class:androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope&amp;ss=androidx/platform/frameworks/support" class="external">View Source</a></div>
</div>
</div>
<div id="refdoc-switcher-placeholder"></div>
<p>
<pre>public sealed interface <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a></pre>
</p>
<hr>
<p>Receiver scope for <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/package-summary.html#LazyVerticalStaggeredGrid(androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.ui.unit.Dp,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,kotlin.Function1)">LazyVerticalStaggeredGrid</a></code> and <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/package-summary.html#LazyHorizontalStaggeredGrid(androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.ui.unit.Dp,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,kotlin.Function1)">LazyHorizontalStaggeredGrid</a></code></p>
<h2>Summary</h2>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Public methods</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>abstract void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#item(kotlin.Any,kotlin.Any,androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan,kotlin.Function1)">item</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;content<br>)</code></div>
<p>Add a single item to the staggered grid.</p>
</td>
</tr>
<tr>
<td><code>abstract void</code></td>
<td>
<div><code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;count,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</code></div>
<p>Add a <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">count</a></code> of items to the staggered grid.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%"><h3>Extension functions</h3></th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>default&nbsp;final void</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.Array,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</code></div>
<p>Add an array of items to the staggered grid.</p>
</td>
</tr>
<tr>
<td><code>default&nbsp;final void</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</code></div>
<p>Add a list of items to the staggered grid.</p>
</td>
</tr>
<tr>
<td><code>default&nbsp;final void</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.Array,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">itemsIndexed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</code></div>
<p>Add an array of items with index-aware content to the staggered grid.</p>
</td>
</tr>
<tr>
<td><code>default&nbsp;final void</code></td>
<td>
<div><code>&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.collections.List,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">itemsIndexed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</code></div>
<p>Add a list of items with index-aware content to the staggered grid.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="list">
<h2>Public methods</h2>
<div class="api-item"><a name="item(kotlin.Any, kotlin.Any, androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan, kotlin.Function1)"></a><a name="item-kotlin.Any-kotlin.Any-androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan-kotlin.Function1-"></a><a name="item"></a>
<div class="api-name-block">
<div>
<h3 id="item(kotlin.Any,kotlin.Any,androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan,kotlin.Function1)">item</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">abstract&nbsp;void&nbsp;<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#item(kotlin.Any,kotlin.Any,androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan,kotlin.Function1)">item</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;content<br>)</pre>
<p>Add a single item to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code><a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;key</code></td>
<td>
<p>a stable and unique key representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code><a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&nbsp;contentType</code></td>
<td>
<p>a content type representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&nbsp;span</code></td>
<td>
<p>a custom span for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;content</code></td>
<td>
<p>composable content displayed by current item</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="items(kotlin.Int, kotlin.Function1, kotlin.Function1, kotlin.Function1, kotlin.Function2)"></a><a name="items-kotlin.Int-kotlin.Function1-kotlin.Function1-kotlin.Function1-kotlin.Function2-"></a><a name="items"></a>
<div class="api-name-block">
<div>
<h3 id="items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">abstract&nbsp;void&nbsp;<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;count,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</pre>
<p>Add a <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">count</a></code> of items to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>int&nbsp;count</code></td>
<td>
<p>number of items to add.</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key</code></td>
<td>
<p>a factory of stable and unique keys representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType</code></td>
<td>
<p>a factory of content types representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span</code></td>
<td>
<p>a factory of custom spans for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent</code></td>
<td>
<p>composable content displayed by item on provided position</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="list">
<h2>Extension functions</h2>
<div class="api-item"><a name="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.Array, kotlin.Function1, kotlin.Function1, kotlin.Function1, kotlin.Function2)"></a><a name="-androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope-.items-kotlin.Array-kotlin.Function1-kotlin.Function1-kotlin.Function1-kotlin.Function2-"></a><a name="items"></a>
<div class="api-name-block">
<div>
<h3 id="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.Array,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">LazyStaggeredGridDslKt.items</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">default&nbsp;final&nbsp;void&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.Array,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</pre>
<p>Add an array of items to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items</code></td>
<td>
<p>a data array to present</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key</code></td>
<td>
<p>a factory of stable and unique keys representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType</code></td>
<td>
<p>a factory of content types representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span</code></td>
<td>
<p>a factory of custom spans for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent</code></td>
<td>
<p>composable content displayed by the provided item</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.collections.List, kotlin.Function1, kotlin.Function1, kotlin.Function1, kotlin.Function2)"></a><a name="-androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope-.items-kotlin.collections.List-kotlin.Function1-kotlin.Function1-kotlin.Function1-kotlin.Function2-"></a><a name="items"></a>
<div class="api-name-block">
<div>
<h3 id="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">LazyStaggeredGridDslKt.items</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">default&nbsp;final&nbsp;void&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).items(kotlin.collections.List,kotlin.Function1,kotlin.Function1,kotlin.Function1,kotlin.Function2)">items</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</pre>
<p>Add a list of items to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items</code></td>
<td>
<p>a data list to present</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key</code></td>
<td>
<p>a factory of stable and unique keys representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType</code></td>
<td>
<p>a factory of content types representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code>Function1&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span</code></td>
<td>
<p>a factory of custom spans for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent</code></td>
<td>
<p>composable content displayed by the provided item</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.Array, kotlin.Function2, kotlin.Function2, kotlin.Function2, kotlin.Function3)"></a><a name="-androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope-.itemsIndexed-kotlin.Array-kotlin.Function2-kotlin.Function2-kotlin.Function2-kotlin.Function3-"></a><a name="itemsindexed"></a>
<div class="api-name-block">
<div>
<h3 id="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.Array,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">LazyStaggeredGridDslKt.itemsIndexed</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">default&nbsp;final&nbsp;void&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.Array,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">itemsIndexed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</pre>
<p>Add an array of items with index-aware content to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T[]&nbsp;items</code></td>
<td>
<p>a data array to present</p>
</td>
</tr>
<tr>
<td><code>Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key</code></td>
<td>
<p>a factory of stable and unique keys representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType</code></td>
<td>
<p>a factory of content types representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code>Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span</code></td>
<td>
<p>a factory of custom spans for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent</code></td>
<td>
<p>composable content displayed given item and index</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="api-item"><a name="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.collections.List, kotlin.Function2, kotlin.Function2, kotlin.Function2, kotlin.Function3)"></a><a name="-androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope-.itemsIndexed-kotlin.collections.List-kotlin.Function2-kotlin.Function2-kotlin.Function2-kotlin.Function3-"></a><a name="itemsindexed"></a>
<div class="api-name-block">
<div>
<h3 id="(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.collections.List,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">LazyStaggeredGridDslKt.itemsIndexed</h3>
</div>
</div>
<pre class="api-signature no-pretty-print">default&nbsp;final&nbsp;void&nbsp;&lt;T&nbsp;extends&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt; <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDslKt.html">LazyStaggeredGridDslKt</a>.<a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html#(androidx.compose.foundation.lazy.staggeredgrid.LazyStaggeredGridScope).itemsIndexed(kotlin.collections.List,kotlin.Function2,kotlin.Function2,kotlin.Function2,kotlin.Function3)">itemsIndexed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridScope.html">LazyStaggeredGridScope</a>&nbsp;receiver,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType,<br>&nbsp;&nbsp;&nbsp;&nbsp;Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span,<br>&nbsp;&nbsp;&nbsp;&nbsp;@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent<br>)</pre>
<p>Add a list of items with index-aware content to the staggered grid.</p>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup>
<col width="40%">
<col>
</colgroup>
<thead>
<tr>
<th colspan="100%">Parameters</th>
</tr>
</thead>
<tbody class="list">
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a>&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> T&gt;&nbsp;items</code></td>
<td>
<p>a data list to present</p>
</td>
</tr>
<tr>
<td><code>Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;key</code></td>
<td>
<p>a factory of stable and unique keys representing the item. The key MUST be saveable via Bundle on Android. If set to null (by default), the position of the item will be used as a key instead. Using the same key for multiple items in the staggered grid is not allowed.</p>
<p>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.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>&gt;&nbsp;contentType</code></td>
<td>
<p>a factory of content types representing the item. Content for item of the same type can be reused more efficiently. null is a valid type as well and items of such type will be considered compatible.</p>
</td>
</tr>
<tr>
<td><code>Function2&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridItemSpan.html">StaggeredGridItemSpan</a>&gt;&nbsp;span</code></td>
<td>
<p>a factory of custom spans for this item. Spans configure how many lanes defined by <code><a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/StaggeredGridCells.html">StaggeredGridCells</a></code> the item will occupy. By default each item will take one lane.</p>
</td>
</tr>
<tr>
<td><code>@<a href="/reference/androidx/compose/runtime/Composable.html">Composable</a> @<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-extension-function-type/index.html">ExtensionFunctionType</a> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function3&lt;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridItemScope.html">LazyStaggeredGridItemScope</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/lang/Integer.html">Integer</a>,&nbsp;@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> item,&nbsp;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>&gt;&nbsp;itemContent</code></td>
<td>
<p>composable content displayed given item and index</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>