Skip to content

Android components Navigation

StanceAdaptiveNavigation

Beta

Navigation that switches between bar, rail and drawer by window width.

  • PlatformAndroid, Jetpack Compose
  • Builds onNavigationBar, NavigationRail, PermanentNavigationDrawer
  • Kindcomposable

Preview

Rendered by the Jetpack Compose library, not drawn by hand.

StanceAdaptiveNavigation on AndroidStanceAdaptiveNavigation on AndroidStanceAdaptiveNavigation on Android
StanceAdaptiveNavigation, Light appearance
Light
StanceAdaptiveNavigation, Dark appearance
Dark
StanceAdaptiveNavigation, High contrast appearance
High contrast

Usage

kotlin
var selected by remember { mutableIntStateOf(0) }
StanceAdaptiveNavigation(
    items = destinations,
    selectedIndex = selected,
    onSelect = { selected = it },
    topBar = { StanceTopAppBar(destinations[selected].label) },
) { padding ->
    Text("Content", modifier = Modifier.padding(padding))
}

Accessibility

  • Order and selection are kept across layouts.

On other platforms