---
title: "WindowInsets"
description: "A representation of window insets that tracks access to enable recomposition, relayout, and
redrawing when values change. These values should not be read during composition to avoid doing
composition for every frame of an animation. Use methods like [Modifier.windowInsetsPadding],
[Modifier.systemBarsPadding], and [Modifier.windowInsetsTopHeight] for Modifiers that will not
cause recomposition when values change.

Use the [WindowInsets.Companion] extensions to retrieve [WindowInsets] for the current window."
type: "interface"
---

<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface WindowInsets
```


A representation of window insets that tracks access to enable recomposition, relayout, and
redrawing when values change. These values should not be read during composition to avoid doing
composition for every frame of an animation. Use methods like `Modifier.windowInsetsPadding`,
`Modifier.systemBarsPadding`, and `Modifier.windowInsetsTopHeight` for Modifiers that will not
cause recomposition when values change.

Use the `WindowInsets.Companion` extensions to retrieve `WindowInsets` for the current window.


## Functions

```kotlin
fun getLeft(density: Density, layoutDirection: LayoutDirection): Int
```


The space, in pixels, at the left of the window that the inset represents.


```kotlin
fun getTop(density: Density): Int
```


The space, in pixels, at the top of the window that the inset represents.


```kotlin
fun getRight(density: Density, layoutDirection: LayoutDirection): Int
```


The space, in pixels, at the right of the window that the inset represents.


```kotlin
fun getBottom(density: Density): Int
```


The space, in pixels, at the bottom of the window that the inset represents.



