# suppressStatusBar

> Suppresses the status bar and collapses top status bar inset padding to 0.dp.

## API Reference

### suppressStatusBar

> Source set: Android

```kotlin
@Stable public fun Modifier.suppressStatusBar(): Modifier
```

Suppresses the status bar and collapses top status bar inset padding to 0.dp.

In cases where the system status bar overlay is not yet supported by the platform, the fallback
[TimeText](https://composables.com/jetpack-compose/androidx.wear.compose/compose-material3/components/TimeText/api.md) will also be suppressed for consistency. Outside of a scaffold (such as in a
standalone dialog or overlay window), hides the status bar directly on the current window and
restores the initial visibility state when leaving composition or becoming inactive.

For design guidance and best practices on status bar suppression and immersive experiences on
Wear OS, see the [Status Bar](https://developer.android.com/training/wearables/status-bar) guide.

**Layout-Phase Usage:** When using [ScreenScaffold](https://composables.com/jetpack-compose/androidx.wear.compose/compose-material3/components/ScreenScaffold/api.md), pass `contentPadding` directly to containers
like TransformingLazyColumn as content padding or to layout modifiers (such as
`Modifier.padding(contentPadding)`) rather than inspecting `contentPadding.calculateTopPadding()`
directly during the composition phase. Inspecting padding values during composition before the
first layout pass can observe initial unsuppressed insets before suppression nodes are fully
attached, whereas layout modifiers evaluate insets during measure/layout where suppression state
is fully resolved:
```
// Recommended (evaluated in layout phase after child nodes attach):
ScreenScaffold { contentPadding ->
Box(modifier = Modifier.fillMaxSize().padding(contentPadding)) {
DatePicker() // Suppresses status bar internally
}
}

// Avoid (eager composition read before child nodes attach):
ScreenScaffold { contentPadding ->
val topPadding = contentPadding.calculateTopPadding()
DatePicker() // Suppresses status bar internally
}
```

Example of status bar suppression for an individual component or overlay within a screen (such as
a picker or media player):

Example of status bar suppression if only a specific screen in your app should be full-screen /
immersive:

Example of status bar suppression if the entire application (or Activity) is an immersive
full-screen experience across all screens - this is not recommended for most apps because users
will lose access to the time and important status indicators on every screen:

## Code Examples

### ComponentSuppressStatusBarSample

```kotlin
@Sampled
@Composable
fun ComponentSuppressStatusBarSample() {
    // Suppress the status bar to avoid overlapping with the full-screen circular progress
    // indicator.
    Box(
        modifier =
            Modifier.suppressStatusBar()
                .background(MaterialTheme.colorScheme.background)
                .padding(CircularProgressIndicatorDefaults.FullScreenPadding)
                .fillMaxSize()
    ) {
        CircularProgressIndicator(progress = { 0.75f }, startAngle = 120f, endAngle = 60f)
    }
}
```

### ScreenScaffoldSuppressStatusBarSample

```kotlin
@Sampled
@Composable
fun ScreenScaffoldSuppressStatusBarSample() {
    // Suppress the status bar for a screen and collapse its insets to 0.dp.
    ScreenScaffold(modifier = Modifier.suppressStatusBar()) { contentPadding ->
        Box(
            modifier =
                Modifier.background(MaterialTheme.colorScheme.background)
                    .fillMaxSize()
                    .padding(contentPadding)
                    .padding(CircularProgressIndicatorDefaults.FullScreenPadding)
        ) {
            CircularProgressIndicator(progress = { 0.75f }, startAngle = 120f, endAngle = 60f)
        }
    }
}
```

### AppScaffoldSuppressStatusBarSample

```kotlin
@Sampled
@Composable
fun AppScaffoldSuppressStatusBarSample() {
    // Suppress the status bar for the entire application and collapse insets on all child screens.
    // Note: App-level suppression is not recommended for most apps because users will lose access
    // to the time and important status indicators on every screen.
    AppScaffold(modifier = Modifier.suppressStatusBar()) {
        ScreenScaffold { contentPadding ->
            Box(
                modifier =
                    Modifier.background(MaterialTheme.colorScheme.background)
                        .fillMaxSize()
                        .padding(contentPadding),
                contentAlignment = Alignment.Center,
            ) {
                Text("App-level suppression")
            }
        }
    }
}
```
