---
title: "windowInsetsStartWidth"
description: "Sets the width to that of [insets] at the [start][androidx.compose.ui.Alignment.Start] of the
screen, using either [left][WindowInsets.getLeft] or [right][WindowInsets.getRight], depending on
the [LayoutDirection].

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.windowInsetsStartWidth(insets: WindowInsets) =
    this then
        DerivedWidthModifierElement(
            insets,
            debugInspectorInfo {
                name = "insetsStartWidth"
                properties["insets"] = insets
            },
            startCalc,
        )
```


Sets the width to that of `insets` at the `start` of the
screen, using either `left` or `right`, depending on
the `LayoutDirection`.

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



## Code Examples
### insetsStartWidthSample
```kotlin
fun insetsStartWidthSample() {
    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 start
                    Box(
                        Modifier.windowInsetsStartWidth(WindowInsets.navigationBars)
                            .fillMaxHeight()
                            .align(Alignment.CenterStart)
                            .background(Color.Red)
                    )
                    // app content
                }
            }
        }
    }
}
```

