
Maps Navigation 3 back-stacks to native navigation and tab controllers, enabling real push/pop transitions, edge-swipe cancellation, independent tab stacks with state retention, badges, search, and per-entry ViewModels.
Navigate natively.
Native navigation for Compose Multiplatform.
English | 한국어
Navite (나바이트) combines Navigation and Native. It rearranges the letters of Native to begin with Nav, the opening of Navigation.
Keep one Kotlin Navigation 3 structure while each platform uses its own navigation UI. On iOS, Navite connects Kotlin back stacks directly to real UIKit UITabBarController and UINavigationController instances through Kotlin/Native. Android, desktop, and web run your app's NavDisplay and navigation UI through the otherPlatforms block.
Routes, back stacks, entry providers, screens, ViewModels, and the root App() stay in common code.
UISearchController search.NativeStack and NativeTabs, such as sign-in and main flows.UIDesignRequiresCompatibility. Earlier supported iOS versions use their native system appearance.Kotlin owns the back stack. Native pops call the app's back callback once per removed entry; cancelled gestures leave the Kotlin stack unchanged. A new Kotlin back stack received during a transition takes precedence; the earlier native pop is not applied again to that new stack.
Add the dependencies to commonMain in your existing Compose Multiplatform shared module. Set the iOS deployment target to 18.2 or newer. Use a published Navite version for <version> when the first release is available, or build locally as shown below.
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}// shared/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("zone.ien.navite:navite:<version>")
implementation("org.jetbrains.androidx.navigation3:navigation3-ui:1.2.0")
}
}
}The library exposes androidx.navigation3:navigation3-runtime:1.2.1 transitively. The example uses navigation3-ui to render NavDisplay outside iOS. To run the examples below, apply the serialization plugin matching your app's Kotlin version and add Compose Material 3. If you use per-entry ViewModels, also add org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3:2.11.0. Project version catalog
To test a local source build, run ./gradlew :library:publishToMavenLocal from the repository root and put mavenLocal() before mavenCentral() in the app's repositories. For this checkout, use the lib-version-name from the version catalog as <version>. You can also use a project dependency when the library module is part of the same build. Example dependency configuration
compose-swift-navigation3 is now Navite. Switch the Gradle dependency or version catalog entry from zone.ien.navigation:navigation to zone.ien.navite:navite and update Kotlin imports from zone.ien.navigation to zone.ien.navite. Public class and function names remain the same. Rebuild every module that depends on the library.
Earlier releases, including 1.0.0-alpha04, remain available under the original coordinates. Use a version published under the new coordinates when switching to Maven Central. Local source builds use the version in this checkout. Legacy Maven Central releases
The publishing workflow runs when a GitHub Release or prerelease is published. Its tag must match lib-version-name in gradle/libs.versions.toml. After the full CI passes for the same release commit, it signs all library targets, uploads them to Maven Central, and automatically releases them.
Configure the same Actions Secrets as compose-hig: SONATYPE_USERNAME, SONATYPE_PASSWORD (Central Portal token), GPG_KEY (ASCII-armored private key), and GPG_PASSWORD (key passphrase). The Central Portal account must have permission to publish zone.ien.navite, and the signing public key must be available on a key server. The workflow does not print secret values.
Use NativeStack for an app without tabs. Put the following App.kt in the shared module's commonMain. Register the NavKey subtypes in SavedStateConfiguration so the back stack can be saved across platforms. Apply the app theme to each screen through NativeNavigationFrame.frame.
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.ui.NavDisplay
import androidx.savedstate.serialization.SavedStateConfiguration
import kotlinx.serialization.Serializable
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass
import zone.ien.navite.NativeNavigationFrame
import zone.ien.navite.NativeStack
import zone.ien.navite.nativeContentPadding
import zone.ien.navite.nativeScreen
@Serializable data object Home : NavKey
@Serializable data class Detail(val id: Int) : NavKey
private val navigationConfiguration = SavedStateConfiguration {
serializersModule = SerializersModule {
polymorphic(NavKey::class) {
subclass(Home::class)
subclass(Detail::class)
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun App() {
NativeNavigationFrame(frame = { content -> MaterialTheme { content() } }) {
val backStack = rememberNavBackStack(navigationConfiguration, Home)
val provider = remember(backStack) {
entryProvider<NavKey> {
entry<Home>(metadata = nativeScreen(title = "Home")) {
Button(
onClick = { backStack.add(Detail(1)) },
modifier = Modifier.padding(nativeContentPadding()),
) { Text(text = "Open detail") }
}
entry<Detail>(metadata = { key -> nativeScreen(title = "Detail ${key.id}") }) { key ->
Text(text = "Detail ${key.id}", modifier = Modifier.padding(nativeContentPadding()))
}
}
}
NativeStack(backStack = backStack, entryProvider = provider) {
Scaffold(
topBar = {
TopAppBar(
title = { Text(text = title.orEmpty()) },
navigationIcon = {
if (canGoBack) TextButton(onClick = onBack) { Text(text = "Back") }
},
)
},
) { padding ->
NavDisplay(entries = entries, modifier = Modifier.padding(padding), onBack = onBack)
}
}
}
}Android calls setContent { App() } and Desktop calls App() inside its window. In the shared module's iosMain/MainViewController.kt, replace the existing ComposeUIViewController { App() } with the following.
import platform.UIKit.UIViewController
import zone.ien.navite.NativeNavigationViewController
fun MainViewController(): UIViewController = NativeNavigationViewController { App() }Return this controller from your existing SwiftUI UIViewControllerRepresentable. Shared is the example's Kotlin framework name. Use your own framework's baseName in the import.
import SwiftUI
import UIKit
import Shared
struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
MainViewControllerKt.MainViewController()
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}Place ComposeView().ignoresSafeArea() in the SwiftUI WindowGroup so UIKit manages the screen insets. A UIKit app can assign the result to window.rootViewController. Tap Open detail, then go back. iOS uses the system navigation controller, while Android and Desktop use the Material bar above. To try the complete repository example, run example/run-sample.sh ios or example/run-sample.sh android from the repository root.
Keep your routes, navigator, back stacks, entry provider, ViewModels, and screen back handlers. Make these scoped changes:
| Existing code | Change |
|---|---|
NavDisplay(backStack, entryProvider, entryDecorators, ...) |
Wrap it with NativeStack or NativeTabs; pass the decorated entries and onBack from its receiver to NavDisplay
|
Material Scaffold, top and bottom bars |
Keep them in otherPlatforms; render title, bar items, search, and tabs from NativeNavigationScope
|
| Screen titles | Declare static titles in nativeScreen; dynamic titles in NativeBarItems
|
Per-screen TopAppBar and back button |
Move to the app chrome, or hide existing screen chrome with if (!LocalNativeScreen.current)
|
| Theme, DI, root scaffold, snackbar host | Put DI locals in NativeNavigationFrame.providers; theme and screen UI wrappers in frame
|
Screen innerPadding
|
Use rememberNativeScroll(state) for scrolling screens or nativeContentPadding() otherwise |
| Outer stack over the tabs | Pass its detail entries to NativeTabs(sharedBackStack = ...), excluding the entry that represented the tabs |
iOS ComposeUIViewController { App() }
|
Use NativeNavigationViewController { App() }; embed with .ignoresSafeArea()
|
Check Android behavior after moving the chrome. On iOS, test push, native back, edge swipe and cancellation, large-title scrolling, tab state retention, shared screens, and optional restoration on both iOS 18.x (18.2+) and iOS 26+.
This walkthrough follows the Home and Settings tabs in App.kt. Complete installation first. If your Material 3 app does not use Navigation 3 yet, add NavKey routes, rememberNavBackStack, and an entryProvider as shown in Quick Start. The library does not inspect Material 3 screens automatically; declare the navigation structure and titles explicitly.
This fragment is the UI portion of an existing App(). stacks contains the per-tab back stacks, selectedTab is the selection state, and provider is the existing entry provider.
MaterialTheme {
Scaffold(
topBar = { TopAppBar(title = { Text(text = "Home") }) },
bottomBar = {
NavigationBar {
listOf("Home", "Settings").forEachIndexed { index, label ->
NavigationBarItem(
selected = selectedTab == index,
onClick = { selectedTab = index },
icon = { Text(text = label) },
)
}
}
},
) { padding ->
NavDisplay(
backStack = stacks[selectedTab],
entryProvider = provider,
onBack = { stacks[selectedTab].removeLastOrNull() },
modifier = Modifier.padding(padding),
)
}
}Keep the routes, per-tab back stacks, and navigation calls such as backStack.add(...). The sample's route and serialization declarations are in AppNavigation.kt.
The sample's App() declares both tab stacks and the native metadata for each route. Use the sample's screen implementations and routes to run this code. App.kt and imports · Screens.kt
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun App() {
val home = rememberNavBackStack(navigationConfiguration, HomeRoute)
val settings = rememberNavBackStack(navigationConfiguration, SettingsRoute)
var selectedTab by rememberSaveable { mutableIntStateOf(0) }
var pendingUpdates by rememberSaveable { mutableIntStateOf(0) }
val stacks = listOf(home, settings)
val openDetail: (Int) -> Unit = { id -> stacks[selectedTab].add(DetailRoute(id)) }
NativeNavigationFrame(frame = { content ->
val colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
MaterialTheme(colorScheme = colorScheme) {
Surface { NativeScrollContent { content() } }
}
}) {
NativeTabs(
tabs = listOf(
NativeTab("Home", "house", home),
NativeTab("Settings", "gearshape", settings, image = null, badgeCount = pendingUpdates),
),
selectedTab = selectedTab,
onTabSelected = { selectedTab = it },
entryProvider = entryProvider {
entry<HomeRoute>(metadata = nativeScreen(title = "Home", largeTitle = true)) {
HomeScreen(onOpenDetail = openDetail, onRefreshCompleted = { pendingUpdates++ })
}
entry<SettingsRoute>(metadata = nativeScreen(title = "Settings", largeTitle = true)) {
SettingsScreen(
pendingUpdates = pendingUpdates,
onClearUpdates = { pendingUpdates = 0 },
onOpenDetail = { openDetail(42) },
onOpenPreview = { settings.add(DetailRoute(id = 42, preview = true)) },
)
}
entry<DetailRoute>(metadata = { route ->
if (route.preview) {
nativeScreen(title = "미리보기", hidesNavigationBar = true)
} else {
nativeScreen(
title = "Detail ${route.id}",
initialTrailing = listOf(
nativeBarTransitionPlaceholder(
title = favoriteActionTitle,
systemImage = "star",
),
),
)
}
}) { route ->
if (route.preview) {
PreviewScreen(id = route.id, onBack = { settings.removeLastOrNull() })
} else {
DetailScreen(id = route.id)
}
}
},
) {
Scaffold(
topBar = {
TopAppBar(
title = { Text(text = title.orEmpty()) },
navigationIcon = {
if (canGoBack) TextButton(onClick = onBack) { Text(text = "Back") }
},
)
},
bottomBar = {
NavigationBar {
tabs.forEachIndexed { index, tab ->
NavigationBarItem(
selected = selectedTab == index,
onClick = { onTabSelected(index) },
icon = {
BadgedBox(badge = {
tab.badgeCount?.takeIf { it > 0 }?.let { count ->
Badge { Text(text = count.toString()) }
}
}) {
Text(text = tab.title)
}
},
)
}
}
},
) { padding ->
NavDisplay(entries = entries, onBack = onBack, modifier = Modifier.padding(padding))
}
}
}
}MaterialTheme or app theme to NativeNavigationFrame.frame. NativeScrollContent applies iOS scroll bounce to the screen content.NativeTabs, and add nativeScreen titles to entries. house and gearshape are iOS SF Symbols names; keep rendering Material icons in the existing NavigationBarItem.otherPlatforms. Android, Desktop, and other non-iOS platforms run the existing Scaffold there. Use the block's entries, onBack, title, canGoBack, tabs, and onTabSelected, and pass entries to NavDisplay instead of backStack and entryProvider.TopAppBar, wrap it in if (!LocalNativeScreen.current) to avoid duplicate chrome.NativeStack(backStack, entryProvider = provider) { ... } from Quick Start. If you already use a per-entry ViewModel decorator, move it to entryDecorators on NativeTabs or NativeStack.Reuse the existing LazyColumn state and connect both returned values. This fragment shows the scroll integration. The full HomeScreen includes pull-to-refresh and a bar subtitle. Screens.kt
val state = rememberLazyListState()
val scroll = rememberNativeScroll(state)
LazyColumn(
state = state,
userScrollEnabled = scroll.userScrollEnabled,
contentPadding = scroll.contentPadding,
modifier = Modifier.fillMaxSize(),
) {
items(50) { id ->
ListItem(
headlineContent = { Text(text = "Row $id") },
modifier = Modifier.clickable { onOpenDetail(id) },
)
}
}For a non-scrolling screen, apply Modifier.padding(nativeContentPadding()). On Android and other non-native platforms this native padding is zero, so keep using the Scaffold padding above. On iOS it supplies native bar and keyboard insets; do not add system-bar insets or imePadding() again. See Scrolling and content insets for details.
Replace the existing ComposeUIViewController { App() } with the following. Android and Desktop entry points continue calling App().
import zone.ien.navite.NativeNavigationViewController
fun MainViewController() = NativeNavigationViewController { App() }The existing SwiftUI UIViewControllerRepresentable uses this return value and is embedded with .ignoresSafeArea() (Quick Start bridge). After migration, check the Material bars and back navigation on Android, plus tab switching, detail push, the back button, edge swipe, and scrolling on iOS.
NativeNavigationFrame(
providers = { content -> CompositionLocalProvider(LocalAppGraph provides graph, content = content) },
frame = { content -> AppTheme { RootScaffold { content() } } },
) {
NativeStack(backStack = backStack, entryProvider = entryProvider) {
NavDisplay(entries = entries, onBack = onBack)
}
}This fragment uses your existing LocalAppGraph, graph, AppTheme, and RootScaffold.
providers { frame { content() } } wraps the app once. On iOS, every entry has its own controller and composition: providers wraps both the UI-free navigation host and each screen; frame wraps each screen.providers or outside frame/the navigation declaration's otherPlatforms block. The iOS host rejects UI nodes. Move app-level dialogs into screens, or use an implementation backed by a system alert on iOS.LocalUIViewController, and LocalDensity, so shared resource lookups and native alert integrations can work there. UI-dependent themes belong in frame.LocalNativeScreen.current inside screen content/frame to hide Compose chrome and apply imePadding() only outside native screens. Do not add system-bar insets again; native content padding already includes them.NavEntryDecorator instead of NativeNavigationFrame.rememberUpdatedState, or a ViewModel.MutableState returned by rememberSaveable directly. Copying to a saved value in SideEffect misses changes when the caller does not recompose.Public APIs live in zone.ien.navite. The common source and iOS source contain their declarations and KDoc.
| API | Purpose |
|---|---|
NativeStack, NativeTabs, NativeTab
|
Common declarations for a stack, tabs, and each tab's stack |
NativeNavigationScope<T> |
Decorated entries and chrome data passed to otherPlatforms
|
NativeNavigationFrame, LocalNativeScreen
|
App-wide providers/frame and native-screen detection |
nativeScreen, NavEntry.nativeTitle, nativeLargeTitle, nativeHidesTabBar, nativeTitleImage
|
Entry metadata and accessors |
rememberNativeScroll, NativeScroll, NativeScrollContent, nativeContentPadding, Modifier.nativeScrollExclusion()
|
Native vertical scroll, content bounce, and insets |
NativeNavigationTint, NativeTabBarTint
|
Navigation action and selected-tab tint |
NativeBarItems, NativeBarButton, NativeMenuAction, NativeBarContent
|
Bar declarations and data |
NativeSearchBar, NativeSearch
|
Search declaration and data |
NativeBarState, ProvideNativeBarState
|
Collect declarations around a plain NavDisplay without NativeStack/NativeTabs
|
NativeNavigationViewController, saveNativeNavigationState
|
iOS navigation host and optional state serialization |
ComposeScreenViewController |
iOS standalone Compose screen for an app-owned UINavigationController
|
Use observable back stacks (rememberNavBackStack or a snapshot state list). Navigation is ordinary list mutation:
backStack.add(Detail(3))
backStack.removeLastOrNull()
backStack[backStack.lastIndex] = Detail(103)
while (backStack.size > 1) backStack.removeLastOrNull()These are push, pop, replace, and pop-to-root respectively. For tabs, register every tab/shared route in your provider and serializer configuration, then declare:
val home = rememberNavBackStack(navigationConfiguration, Home)
val settings = rememberNavBackStack(navigationConfiguration, Settings)
val shared = rememberNavBackStack(navigationConfiguration)
var selectedTab by rememberSaveable { mutableIntStateOf(0) }
NativeTabs(
tabs = listOf(
NativeTab("Home", systemImage = "house", backStack = home),
NativeTab("Settings", systemImage = "gearshape", backStack = settings),
),
selectedTab = selectedTab,
onTabSelected = { selectedTab = it },
sharedBackStack = shared,
entryDecorators = listOf(
rememberSaveableStateHolderNavEntryDecorator(),
rememberViewModelStoreNavEntryDecorator(),
),
entryProvider = entryProvider,
) { MaterialChrome() }This fragment extends the quick start with your Settings route, provider, and NativeNavigationScope<NavKey>.MaterialChrome() renderer. The bundled sample puts the Material Scaffold and NavDisplay directly inside the block. App.kt
UITabBarController with one UINavigationController per tab. Each tab's decorated entries retain saveable state and ViewModels on other platforms too.sharedBackStack may be empty. Its screens always hide the tab bar and push above the selected tab. onSharedBack removes one shared entry. If the app changes selectedTab while a shared screen is visible, the shared screens move to the new tab without animation.NativeStack and NativeTab default onBack to removing the last entry when the supplied list is mutable. Custom callbacks, including onSharedBack, must pop exactly one entry. Otherwise UIKit and Kotlin diverge, and a subsequent stack change can push the screen again.NativeStack/NativeTabs default to the saveable-state decorator. Add rememberViewModelStoreNavEntryDecorator() when using per-entry ViewModels. Do not redecorate the entries passed to NavDisplay.NativeTabs and NativeStack with if (signedIn). iOS cross-fades between hierarchies and disposes the old screens; creating decorators inside each branch clears the departing flow's ViewModels and saveable state.
Tab icons can also use Compose Painter values: NativeTab(title = "Home", backStack = home, image = homePainter, selectedImage = selectedHomePainter). The host renders both images before the tab appears, fits them within 25×25pt, and uses UIKit template tint. image takes precedence over systemImage; omitting selectedImage uses the default tab image. The existing SF Symbols constructor and trailing onBack lambda remain supported.
Wrap NativeTabs in NativeTabBarTint(color) { ... } to set the selected tab icon and label tint. Color changes update the existing tab bar; Color.Unspecified restores the system tint. Unselected tab colors and bar appearance remain controlled by UIKit.
NativeNavigationTint supplies the iOS back-button, bar-action, and toolbar tint; NativeTabBarTint sets the selected tab icon and label tint. This fragment uses your existing appAccent, AppTheme, backStack, and provider.
import zone.ien.navite.NativeNavigationTint
import zone.ien.navite.NativeTabBarTint
NativeNavigationFrame(
providers = { content ->
NativeNavigationTint(appAccent) {
NativeTabBarTint(appAccent) { content() }
}
},
frame = { content -> AppTheme { NativeScrollContent { content() } } },
) {
NativeStack(backStack = backStack, entryProvider = provider) {
NavDisplay(entries = entries, onBack = onBack)
}
}For a tabbed app, replace NativeStack with the existing NativeTabs declaration. Pass a Color; Color.Unspecified restores each host's default tint. These providers do not change UI on other platforms; use the app's theme there. Unselected tab colors and system-bar backgrounds/appearance are not overridden.
Do not place these providers only inside the screen frame. iOS navigation is declared in a UI-free host composition, so put them in providers as above or wrap NativeStack/NativeTabs directly. Rather than reading screen-theme values such as MaterialTheme.colorScheme in the host, pass the app's chosen accent through State or a UI-free color-token provider.
The library draws no UI on these platforms. Read these NativeNavigationScope values in the block and render your existing components:
| Value | Meaning |
|---|---|
entries |
Selected tab/stack entries followed by shared entries, already decorated |
tabEntries, sharedEntries
|
The two lists separately, for an outer NavDisplay above the tabs |
onBack, canGoBack
|
Pop the visible stack, and whether another entry is below the top |
title, largeTitle, titleImage
|
Dynamic title or metadata fallback, large-title flag, and optional painter lambda |
leading, trailing, toolbar, search
|
Collected bar and search declarations |
tabs, selectedTab, onTabSelected
|
Tab configuration and selection; no tabs for NativeStack
|
tabBarVisible |
Tabs exist, no shared screen is shown, and no pushed tab entry hides the bar |
For an outer stack that covers the tab chrome, use listOf(NavEntry<NavKey>(TabsKey) { TabsChrome(tabEntries) }) + sharedEntries as its entries. TabsKey and TabsChrome belong to your app.
The most recently registered, still-composed screen's bar/search declarations win. An outgoing screen's declarations can remain temporarily when the incoming screen declares none. systemImage names are iOS SF Symbols; choose Android icons in your renderer. See App.kt for the minimal integration. Optional menus, toolbars, and search are omitted from the sample.
entry<Detail>(metadata = { key -> nativeScreen(title = "Detail ${key.id}", hidesTabBar = true) }) { key ->
DetailScreen(key.id)
}DetailScreen is your screen composable.
| Parameter | Default | iOS behavior |
|---|---|---|
title |
null |
navigationItem.title; set static titles before push starts |
largeTitle |
false |
A large title that collapses with scrolling; prefer it only on stack roots |
hidesNavigationBar |
Omitted | Set to true to hide the native navigation bar. Once a stack uses this option, screens that omit it show the bar. |
initialTrailing |
Omitted | Supplies trailing buttons at the start of a push. Use nativeBarTransitionPlaceholder for a disabled placeholder. NativeBarItems replaces these buttons after the transition. |
hidesTabBar |
false |
Uses UITabBarController; screens pushed above it also keep the bar hidden |
titleImage |
null |
A @Composable () -> Painter rendered as a 28pt-high titleView with its aspect ratio |
For a logo, use nativeScreen(title = "Home", titleImage = { painterResource(Res.drawable.logo) }) with your existing Compose resource. Keep title for VoiceOver and the next screen's back button. On iOS the painter runs in the host before push, outside the screen's theme; screen theme colors and dark-mode resources are not applied. Other platforms render titleImage themselves, for example Image(image(), contentDescription = title, modifier = Modifier.height(28.dp)) after checking the lambda is non-null. Title images are an experimental feature in this project.
Connect the screen's primary vertical container. UIKit owns pan, deceleration, bounce, scroll-to-top, and keyboard insets; Compose follows its offset. Pass both returned values to the container:
val state = rememberLazyListState()
val nativeScroll = rememberNativeScroll(state, background = MaterialTheme.colorScheme.background)
LazyColumn(
state = state,
userScrollEnabled = nativeScroll.userScrollEnabled,
contentPadding = nativeScroll.contentPadding,
) { /* screen rows */ }val state = rememberScrollState()
val nativeScroll = rememberNativeScroll(state)
Column(
Modifier.verticalScroll(state, enabled = nativeScroll.userScrollEnabled)
.padding(nativeScroll.contentPadding),
) { /* screen content */ }LazyListState, LazyGridState, LazyStaggeredGridState, or ScrollState. Use the same userScrollEnabled/contentPadding wiring for vertical grids.true and padding is zero. Your existing Scaffold still supplies its usual insets.background fills the area exposed by overscroll; omitting it uses iOS systemBackgroundColor.Modifier.nativeScrollExclusion() on vertical sliders or reorder handles so drags starting there go to Compose.Modifier.padding(nativeContentPadding()). Native bar insets are already included; avoid duplicate WindowInsets or native-screen imePadding().animateScrollToItem or bringIntoView, is synchronized back to the native bar.rememberNativeScroll connects scroll position to the native bars, while NativeScrollContent marks the content that moves when pulled past an edge. With no fixed elements, wrap screen content once in NativeNavigationFrame.frame, as the current sample does.
When a screen's own Scaffold has fixed buttons or bars, wrap only its content slot. FixedActions and ScreenBody below are existing app composables.
Scaffold(bottomBar = { FixedActions() }) { padding ->
NativeScrollContent(modifier = Modifier.padding(padding)) {
ScreenBody()
}
}With nested NativeScrollContent wrappers, the inner content owns the bounce so the outer frame and fixed buttons do not move with it. The wrapper is not inserted automatically and does not replace the scroll state, userScrollEnabled, or content-inset connections. Outside native iOS screens it behaves as a regular Box.
Declare NativeBarItems inside screen content. The following EditorBar takes screen state and callbacks and declares bar buttons, menu items, and a toolbar together. See the detail screen's actions in the bundled example. Screens.kt
import androidx.compose.runtime.Composable
import zone.ien.navite.NativeBarButton
import zone.ien.navite.NativeBarItems
import zone.ien.navite.NativeMenuAction
@Composable
fun EditorBar(
unreadCount: Int,
canSave: Boolean,
canDelete: Boolean,
onOpenNotifications: () -> Unit,
onSave: () -> Unit,
onDelete: () -> Unit,
) {
NativeBarItems(
trailing = listOf(
NativeBarButton(
title = "Notifications",
systemImage = "bell",
badge = unreadCount,
onClick = onOpenNotifications,
),
NativeBarButton(
title = "More",
systemImage = "ellipsis.circle",
menu = listOf(
NativeMenuAction(
title = "Notifications",
systemImage = "bell",
badge = unreadCount,
onClick = onOpenNotifications,
),
NativeMenuAction(
title = "Delete",
systemImage = "trash",
destructive = true,
enabled = canDelete,
onClick = onDelete,
),
),
),
NativeBarButton(
title = "Save",
systemImage = "checkmark",
enabled = canSave,
isPrimary = true,
onClick = onSave,
),
),
toolbar = listOf(
NativeBarButton("Notifications", systemImage = "bell", onClick = onOpenNotifications),
),
)
}leading and trailing are ordered left to right and keep the native back button. The example puts Save last so it appears at the right edge. The toolbar appears only while this screen is on top. Override a dynamic title with NativeBarItems(title = ...); declare static titles needed at the start of a push in nativeScreen(title = ...).
| Property | Default | Behavior |
|---|---|---|
title |
Required | Text, or accessibility label when an image is present |
systemImage |
null |
iOS SF Symbol name |
image |
null |
Compose Painter; takes precedence over systemImage
|
enabled |
true |
Button enabled state |
badge |
0 |
0: hidden, positive: number, negative: dot |
isPrimary |
false |
UIKit UIBarButtonItemStyleDone emphasis; adds spacing when placed after a regular trailing button |
menu |
Empty list | A non-empty list opens a menu instead of invoking onClick
|
onClick |
No-op | Invoked by an enabled button without a menu |
On iOS, a badged bar item contains a system UIButton and a badge view. isPrimary sets the UIKit bar-item style; it does not guarantee the same emphasized background for a button using a badge customView. The example keeps the primary action and badged button separate.
Native items are rebuilt only when their shape changes, including titles, images, enabled state, badges, or menus. Callback-only changes keep the existing items and invoke the latest action.
Declare each menu item as NativeMenuAction and the list as NativeBarButton(menu = listOf(...)). On iOS each item becomes a UIAction inside a UIMenu.
| Property | Default | Behavior |
|---|---|---|
title |
Required | Menu-item title |
systemImage |
null |
iOS SF Symbol name |
image |
null |
Compose Painter; takes precedence over systemImage
|
destructive |
false |
System styling for destructive actions such as deletion |
enabled |
true |
When false, displays disabled and prevents callback execution |
badge |
0 |
0: hidden, positive: number, negative: •; shown as an iOS menu subtitle, not a badge overlay |
onClick |
Required | Invoked when an enabled item is selected |
Menus are flat lists; there are no submenu, separator, or selection-state APIs. Disabling the parent button also prevents menu actions from executing.
For NativeBarButton.image and NativeMenuAction.image, pass painterResource(...) for PNG/vector resources or rememberVectorPainter(...) for an ImageVector. iOS fits the image within 22×22pt, preserves its aspect ratio, and applies native tint to its alpha mask. Existing constructors and trailing click lambdas remain supported.
NativeBarButton(
title = "Custom action",
image = painterResource(Res.drawable.my_icon),
) { performAction() }
NativeMenuAction(
title = "Vector action",
image = rememberVectorPainter(myImageVector),
) { performAction() }Use your app's resource, icon, and action for Res.drawable.my_icon, myImageVector, and performAction.
The library draws no bar UI there. Render buttons from NativeNavigationScope.leading, trailing, and toolbar, plus items in button.menu, using the app's existing design system. Reflect enabled, badge, image, destructive, and isPrimary as appropriate in that renderer. A menu button opens its menu; selecting an item invokes that NativeMenuAction.onClick. SF Symbols are iOS-specific, so the app supplies icons for other platforms.
The current sample's Material TopAppBar renders only the title and back button. Adding NativeBarItems to a screen alone does not add an Android menu. Material 3 apps can connect DropdownMenu and DropdownMenuItem to the existing bar's action slot; other UI systems use their own menu components.
Your app owns the query and filtering:
var query by rememberSaveable { mutableStateOf("") }
NativeSearchBar(query = query, onQueryChange = { query = it }, placeholder = "Search")iOS uses a UISearchController below the large title, hides it while scrolling down, and supplies clear/cancel controls. Outside iOS, render scope.search yourself. To collect declarations around a plain NavDisplay, remember a NativeBarState and wrap content with ProvideNativeBarState(state) { ... }.
Existing NavigationBackHandler, NavigationEventHandler, and legacy BackHandler work inside native screens. Enabled back handlers receive the native button and edge swipe instead of popping; forward-only handlers do not block native back.
NavigationBackHandler(
state = rememberNavigationEventState(NavigationEventInfo.None),
isBackEnabled = hasUnsavedChanges,
onBackCompleted = { showDiscardDialog = true },
)Use your existing unsaved-state and dialog state. Back-button history menus that pop multiple screens bypass handlers. Handler-owned swipes receive progress/completion/cancellation but have no UIKit transition animation; the screen must render progress itself.
The library serializes navigation and entry rememberSaveable state (including scroll positions) to NSData; the app owns storage. Expose these wrappers from iosMain:
fun MainViewController(restoredState: NSData?): UIViewController =
NativeNavigationViewController(restoredState, stateVersion = 1) { App() }
fun saveNavigationState(controller: UIViewController): NSData? =
saveNativeNavigationState(controller)Use platform.Foundation.NSData, platform.UIKit.UIViewController, and the two zone.ien.navite APIs above. Replace the quick start's no-argument Swift bridge with this scene-storage bridge:
final class NavigationHolder { var controller: UIViewController? }
struct ComposeView: UIViewControllerRepresentable {
let restoredState: Data?
let holder: NavigationHolder
func makeUIViewController(context: Context) -> UIViewController {
let controller = MainViewControllerKt.MainViewController(restoredState: restoredState)
holder.controller = controller
return controller
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
@SceneStorage("navigationState") private var navigationState: Data?
@Environment(\.scenePhase) private var scenePhase
@State private var holder = NavigationHolder()
var body: some View {
ComposeView(restoredState: navigationState, holder: holder)
.ignoresSafeArea()
.onChange(of: scenePhase) { _, phase in
// Save on .inactive: iOS records scene state before .background.
if phase != .active, let controller = holder.controller {
navigationState = MainViewControllerKt.saveNavigationState(controller: controller)
}
}
}
}.inactive; saving only at .background is too late for scene-state capture. @SceneStorage restores after system termination, discards state after user force-quit, and keeps each scene separate. UIKit apps can use UIScene.stateRestorationActivity.stateVersion (default 0) when route serialization or the number/order of rememberSaveable/rememberNavBackStack calls changes. Mismatched versions are ignored. A failed initial host restoration retries without saved data, but matching types at the wrong call site and later screen-composition failures are not caught by that safeguard.SavedStateHandle are not serialized.These are the repository's configured versions, not a claim that every version combination is supported:
| Component | Configuration |
|---|---|
| Kotlin / Compose Multiplatform | 2.4.21 / 1.12.2 |
| Navigation 3 runtime / UI | 1.2.1 / 1.2.0 |
| Lifecycle / Material 3 (example) | 2.11.0 / 1.12.0-alpha03 |
| AGP / Gradle | 9.3.1 / 9.7.0 |
| Gradle daemon / compilation | JetBrains Runtime 25 / JDK 17 toolchain |
| Android | minSdk 29, compileSdk/targetSdk 37 |
| iOS | 18.2+, iosArm64 and iosSimulatorArm64; Liquid Glass requires an iOS 26+ SDK build |
| Other library targets |
jvm, browser-only js and wasmJs
|
CI runs JVM, Android host, iOS simulator, JS, and Wasm tests and builds the Android/desktop examples. It does not build the iOS app or run XCUITest. The repository records XCUITest runs on iOS 18.5 and 27.2 and manual Android checks in the verification history; these are prior results, not a guarantee for every current change. The latest recorded title-image run on iOS 27.2 passed 15 UI tests; iOS 18.x was not rerun for that feature.
Known boundaries:
bottomAccessory, explicit glass effects, and search tabs are not exposed.otherPlatforms, so its NavDisplay transition settings and sceneStrategy do not apply. All entries are pushed full screens. Present dialogs and bottom sheets within screen content instead of making them navigation entries.The Navite Example shares one App() across Android, Desktop, and iOS. On iOS, open Row 4 in Home to see the tab bar fade out on push and fade back in after pop. Pull to refresh in Home to update the Settings tab badge. The detail screen shows a disabled button during the transition and a favorite action. Open Preview from Settings to see the native navigation bar hidden.
example/run-sample.sh
example/run-sample.sh ios
example/run-sample.sh android
./gradlew :example:desktopApp:runRun from the repository root. The script builds, installs, and launches the app. Use IOS_SIM_UDID to select an iOS simulator; ANDROID_SERIAL selects an Android device, and ANDROID_AVD selects an emulator to start if needed. The iOS viewer is DeviceHub on Xcode 27; the script opens the available viewer. There is no web example app.
Run these commands from the repository root; iOS tasks require macOS and Xcode. The Gradle daemon uses the pinned JetBrains Runtime 25; compilation uses JDK 17, automatically provisioned when absent.
./gradlew jvmTest
./gradlew testAndroidHostTest
./gradlew iosSimulatorArm64Test
./gradlew jsTest wasmJsTest
./gradlew :example:androidApp:assembleDebug :example:desktopApp:jarxcrun simctl list devices available
xcodebuild -project example/iosApp/iosApp.xcodeproj -scheme example.iosApp \
-configuration Debug -destination 'platform=iOS Simulator,name=iPhone 17,OS=27.2' \
-derivedDataPath build/xcode buildexample/iosUITests/run.sh <UDID>
python3 -I example/iosUITests/timeline.py build/ui-tests/<UDID>example.iosApp scheme currently lives in ignored xcuserdata; a fresh clone may need a scheme created in Xcode before the command above works.build/ui-tests/<UDID>/../gradlew kotlinUpgradeYarnLock kotlinWasmUpgradeYarnLock.RESTORE none on a reused simulator, check scene-session logs and retry on a fresh supported simulator; the repository records simulator scene-state failures. Search tests have also shown simulator keyboard-dependent failures; see the verification history..
├── library/
├── example/
│ ├── shared/
│ ├── androidApp/
│ ├── desktopApp/
│ ├── iosApp/
│ ├── iosUITests/
│ └── run-sample.sh
├── gradle/libs.versions.toml
└── .github/workflows/
library is the publishable KMP module. example/shared owns the common app and the static Shared framework; the other app folders are platform entry points. iosApp and iosUITests are Xcode projects, not Gradle modules. CI is in gradle.yml; publish.yml publishes the library to Maven Central when a GitHub Release is created.
Keep library code in library and demo/test-only behavior in example. Contributor instructions · Architecture and decisions · Build and verification history
Related official work:
lg-nav branchThese are references, not dependencies or an identical architecture: this library uses UIKit from Kotlin/Native, keeps Kotlin back stacks authoritative, and uses native controllers on all supported iOS versions.
Navigate natively.
Native navigation for Compose Multiplatform.
English | 한국어
Navite (나바이트) combines Navigation and Native. It rearranges the letters of Native to begin with Nav, the opening of Navigation.
Keep one Kotlin Navigation 3 structure while each platform uses its own navigation UI. On iOS, Navite connects Kotlin back stacks directly to real UIKit UITabBarController and UINavigationController instances through Kotlin/Native. Android, desktop, and web run your app's NavDisplay and navigation UI through the otherPlatforms block.
Routes, back stacks, entry providers, screens, ViewModels, and the root App() stay in common code.
UISearchController search.NativeStack and NativeTabs, such as sign-in and main flows.UIDesignRequiresCompatibility. Earlier supported iOS versions use their native system appearance.Kotlin owns the back stack. Native pops call the app's back callback once per removed entry; cancelled gestures leave the Kotlin stack unchanged. A new Kotlin back stack received during a transition takes precedence; the earlier native pop is not applied again to that new stack.
Add the dependencies to commonMain in your existing Compose Multiplatform shared module. Set the iOS deployment target to 18.2 or newer. Use a published Navite version for <version> when the first release is available, or build locally as shown below.
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}// shared/build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("zone.ien.navite:navite:<version>")
implementation("org.jetbrains.androidx.navigation3:navigation3-ui:1.2.0")
}
}
}The library exposes androidx.navigation3:navigation3-runtime:1.2.1 transitively. The example uses navigation3-ui to render NavDisplay outside iOS. To run the examples below, apply the serialization plugin matching your app's Kotlin version and add Compose Material 3. If you use per-entry ViewModels, also add org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3:2.11.0. Project version catalog
To test a local source build, run ./gradlew :library:publishToMavenLocal from the repository root and put mavenLocal() before mavenCentral() in the app's repositories. For this checkout, use the lib-version-name from the version catalog as <version>. You can also use a project dependency when the library module is part of the same build. Example dependency configuration
compose-swift-navigation3 is now Navite. Switch the Gradle dependency or version catalog entry from zone.ien.navigation:navigation to zone.ien.navite:navite and update Kotlin imports from zone.ien.navigation to zone.ien.navite. Public class and function names remain the same. Rebuild every module that depends on the library.
Earlier releases, including 1.0.0-alpha04, remain available under the original coordinates. Use a version published under the new coordinates when switching to Maven Central. Local source builds use the version in this checkout. Legacy Maven Central releases
The publishing workflow runs when a GitHub Release or prerelease is published. Its tag must match lib-version-name in gradle/libs.versions.toml. After the full CI passes for the same release commit, it signs all library targets, uploads them to Maven Central, and automatically releases them.
Configure the same Actions Secrets as compose-hig: SONATYPE_USERNAME, SONATYPE_PASSWORD (Central Portal token), GPG_KEY (ASCII-armored private key), and GPG_PASSWORD (key passphrase). The Central Portal account must have permission to publish zone.ien.navite, and the signing public key must be available on a key server. The workflow does not print secret values.
Use NativeStack for an app without tabs. Put the following App.kt in the shared module's commonMain. Register the NavKey subtypes in SavedStateConfiguration so the back stack can be saved across platforms. Apply the app theme to each screen through NativeNavigationFrame.frame.
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.navigation3.runtime.NavKey
import androidx.navigation3.runtime.entryProvider
import androidx.navigation3.runtime.rememberNavBackStack
import androidx.navigation3.ui.NavDisplay
import androidx.savedstate.serialization.SavedStateConfiguration
import kotlinx.serialization.Serializable
import kotlinx.serialization.modules.SerializersModule
import kotlinx.serialization.modules.polymorphic
import kotlinx.serialization.modules.subclass
import zone.ien.navite.NativeNavigationFrame
import zone.ien.navite.NativeStack
import zone.ien.navite.nativeContentPadding
import zone.ien.navite.nativeScreen
@Serializable data object Home : NavKey
@Serializable data class Detail(val id: Int) : NavKey
private val navigationConfiguration = SavedStateConfiguration {
serializersModule = SerializersModule {
polymorphic(NavKey::class) {
subclass(Home::class)
subclass(Detail::class)
}
}
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun App() {
NativeNavigationFrame(frame = { content -> MaterialTheme { content() } }) {
val backStack = rememberNavBackStack(navigationConfiguration, Home)
val provider = remember(backStack) {
entryProvider<NavKey> {
entry<Home>(metadata = nativeScreen(title = "Home")) {
Button(
onClick = { backStack.add(Detail(1)) },
modifier = Modifier.padding(nativeContentPadding()),
) { Text(text = "Open detail") }
}
entry<Detail>(metadata = { key -> nativeScreen(title = "Detail ${key.id}") }) { key ->
Text(text = "Detail ${key.id}", modifier = Modifier.padding(nativeContentPadding()))
}
}
}
NativeStack(backStack = backStack, entryProvider = provider) {
Scaffold(
topBar = {
TopAppBar(
title = { Text(text = title.orEmpty()) },
navigationIcon = {
if (canGoBack) TextButton(onClick = onBack) { Text(text = "Back") }
},
)
},
) { padding ->
NavDisplay(entries = entries, modifier = Modifier.padding(padding), onBack = onBack)
}
}
}
}Android calls setContent { App() } and Desktop calls App() inside its window. In the shared module's iosMain/MainViewController.kt, replace the existing ComposeUIViewController { App() } with the following.
import platform.UIKit.UIViewController
import zone.ien.navite.NativeNavigationViewController
fun MainViewController(): UIViewController = NativeNavigationViewController { App() }Return this controller from your existing SwiftUI UIViewControllerRepresentable. Shared is the example's Kotlin framework name. Use your own framework's baseName in the import.
import SwiftUI
import UIKit
import Shared
struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
MainViewControllerKt.MainViewController()
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}Place ComposeView().ignoresSafeArea() in the SwiftUI WindowGroup so UIKit manages the screen insets. A UIKit app can assign the result to window.rootViewController. Tap Open detail, then go back. iOS uses the system navigation controller, while Android and Desktop use the Material bar above. To try the complete repository example, run example/run-sample.sh ios or example/run-sample.sh android from the repository root.
Keep your routes, navigator, back stacks, entry provider, ViewModels, and screen back handlers. Make these scoped changes:
| Existing code | Change |
|---|---|
NavDisplay(backStack, entryProvider, entryDecorators, ...) |
Wrap it with NativeStack or NativeTabs; pass the decorated entries and onBack from its receiver to NavDisplay
|
Material Scaffold, top and bottom bars |
Keep them in otherPlatforms; render title, bar items, search, and tabs from NativeNavigationScope
|
| Screen titles | Declare static titles in nativeScreen; dynamic titles in NativeBarItems
|
Per-screen TopAppBar and back button |
Move to the app chrome, or hide existing screen chrome with if (!LocalNativeScreen.current)
|
| Theme, DI, root scaffold, snackbar host | Put DI locals in NativeNavigationFrame.providers; theme and screen UI wrappers in frame
|
Screen innerPadding
|
Use rememberNativeScroll(state) for scrolling screens or nativeContentPadding() otherwise |
| Outer stack over the tabs | Pass its detail entries to NativeTabs(sharedBackStack = ...), excluding the entry that represented the tabs |
iOS ComposeUIViewController { App() }
|
Use NativeNavigationViewController { App() }; embed with .ignoresSafeArea()
|
Check Android behavior after moving the chrome. On iOS, test push, native back, edge swipe and cancellation, large-title scrolling, tab state retention, shared screens, and optional restoration on both iOS 18.x (18.2+) and iOS 26+.
This walkthrough follows the Home and Settings tabs in App.kt. Complete installation first. If your Material 3 app does not use Navigation 3 yet, add NavKey routes, rememberNavBackStack, and an entryProvider as shown in Quick Start. The library does not inspect Material 3 screens automatically; declare the navigation structure and titles explicitly.
This fragment is the UI portion of an existing App(). stacks contains the per-tab back stacks, selectedTab is the selection state, and provider is the existing entry provider.
MaterialTheme {
Scaffold(
topBar = { TopAppBar(title = { Text(text = "Home") }) },
bottomBar = {
NavigationBar {
listOf("Home", "Settings").forEachIndexed { index, label ->
NavigationBarItem(
selected = selectedTab == index,
onClick = { selectedTab = index },
icon = { Text(text = label) },
)
}
}
},
) { padding ->
NavDisplay(
backStack = stacks[selectedTab],
entryProvider = provider,
onBack = { stacks[selectedTab].removeLastOrNull() },
modifier = Modifier.padding(padding),
)
}
}Keep the routes, per-tab back stacks, and navigation calls such as backStack.add(...). The sample's route and serialization declarations are in AppNavigation.kt.
The sample's App() declares both tab stacks and the native metadata for each route. Use the sample's screen implementations and routes to run this code. App.kt and imports · Screens.kt
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun App() {
val home = rememberNavBackStack(navigationConfiguration, HomeRoute)
val settings = rememberNavBackStack(navigationConfiguration, SettingsRoute)
var selectedTab by rememberSaveable { mutableIntStateOf(0) }
var pendingUpdates by rememberSaveable { mutableIntStateOf(0) }
val stacks = listOf(home, settings)
val openDetail: (Int) -> Unit = { id -> stacks[selectedTab].add(DetailRoute(id)) }
NativeNavigationFrame(frame = { content ->
val colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else lightColorScheme()
MaterialTheme(colorScheme = colorScheme) {
Surface { NativeScrollContent { content() } }
}
}) {
NativeTabs(
tabs = listOf(
NativeTab("Home", "house", home),
NativeTab("Settings", "gearshape", settings, image = null, badgeCount = pendingUpdates),
),
selectedTab = selectedTab,
onTabSelected = { selectedTab = it },
entryProvider = entryProvider {
entry<HomeRoute>(metadata = nativeScreen(title = "Home", largeTitle = true)) {
HomeScreen(onOpenDetail = openDetail, onRefreshCompleted = { pendingUpdates++ })
}
entry<SettingsRoute>(metadata = nativeScreen(title = "Settings", largeTitle = true)) {
SettingsScreen(
pendingUpdates = pendingUpdates,
onClearUpdates = { pendingUpdates = 0 },
onOpenDetail = { openDetail(42) },
onOpenPreview = { settings.add(DetailRoute(id = 42, preview = true)) },
)
}
entry<DetailRoute>(metadata = { route ->
if (route.preview) {
nativeScreen(title = "미리보기", hidesNavigationBar = true)
} else {
nativeScreen(
title = "Detail ${route.id}",
initialTrailing = listOf(
nativeBarTransitionPlaceholder(
title = favoriteActionTitle,
systemImage = "star",
),
),
)
}
}) { route ->
if (route.preview) {
PreviewScreen(id = route.id, onBack = { settings.removeLastOrNull() })
} else {
DetailScreen(id = route.id)
}
}
},
) {
Scaffold(
topBar = {
TopAppBar(
title = { Text(text = title.orEmpty()) },
navigationIcon = {
if (canGoBack) TextButton(onClick = onBack) { Text(text = "Back") }
},
)
},
bottomBar = {
NavigationBar {
tabs.forEachIndexed { index, tab ->
NavigationBarItem(
selected = selectedTab == index,
onClick = { onTabSelected(index) },
icon = {
BadgedBox(badge = {
tab.badgeCount?.takeIf { it > 0 }?.let { count ->
Badge { Text(text = count.toString()) }
}
}) {
Text(text = tab.title)
}
},
)
}
}
},
) { padding ->
NavDisplay(entries = entries, onBack = onBack, modifier = Modifier.padding(padding))
}
}
}
}MaterialTheme or app theme to NativeNavigationFrame.frame. NativeScrollContent applies iOS scroll bounce to the screen content.NativeTabs, and add nativeScreen titles to entries. house and gearshape are iOS SF Symbols names; keep rendering Material icons in the existing NavigationBarItem.otherPlatforms. Android, Desktop, and other non-iOS platforms run the existing Scaffold there. Use the block's entries, onBack, title, canGoBack, tabs, and onTabSelected, and pass entries to NavDisplay instead of backStack and entryProvider.TopAppBar, wrap it in if (!LocalNativeScreen.current) to avoid duplicate chrome.NativeStack(backStack, entryProvider = provider) { ... } from Quick Start. If you already use a per-entry ViewModel decorator, move it to entryDecorators on NativeTabs or NativeStack.Reuse the existing LazyColumn state and connect both returned values. This fragment shows the scroll integration. The full HomeScreen includes pull-to-refresh and a bar subtitle. Screens.kt
val state = rememberLazyListState()
val scroll = rememberNativeScroll(state)
LazyColumn(
state = state,
userScrollEnabled = scroll.userScrollEnabled,
contentPadding = scroll.contentPadding,
modifier = Modifier.fillMaxSize(),
) {
items(50) { id ->
ListItem(
headlineContent = { Text(text = "Row $id") },
modifier = Modifier.clickable { onOpenDetail(id) },
)
}
}For a non-scrolling screen, apply Modifier.padding(nativeContentPadding()). On Android and other non-native platforms this native padding is zero, so keep using the Scaffold padding above. On iOS it supplies native bar and keyboard insets; do not add system-bar insets or imePadding() again. See Scrolling and content insets for details.
Replace the existing ComposeUIViewController { App() } with the following. Android and Desktop entry points continue calling App().
import zone.ien.navite.NativeNavigationViewController
fun MainViewController() = NativeNavigationViewController { App() }The existing SwiftUI UIViewControllerRepresentable uses this return value and is embedded with .ignoresSafeArea() (Quick Start bridge). After migration, check the Material bars and back navigation on Android, plus tab switching, detail push, the back button, edge swipe, and scrolling on iOS.
NativeNavigationFrame(
providers = { content -> CompositionLocalProvider(LocalAppGraph provides graph, content = content) },
frame = { content -> AppTheme { RootScaffold { content() } } },
) {
NativeStack(backStack = backStack, entryProvider = entryProvider) {
NavDisplay(entries = entries, onBack = onBack)
}
}This fragment uses your existing LocalAppGraph, graph, AppTheme, and RootScaffold.
providers { frame { content() } } wraps the app once. On iOS, every entry has its own controller and composition: providers wraps both the UI-free navigation host and each screen; frame wraps each screen.providers or outside frame/the navigation declaration's otherPlatforms block. The iOS host rejects UI nodes. Move app-level dialogs into screens, or use an implementation backed by a system alert on iOS.LocalUIViewController, and LocalDensity, so shared resource lookups and native alert integrations can work there. UI-dependent themes belong in frame.LocalNativeScreen.current inside screen content/frame to hide Compose chrome and apply imePadding() only outside native screens. Do not add system-bar insets again; native content padding already includes them.NavEntryDecorator instead of NativeNavigationFrame.rememberUpdatedState, or a ViewModel.MutableState returned by rememberSaveable directly. Copying to a saved value in SideEffect misses changes when the caller does not recompose.Public APIs live in zone.ien.navite. The common source and iOS source contain their declarations and KDoc.
| API | Purpose |
|---|---|
NativeStack, NativeTabs, NativeTab
|
Common declarations for a stack, tabs, and each tab's stack |
NativeNavigationScope<T> |
Decorated entries and chrome data passed to otherPlatforms
|
NativeNavigationFrame, LocalNativeScreen
|
App-wide providers/frame and native-screen detection |
nativeScreen, NavEntry.nativeTitle, nativeLargeTitle, nativeHidesTabBar, nativeTitleImage
|
Entry metadata and accessors |
rememberNativeScroll, NativeScroll, NativeScrollContent, nativeContentPadding, Modifier.nativeScrollExclusion()
|
Native vertical scroll, content bounce, and insets |
NativeNavigationTint, NativeTabBarTint
|
Navigation action and selected-tab tint |
NativeBarItems, NativeBarButton, NativeMenuAction, NativeBarContent
|
Bar declarations and data |
NativeSearchBar, NativeSearch
|
Search declaration and data |
NativeBarState, ProvideNativeBarState
|
Collect declarations around a plain NavDisplay without NativeStack/NativeTabs
|
NativeNavigationViewController, saveNativeNavigationState
|
iOS navigation host and optional state serialization |
ComposeScreenViewController |
iOS standalone Compose screen for an app-owned UINavigationController
|
Use observable back stacks (rememberNavBackStack or a snapshot state list). Navigation is ordinary list mutation:
backStack.add(Detail(3))
backStack.removeLastOrNull()
backStack[backStack.lastIndex] = Detail(103)
while (backStack.size > 1) backStack.removeLastOrNull()These are push, pop, replace, and pop-to-root respectively. For tabs, register every tab/shared route in your provider and serializer configuration, then declare:
val home = rememberNavBackStack(navigationConfiguration, Home)
val settings = rememberNavBackStack(navigationConfiguration, Settings)
val shared = rememberNavBackStack(navigationConfiguration)
var selectedTab by rememberSaveable { mutableIntStateOf(0) }
NativeTabs(
tabs = listOf(
NativeTab("Home", systemImage = "house", backStack = home),
NativeTab("Settings", systemImage = "gearshape", backStack = settings),
),
selectedTab = selectedTab,
onTabSelected = { selectedTab = it },
sharedBackStack = shared,
entryDecorators = listOf(
rememberSaveableStateHolderNavEntryDecorator(),
rememberViewModelStoreNavEntryDecorator(),
),
entryProvider = entryProvider,
) { MaterialChrome() }This fragment extends the quick start with your Settings route, provider, and NativeNavigationScope<NavKey>.MaterialChrome() renderer. The bundled sample puts the Material Scaffold and NavDisplay directly inside the block. App.kt
UITabBarController with one UINavigationController per tab. Each tab's decorated entries retain saveable state and ViewModels on other platforms too.sharedBackStack may be empty. Its screens always hide the tab bar and push above the selected tab. onSharedBack removes one shared entry. If the app changes selectedTab while a shared screen is visible, the shared screens move to the new tab without animation.NativeStack and NativeTab default onBack to removing the last entry when the supplied list is mutable. Custom callbacks, including onSharedBack, must pop exactly one entry. Otherwise UIKit and Kotlin diverge, and a subsequent stack change can push the screen again.NativeStack/NativeTabs default to the saveable-state decorator. Add rememberViewModelStoreNavEntryDecorator() when using per-entry ViewModels. Do not redecorate the entries passed to NavDisplay.NativeTabs and NativeStack with if (signedIn). iOS cross-fades between hierarchies and disposes the old screens; creating decorators inside each branch clears the departing flow's ViewModels and saveable state.
Tab icons can also use Compose Painter values: NativeTab(title = "Home", backStack = home, image = homePainter, selectedImage = selectedHomePainter). The host renders both images before the tab appears, fits them within 25×25pt, and uses UIKit template tint. image takes precedence over systemImage; omitting selectedImage uses the default tab image. The existing SF Symbols constructor and trailing onBack lambda remain supported.
Wrap NativeTabs in NativeTabBarTint(color) { ... } to set the selected tab icon and label tint. Color changes update the existing tab bar; Color.Unspecified restores the system tint. Unselected tab colors and bar appearance remain controlled by UIKit.
NativeNavigationTint supplies the iOS back-button, bar-action, and toolbar tint; NativeTabBarTint sets the selected tab icon and label tint. This fragment uses your existing appAccent, AppTheme, backStack, and provider.
import zone.ien.navite.NativeNavigationTint
import zone.ien.navite.NativeTabBarTint
NativeNavigationFrame(
providers = { content ->
NativeNavigationTint(appAccent) {
NativeTabBarTint(appAccent) { content() }
}
},
frame = { content -> AppTheme { NativeScrollContent { content() } } },
) {
NativeStack(backStack = backStack, entryProvider = provider) {
NavDisplay(entries = entries, onBack = onBack)
}
}For a tabbed app, replace NativeStack with the existing NativeTabs declaration. Pass a Color; Color.Unspecified restores each host's default tint. These providers do not change UI on other platforms; use the app's theme there. Unselected tab colors and system-bar backgrounds/appearance are not overridden.
Do not place these providers only inside the screen frame. iOS navigation is declared in a UI-free host composition, so put them in providers as above or wrap NativeStack/NativeTabs directly. Rather than reading screen-theme values such as MaterialTheme.colorScheme in the host, pass the app's chosen accent through State or a UI-free color-token provider.
The library draws no UI on these platforms. Read these NativeNavigationScope values in the block and render your existing components:
| Value | Meaning |
|---|---|
entries |
Selected tab/stack entries followed by shared entries, already decorated |
tabEntries, sharedEntries
|
The two lists separately, for an outer NavDisplay above the tabs |
onBack, canGoBack
|
Pop the visible stack, and whether another entry is below the top |
title, largeTitle, titleImage
|
Dynamic title or metadata fallback, large-title flag, and optional painter lambda |
leading, trailing, toolbar, search
|
Collected bar and search declarations |
tabs, selectedTab, onTabSelected
|
Tab configuration and selection; no tabs for NativeStack
|
tabBarVisible |
Tabs exist, no shared screen is shown, and no pushed tab entry hides the bar |
For an outer stack that covers the tab chrome, use listOf(NavEntry<NavKey>(TabsKey) { TabsChrome(tabEntries) }) + sharedEntries as its entries. TabsKey and TabsChrome belong to your app.
The most recently registered, still-composed screen's bar/search declarations win. An outgoing screen's declarations can remain temporarily when the incoming screen declares none. systemImage names are iOS SF Symbols; choose Android icons in your renderer. See App.kt for the minimal integration. Optional menus, toolbars, and search are omitted from the sample.
entry<Detail>(metadata = { key -> nativeScreen(title = "Detail ${key.id}", hidesTabBar = true) }) { key ->
DetailScreen(key.id)
}DetailScreen is your screen composable.
| Parameter | Default | iOS behavior |
|---|---|---|
title |
null |
navigationItem.title; set static titles before push starts |
largeTitle |
false |
A large title that collapses with scrolling; prefer it only on stack roots |
hidesNavigationBar |
Omitted | Set to true to hide the native navigation bar. Once a stack uses this option, screens that omit it show the bar. |
initialTrailing |
Omitted | Supplies trailing buttons at the start of a push. Use nativeBarTransitionPlaceholder for a disabled placeholder. NativeBarItems replaces these buttons after the transition. |
hidesTabBar |
false |
Uses UITabBarController; screens pushed above it also keep the bar hidden |
titleImage |
null |
A @Composable () -> Painter rendered as a 28pt-high titleView with its aspect ratio |
For a logo, use nativeScreen(title = "Home", titleImage = { painterResource(Res.drawable.logo) }) with your existing Compose resource. Keep title for VoiceOver and the next screen's back button. On iOS the painter runs in the host before push, outside the screen's theme; screen theme colors and dark-mode resources are not applied. Other platforms render titleImage themselves, for example Image(image(), contentDescription = title, modifier = Modifier.height(28.dp)) after checking the lambda is non-null. Title images are an experimental feature in this project.
Connect the screen's primary vertical container. UIKit owns pan, deceleration, bounce, scroll-to-top, and keyboard insets; Compose follows its offset. Pass both returned values to the container:
val state = rememberLazyListState()
val nativeScroll = rememberNativeScroll(state, background = MaterialTheme.colorScheme.background)
LazyColumn(
state = state,
userScrollEnabled = nativeScroll.userScrollEnabled,
contentPadding = nativeScroll.contentPadding,
) { /* screen rows */ }val state = rememberScrollState()
val nativeScroll = rememberNativeScroll(state)
Column(
Modifier.verticalScroll(state, enabled = nativeScroll.userScrollEnabled)
.padding(nativeScroll.contentPadding),
) { /* screen content */ }LazyListState, LazyGridState, LazyStaggeredGridState, or ScrollState. Use the same userScrollEnabled/contentPadding wiring for vertical grids.true and padding is zero. Your existing Scaffold still supplies its usual insets.background fills the area exposed by overscroll; omitting it uses iOS systemBackgroundColor.Modifier.nativeScrollExclusion() on vertical sliders or reorder handles so drags starting there go to Compose.Modifier.padding(nativeContentPadding()). Native bar insets are already included; avoid duplicate WindowInsets or native-screen imePadding().animateScrollToItem or bringIntoView, is synchronized back to the native bar.rememberNativeScroll connects scroll position to the native bars, while NativeScrollContent marks the content that moves when pulled past an edge. With no fixed elements, wrap screen content once in NativeNavigationFrame.frame, as the current sample does.
When a screen's own Scaffold has fixed buttons or bars, wrap only its content slot. FixedActions and ScreenBody below are existing app composables.
Scaffold(bottomBar = { FixedActions() }) { padding ->
NativeScrollContent(modifier = Modifier.padding(padding)) {
ScreenBody()
}
}With nested NativeScrollContent wrappers, the inner content owns the bounce so the outer frame and fixed buttons do not move with it. The wrapper is not inserted automatically and does not replace the scroll state, userScrollEnabled, or content-inset connections. Outside native iOS screens it behaves as a regular Box.
Declare NativeBarItems inside screen content. The following EditorBar takes screen state and callbacks and declares bar buttons, menu items, and a toolbar together. See the detail screen's actions in the bundled example. Screens.kt
import androidx.compose.runtime.Composable
import zone.ien.navite.NativeBarButton
import zone.ien.navite.NativeBarItems
import zone.ien.navite.NativeMenuAction
@Composable
fun EditorBar(
unreadCount: Int,
canSave: Boolean,
canDelete: Boolean,
onOpenNotifications: () -> Unit,
onSave: () -> Unit,
onDelete: () -> Unit,
) {
NativeBarItems(
trailing = listOf(
NativeBarButton(
title = "Notifications",
systemImage = "bell",
badge = unreadCount,
onClick = onOpenNotifications,
),
NativeBarButton(
title = "More",
systemImage = "ellipsis.circle",
menu = listOf(
NativeMenuAction(
title = "Notifications",
systemImage = "bell",
badge = unreadCount,
onClick = onOpenNotifications,
),
NativeMenuAction(
title = "Delete",
systemImage = "trash",
destructive = true,
enabled = canDelete,
onClick = onDelete,
),
),
),
NativeBarButton(
title = "Save",
systemImage = "checkmark",
enabled = canSave,
isPrimary = true,
onClick = onSave,
),
),
toolbar = listOf(
NativeBarButton("Notifications", systemImage = "bell", onClick = onOpenNotifications),
),
)
}leading and trailing are ordered left to right and keep the native back button. The example puts Save last so it appears at the right edge. The toolbar appears only while this screen is on top. Override a dynamic title with NativeBarItems(title = ...); declare static titles needed at the start of a push in nativeScreen(title = ...).
| Property | Default | Behavior |
|---|---|---|
title |
Required | Text, or accessibility label when an image is present |
systemImage |
null |
iOS SF Symbol name |
image |
null |
Compose Painter; takes precedence over systemImage
|
enabled |
true |
Button enabled state |
badge |
0 |
0: hidden, positive: number, negative: dot |
isPrimary |
false |
UIKit UIBarButtonItemStyleDone emphasis; adds spacing when placed after a regular trailing button |
menu |
Empty list | A non-empty list opens a menu instead of invoking onClick
|
onClick |
No-op | Invoked by an enabled button without a menu |
On iOS, a badged bar item contains a system UIButton and a badge view. isPrimary sets the UIKit bar-item style; it does not guarantee the same emphasized background for a button using a badge customView. The example keeps the primary action and badged button separate.
Native items are rebuilt only when their shape changes, including titles, images, enabled state, badges, or menus. Callback-only changes keep the existing items and invoke the latest action.
Declare each menu item as NativeMenuAction and the list as NativeBarButton(menu = listOf(...)). On iOS each item becomes a UIAction inside a UIMenu.
| Property | Default | Behavior |
|---|---|---|
title |
Required | Menu-item title |
systemImage |
null |
iOS SF Symbol name |
image |
null |
Compose Painter; takes precedence over systemImage
|
destructive |
false |
System styling for destructive actions such as deletion |
enabled |
true |
When false, displays disabled and prevents callback execution |
badge |
0 |
0: hidden, positive: number, negative: •; shown as an iOS menu subtitle, not a badge overlay |
onClick |
Required | Invoked when an enabled item is selected |
Menus are flat lists; there are no submenu, separator, or selection-state APIs. Disabling the parent button also prevents menu actions from executing.
For NativeBarButton.image and NativeMenuAction.image, pass painterResource(...) for PNG/vector resources or rememberVectorPainter(...) for an ImageVector. iOS fits the image within 22×22pt, preserves its aspect ratio, and applies native tint to its alpha mask. Existing constructors and trailing click lambdas remain supported.
NativeBarButton(
title = "Custom action",
image = painterResource(Res.drawable.my_icon),
) { performAction() }
NativeMenuAction(
title = "Vector action",
image = rememberVectorPainter(myImageVector),
) { performAction() }Use your app's resource, icon, and action for Res.drawable.my_icon, myImageVector, and performAction.
The library draws no bar UI there. Render buttons from NativeNavigationScope.leading, trailing, and toolbar, plus items in button.menu, using the app's existing design system. Reflect enabled, badge, image, destructive, and isPrimary as appropriate in that renderer. A menu button opens its menu; selecting an item invokes that NativeMenuAction.onClick. SF Symbols are iOS-specific, so the app supplies icons for other platforms.
The current sample's Material TopAppBar renders only the title and back button. Adding NativeBarItems to a screen alone does not add an Android menu. Material 3 apps can connect DropdownMenu and DropdownMenuItem to the existing bar's action slot; other UI systems use their own menu components.
Your app owns the query and filtering:
var query by rememberSaveable { mutableStateOf("") }
NativeSearchBar(query = query, onQueryChange = { query = it }, placeholder = "Search")iOS uses a UISearchController below the large title, hides it while scrolling down, and supplies clear/cancel controls. Outside iOS, render scope.search yourself. To collect declarations around a plain NavDisplay, remember a NativeBarState and wrap content with ProvideNativeBarState(state) { ... }.
Existing NavigationBackHandler, NavigationEventHandler, and legacy BackHandler work inside native screens. Enabled back handlers receive the native button and edge swipe instead of popping; forward-only handlers do not block native back.
NavigationBackHandler(
state = rememberNavigationEventState(NavigationEventInfo.None),
isBackEnabled = hasUnsavedChanges,
onBackCompleted = { showDiscardDialog = true },
)Use your existing unsaved-state and dialog state. Back-button history menus that pop multiple screens bypass handlers. Handler-owned swipes receive progress/completion/cancellation but have no UIKit transition animation; the screen must render progress itself.
The library serializes navigation and entry rememberSaveable state (including scroll positions) to NSData; the app owns storage. Expose these wrappers from iosMain:
fun MainViewController(restoredState: NSData?): UIViewController =
NativeNavigationViewController(restoredState, stateVersion = 1) { App() }
fun saveNavigationState(controller: UIViewController): NSData? =
saveNativeNavigationState(controller)Use platform.Foundation.NSData, platform.UIKit.UIViewController, and the two zone.ien.navite APIs above. Replace the quick start's no-argument Swift bridge with this scene-storage bridge:
final class NavigationHolder { var controller: UIViewController? }
struct ComposeView: UIViewControllerRepresentable {
let restoredState: Data?
let holder: NavigationHolder
func makeUIViewController(context: Context) -> UIViewController {
let controller = MainViewControllerKt.MainViewController(restoredState: restoredState)
holder.controller = controller
return controller
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}
struct ContentView: View {
@SceneStorage("navigationState") private var navigationState: Data?
@Environment(\.scenePhase) private var scenePhase
@State private var holder = NavigationHolder()
var body: some View {
ComposeView(restoredState: navigationState, holder: holder)
.ignoresSafeArea()
.onChange(of: scenePhase) { _, phase in
// Save on .inactive: iOS records scene state before .background.
if phase != .active, let controller = holder.controller {
navigationState = MainViewControllerKt.saveNavigationState(controller: controller)
}
}
}
}.inactive; saving only at .background is too late for scene-state capture. @SceneStorage restores after system termination, discards state after user force-quit, and keeps each scene separate. UIKit apps can use UIScene.stateRestorationActivity.stateVersion (default 0) when route serialization or the number/order of rememberSaveable/rememberNavBackStack calls changes. Mismatched versions are ignored. A failed initial host restoration retries without saved data, but matching types at the wrong call site and later screen-composition failures are not caught by that safeguard.SavedStateHandle are not serialized.These are the repository's configured versions, not a claim that every version combination is supported:
| Component | Configuration |
|---|---|
| Kotlin / Compose Multiplatform | 2.4.21 / 1.12.2 |
| Navigation 3 runtime / UI | 1.2.1 / 1.2.0 |
| Lifecycle / Material 3 (example) | 2.11.0 / 1.12.0-alpha03 |
| AGP / Gradle | 9.3.1 / 9.7.0 |
| Gradle daemon / compilation | JetBrains Runtime 25 / JDK 17 toolchain |
| Android | minSdk 29, compileSdk/targetSdk 37 |
| iOS | 18.2+, iosArm64 and iosSimulatorArm64; Liquid Glass requires an iOS 26+ SDK build |
| Other library targets |
jvm, browser-only js and wasmJs
|
CI runs JVM, Android host, iOS simulator, JS, and Wasm tests and builds the Android/desktop examples. It does not build the iOS app or run XCUITest. The repository records XCUITest runs on iOS 18.5 and 27.2 and manual Android checks in the verification history; these are prior results, not a guarantee for every current change. The latest recorded title-image run on iOS 27.2 passed 15 UI tests; iOS 18.x was not rerun for that feature.
Known boundaries:
bottomAccessory, explicit glass effects, and search tabs are not exposed.otherPlatforms, so its NavDisplay transition settings and sceneStrategy do not apply. All entries are pushed full screens. Present dialogs and bottom sheets within screen content instead of making them navigation entries.The Navite Example shares one App() across Android, Desktop, and iOS. On iOS, open Row 4 in Home to see the tab bar fade out on push and fade back in after pop. Pull to refresh in Home to update the Settings tab badge. The detail screen shows a disabled button during the transition and a favorite action. Open Preview from Settings to see the native navigation bar hidden.
example/run-sample.sh
example/run-sample.sh ios
example/run-sample.sh android
./gradlew :example:desktopApp:runRun from the repository root. The script builds, installs, and launches the app. Use IOS_SIM_UDID to select an iOS simulator; ANDROID_SERIAL selects an Android device, and ANDROID_AVD selects an emulator to start if needed. The iOS viewer is DeviceHub on Xcode 27; the script opens the available viewer. There is no web example app.
Run these commands from the repository root; iOS tasks require macOS and Xcode. The Gradle daemon uses the pinned JetBrains Runtime 25; compilation uses JDK 17, automatically provisioned when absent.
./gradlew jvmTest
./gradlew testAndroidHostTest
./gradlew iosSimulatorArm64Test
./gradlew jsTest wasmJsTest
./gradlew :example:androidApp:assembleDebug :example:desktopApp:jarxcrun simctl list devices available
xcodebuild -project example/iosApp/iosApp.xcodeproj -scheme example.iosApp \
-configuration Debug -destination 'platform=iOS Simulator,name=iPhone 17,OS=27.2' \
-derivedDataPath build/xcode buildexample/iosUITests/run.sh <UDID>
python3 -I example/iosUITests/timeline.py build/ui-tests/<UDID>example.iosApp scheme currently lives in ignored xcuserdata; a fresh clone may need a scheme created in Xcode before the command above works.build/ui-tests/<UDID>/../gradlew kotlinUpgradeYarnLock kotlinWasmUpgradeYarnLock.RESTORE none on a reused simulator, check scene-session logs and retry on a fresh supported simulator; the repository records simulator scene-state failures. Search tests have also shown simulator keyboard-dependent failures; see the verification history..
├── library/
├── example/
│ ├── shared/
│ ├── androidApp/
│ ├── desktopApp/
│ ├── iosApp/
│ ├── iosUITests/
│ └── run-sample.sh
├── gradle/libs.versions.toml
└── .github/workflows/
library is the publishable KMP module. example/shared owns the common app and the static Shared framework; the other app folders are platform entry points. iosApp and iosUITests are Xcode projects, not Gradle modules. CI is in gradle.yml; publish.yml publishes the library to Maven Central when a GitHub Release is created.
Keep library code in library and demo/test-only behavior in example. Contributor instructions · Architecture and decisions · Build and verification history
Related official work:
lg-nav branchThese are references, not dependencies or an identical architecture: this library uses UIKit from Kotlin/Native, keeps Kotlin back stacks authoritative, and uses native controllers on all supported iOS versions.