@amisi/navigation
@amisi/navigation provides router helpers, navigation guards, and deep linking utilities for Expo Router applications.
Features
- Deep link configuration - Parse and build deep links with type safety
- Navigation guards - Protect routes based on auth, onboarding, subscription status
- Transition presets - Reusable stack navigation transitions
- Typed routes - Type-safe route helpers and navigation
Deep Linking
Create linking configuration
Parse deep links
Build deep links
Check route types
Navigation Guards
Guards prevent screen flashing and protect routes based on app state.AuthGate
Protect authenticated routes and redirect unauthenticated users:OnboardingGate
Ensure users complete onboarding before accessing the app:SubscriptionGate
Require active subscription for premium features:AppLockGate
Handle app lock/unlock state:ComposedGate
Combine multiple guards:Transition Presets
Reusable navigation transitions for consistent animations.Using presets
Available presets
- modal - Standard modal presentation
- transparentModal - Modal with transparent background
- slideFromRight - Horizontal slide (default stack)
- slideFromBottom - Vertical slide
- fade - Fade in/out
- noAnimation - No animation
- auth - Fade transition for auth screens
- onboarding - Horizontal slide for onboarding
- tabBar - Fade for tab navigation
- platformModal - Platform-specific modal (iOS modal, Android slide)
- platformAuth - Platform-specific auth (iOS fade, Android slide)
Platform-specific transitions
Custom transitions
Typed Routes
Type-safe route helpers and navigation.Route constants
Build routes with params
Parse routes
Match routes with patterns
Route type checking
Get initial route
Navigation State Helpers
Architecture Benefits
This package solves common navigation pain points:- Deep link → correct stack - Parse and route deep links to the right screen
- Modal routes - Consistent modal presentation across platforms
- No screen flashing - Guards prevent showing wrong screens during state changes
- Type safety - Typed route helpers prevent navigation errors
- Reusable transitions - Consistent animations across the app
- Composable guards - Combine multiple protection layers easily