ConnectivityStripLayout

fun ConnectivityStripLayout(monitor: ConnectivityMonitor, modifier: Modifier = Modifier, enabled: Boolean = true, position: StripPosition = StripPosition.Top, mode: StripMode = StripMode.PushContent, scrimColor: Color = MaterialTheme.colorScheme.surface, enter: EnterTransition = ConnectivityStripDefaults.enter(position), exit: ExitTransition = ConnectivityStripDefaults.exit(position), backOnline: BackOnlineConfig? = null, strip: @Composable (ConnectivityStripState) -> Unit = { ConnectivityStrip(it) }, content: @Composable () -> Unit)(source)

Wraps the app's root content and shows the connectivity strip while monitor reports offline. Add it once, around the root navigation host; no screen needs to change.

Collection is lifecycle-aware, so monitoring stops shortly after the app goes to the background.

Parameters

enabled

false hides the strip, e.g. on the splash screen.

scrimColor

colour of the system-bar spacer next to the strip in StripMode.PushContent (status bar for StripPosition.Top, navigation bar for StripPosition.Bottom). It keeps dark status-bar icons readable in an edge-to-edge app. Color.Unspecified leaves it transparent.

backOnline

shows a short "Back online" confirmation after an offline period; null (default) hides at once.

strip

the strip itself. Replace it with any composable; it receives what to show.


fun ConnectivityStripLayout(isConnected: Boolean, modifier: Modifier = Modifier, enabled: Boolean = true, position: StripPosition = StripPosition.Top, mode: StripMode = StripMode.PushContent, scrimColor: Color = MaterialTheme.colorScheme.surface, enter: EnterTransition = ConnectivityStripDefaults.enter(position), exit: ExitTransition = ConnectivityStripDefaults.exit(position), backOnline: BackOnlineConfig? = null, strip: @Composable (ConnectivityStripState) -> Unit = { ConnectivityStrip(it) }, content: @Composable () -> Unit)(source)

Like the monitor overload, driven by a plain isConnected value (from your own state holder, a ViewModel, or a test).