---
title: "LazyGridDefaults"
description: "Contains the default values used by [LazyVerticalGrid] and [LazyHorizontalGrid]."
type: "object"
lastmod: "2026-09-24"
---
## API Reference

> Source set: Common

```kotlin
public object LazyGridDefaults
```

Contains the default values used by [LazyVerticalGrid](/jetpack-compose/androidx.compose.foundation/foundation/composable-functions/LazyVerticalGrid/api) and [LazyHorizontalGrid](/jetpack-compose/androidx.compose.foundation/foundation/composable-functions/LazyHorizontalGrid/api).

## Functions

### cacheWindow

> Source set: Common

```kotlin
@Composable
    public fun cacheWindow(state: LazyGridState): LazyLayoutCacheWindow
```

Creates and remembers the default [LazyLayoutCacheWindow](/jetpack-compose/androidx.compose.foundation/foundation/functions/LazyLayoutCacheWindow/api) for [LazyVerticalGrid](/jetpack-compose/androidx.compose.foundation/foundation/composable-functions/LazyVerticalGrid/api) and
[LazyHorizontalGrid](/jetpack-compose/androidx.compose.foundation/foundation/composable-functions/LazyHorizontalGrid/api).
- Prefetches items ahead in the scroll direction based on the average size of visible lines
from [state](/jetpack-compose/androidx.compose.foundation/foundation/functions/state/api), clamped between 10% and 50% of the viewport.
- Does not retain items behind the viewport.
- Does not cache while the user is not scrolling.

#### Parameters

| | |
| --- | --- |
| state | the [LazyGridState](/jetpack-compose/androidx.compose.foundation/foundation/classes/LazyGridState) used to calculate the average visible line size |

#### Return

the default [LazyLayoutCacheWindow](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/LazyLayoutCacheWindow)
