Router
Virentia Router is a route model family for applications built with @virentia/core and @virentia/react.
The documentation is grouped by the layer you work in:
- Core — framework-agnostic routing: path templates, route models, the router, navigation, query tracking, and virtual routes.
- React — rendering opened routes in a React DOM tree.
- React Native — rendering opened routes through React Navigation.
Within core, each piece is documented separately so setup, routing rules, URL updates, and rendering do not collapse into one example: a path template describes how a URL is parsed and built; a route is a Virentia model for one addressable state; a router registers routes, owns URL matching, and connects to history; navigation is a command boundary that opens routes or writes a URL; and query tracking turns URL query state into model events. The React and React Native layers only render already-opened route models.
Packages
| Package | Purpose |
|---|---|
@virentia/router-paths | Typed path templates, parsing, building, and Express conversion |
@virentia/router | Routes, routers, history adapters, query tracking, virtual routes, groups, chained routes |
@virentia/router-react | RouterProvider, Link, route views, lazy views, outlets, hooks |
@virentia/router-react-native | Stack and bottom-tabs navigators that bind route views to React Navigation |
Install
pnpm add @virentia/core @virentia/router @virentia/router-paths
pnpm add @virentia/react @virentia/router-react react
pnpm add historyThe router package accepts history adapters, but it does not create browser or memory history internally. Applications own history creation.
Pages
Core (@virentia/router + @virentia/router-paths):
- Overview
- Path templates
- Route model
- Router and history
- Navigation
- Query tracking
- Virtual, chained & grouped routes
React (@virentia/router-react):
React Native (@virentia/router-react-native):
Other: