Skip to content

The Navi router ships as a Cargo workspace of seven crates. The layering is strict: lower layers never depend on higher ones, and no library crate below navi-router touches a UI framework.

Crate Purpose
navi-core Shared primitives — window keys, ids, config types.
navi-router-core Pure routing engine: patterns, ranked radix trie matching, route-tree validation. No UI, no async runtime.
navi-router Router runtime: Navigator, RouterProvider, components (Link, Outlet, Awaited, …), blockers, scroll restoration.
navi-macros Procedural macros: define_route!, use_params!, use_search!, use_loader_data!, and friends.
navi-codegen Build-time route-tree generation from src/routes, driven by navi.config.json.
navi-devtools Framework-agnostic devtools model: routes, cache, timeline, state.
navi-test Test utilities for router-based applications.

navi-router is the single dependency application code touches most. It re-exports the whole engine surface from navi-router-core — Blocker, BlockerId, History, Location, MatchResult, NavOp, NavigateOptions, NavigationEffect, NotFound, Redirect, RouteNode, RoutePattern, RouteTree, RouterCore, ScrollIntoViewOptions, Segment, ValidateSearch, ValidationError, ValidationResult, ViewTransitionOptions, not_found, redirect — plus its own modules:

Module or item Contents
components Awaited, Link, Outlet, PreloadType, RouterProvider, ScrollRestoration, SuspenseBoundary, register_route_component
navigator Navigator
state AnyData, LoaderOutcome, LoaderState, NotFoundMode, RouteDef, RouterEvent, RouterHandle, RouterHost, RouterOptions, RouterState
event_bus Router event plumbing feeding the devtools timeline.
route_tree BeforeLoadContext, BeforeLoadResult, RouteContextArgs, and related tree types.
root sleep (re-exported from quoin_core) for portable async delays.

With the nested-search feature enabled, parse_query_nested and query_to_string are re-exported as well.

All rendering goes through quoin: route UI is expressed as quoin_ui::Node trees (or component! shells), and quoin’s macro emitters lower them to the selected framework. The data stack is rs-query, the query cache with stale-time and GC behind route loaders.