API Reference
This document lists the public exports from @zynthjs/router and the main types used to configure navigation trees, route state, screen options, and filesystem routing.
The package surface is split across containers, navigator factories, navigator components, hooks, contexts, metrics helpers, and public type exports.
Basic usage
import {
NavigationContainer,
createStackNavigator,
useNavigation,
} from "@zynthjs/router";
Advanced examples
Direct navigator exports
import { NavigationContainer, Stack } from "@zynthjs/router";
function App() {
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Details" component={DetailsScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
Filesystem router exports
import {
NavigationContainer,
createFileSystemRouter,
type FileSystemRouterManifest,
} from "@zynthjs/router";
declare const manifest: FileSystemRouterManifest;
const Router = createFileSystemRouter(manifest);
Special cases and unusual features
createRouter()is still exported but the focused factories arecreateStackNavigator(),createTabNavigator(), andcreateBottomSheetNavigator().- BottomSheet navigation is experimental and unstable.
Stack,Tabs, andBottomSheetare exported directly in addition to the typed factory helpers.NavigationContextandRouteContextare public for advanced composition scenarios.
API Reference
Components and factories
NavigationContainercreateStackNavigatorcreateTabNavigatorcreateBottomSheetNavigator(experimental)createRoutercreateFileSystemRouterStackStackNavigatorStackScreenTabsTabsNavigatorTabScreenBottomSheet(experimental)BottomSheetNavigator(experimental)BottomSheetScreen(experimental)
Hooks
useNavigationuseRoutecreateFocusEffectuseIsFocusedcreateBeforeRemoveuseNavigationStateuseScreenOptionsuseParamsuseRouteNameuseHeaderMetricsuseTabBarMetrics
Context exports
NavigationContextuseNavigationContextuseNavigationContextUnsafeRouteContextuseRouteContextuseContainerContext
Route and state types
RouteParamListRouteNodeNavigationState
Screen option types
ScreenOptionsScreenOptionsInputScreenHeaderBlurEffectScreenHeaderStyleScreenUserInterfaceStyleScreenPresentationScreenAnimation
Tab and bottom-sheet types
Bottom-sheet types are experimental and unstable.
TabOptionsTabIconDescriptorTabIconFactoryTabBarOptionsTabBarPropsBottomSheetOptionsBottomSheetNavigatorPropsBottomSheetScreenProps
Navigation types
NavigationHelpersNavigationContainerPropsRouterActionNavigateActionPushActionPopActionGoBackActionReplaceActionResetActionSetParamsActionSwitchTabAction
Screen component and navigator prop types
ScreenComponentPropsScreenComponentRouteContextValueStackNavigatorPropsStackScreenPropsTabsNavigatorPropsTabScreenProps
Event types
FocusEffectCallbackBeforeRemoveEventBeforeRemoveHandler
Linking types
LinkingOptionsLinkingConfigLinkingRouteConfig
Filesystem routing types
FileSystemScreenRouteFileSystemNavigatorRouteFileSystemRouteNodeFileSystemRouterManifest
Context and metrics types
NavigationContextValueRouteContextDataHeaderMetricsTabBarMetrics