Tutorials
Compose modular tab navigation
Export feature Modules, mount them into child Scopes, render the active Outlet, and preserve independent tab stacks.
Compose modular tab navigation
Build a shell with catalog and profile tabs without creating router subclasses in either feature.
1. Export feature Modules
Each feature declares Destination and Route Definition types, then exports a NavigationModule. It knows neither the shell Scope nor the final URI prefix.
2. Define the Scope tree
Create a shell Scope and two child Scopes. Give each child an explicit restoration identifier.
3. Mount the Modules
The application mounts catalog and profile Modules into their child Scopes and assigns distinct URI prefixes. Reusing a Module in another app only changes Mount configuration.
4. Render the branch
The shell page contains NavigationActiveOutlet(parentScopeId: shellScopeId). Ark Navigation renders the active child Navigator with its retained stack.
5. Switch and reset intentionally
Use activateBranch to change tabs. Use resetBranch only when business lifecycle ends—for example, after sign-out. Inactive tabs are not cleared implicitly.