---
title: "windowInsetsBottomHeight"
description: "Sets the height to that of [insets] at the [bottom][WindowInsets.getBottom] of the screen.

When used, the [WindowInsets][android.view.WindowInsets] will respect the consumed insets from
[windowInsetsPadding] and [consumeWindowInsets], but won't consume any insets."
type: "modifier"
---

<div class='type'>Compose Modifier</div>

<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Modifier.windowInsetsBottomHeight(insets: WindowInsets) =
    this then
        DerivedHeightModifierElement(
            insets,
            debugInspectorInfo {
                name = "insetsBottomHeight"
                properties["insets"] = insets
            },
            bottomCalc,
        )
```


Sets the height to that of `insets` at the `bottom` of the screen.

When used, the `WindowInsets` will respect the consumed insets from
`windowInsetsPadding` and `consumeWindowInsets`, but won't consume any insets.



## Code Examples
### insetsBottomHeightSample
```kotlin
fun insetsBottomHeightSample() {
    class SampleActivity : ComponentActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            WindowCompat.setDecorFitsSystemWindows(window, false)
            super.onCreate(savedInstanceState)
            setContent {
                Box(Modifier.fillMaxSize()) {
                    // Background for navigation bar at the bottom
                    Box(
                        Modifier.windowInsetsBottomHeight(WindowInsets.navigationBars)
                            .fillMaxWidth()
                            .align(Alignment.BottomCenter)
                            .background(Color.Red)
                    )
                    // app content
                }
            }
        }
    }
}
```

