# LazyGridItemInfo

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

  ```
  sealed interface LazyGridItemInfo
  ```

*** ** * ** ***

Contains useful information about an individual item in lazy grids like `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyVerticalGrid.composable#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow,kotlin.Function1)`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridLayoutInfo` |   |

## Summary

| ### Constants |
|---|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#UnknownColumn()` Possible value for `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#column()`, when they are unknown. | Cmn |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#UnknownRow()` Possible value for `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#row()`, when they are unknown. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#column()` The column occupied by the top start point of the item. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#contentType()` The content type of the item which was passed to the item() or items() function. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#index()` The index of the item in the grid. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#key()` The key of the item which was passed to the item() or items() function. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#offset()` The offset of the item in pixels. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#row()` The row occupied by the top start point of the item. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#size()` The pixel size of the item. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#span()` The horizontal span of the item if it's in a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyVerticalGrid.composable#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow,kotlin.Function1)` or the vertical span if the item is in a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyHorizontalGrid.composable#LazyHorizontalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow,kotlin.Function1)`. | Cmn |

## Constants

### UnknownColumn

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

```
const val UnknownColumn: Int
```

Possible value for `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#column()`, when they are unknown. This can happen when the item is visible while animating to exit the viewport.

### UnknownRow

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

```
const val UnknownRow: Int
```

Possible value for `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#row()`, when they are unknown. This can happen when the item is visible while animating to exit the viewport.

## Public properties

### column

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

```
val column: Int
```

The column occupied by the top start point of the item. If this is unknown, for example while this item is animating to exit the viewport and is still visible, the value will be `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#UnknownColumn()`.

### contentType

Cmn Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.5.0)

```
val contentType: Any?
```

The content type of the item which was passed to the item() or items() function.

### index

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

```
val index: Int
```

The index of the item in the grid.

### key

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

```
val key: Any
```

The key of the item which was passed to the item() or items() function.

### offset

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

```
val offset: IntOffset
```

The offset of the item in pixels. It is relative to the top start of the lazy grid container.

### row

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

```
val row: Int
```

The row occupied by the top start point of the item. If this is unknown, for example while this item is animating to exit the viewport and is still visible, the value will be `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridItemInfo#UnknownRow()`.

### size

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

```
val size: IntSize
```

The pixel size of the item. Note that if you emit multiple layouts in the composable slot for the item then this size will be calculated as the max of their sizes.

### span

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.8.0)

```
val span: Int
```

The horizontal span of the item if it's in a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyVerticalGrid.composable#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow,kotlin.Function1)` or the vertical span if the item is in a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyHorizontalGrid.composable#LazyHorizontalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,androidx.compose.foundation.OverscrollEffect,androidx.compose.foundation.lazy.layout.LazyLayoutCacheWindow,kotlin.Function1)`.

Note, `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/LazyGridLayoutInfo#maxSpan()` can be used to get the maximum number of spans in a line, e.g., to check if the item is filling the whole line.