Skip to content

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

PackagePurpose
@virentia/router-pathsTyped path templates, parsing, building, and Express conversion
@virentia/routerRoutes, routers, history adapters, query tracking, virtual routes, groups, chained routes
@virentia/router-reactRouterProvider, Link, route views, lazy views, outlets, hooks
@virentia/router-react-nativeStack and bottom-tabs navigators that bind route views to React Navigation

Install

sh
pnpm add @virentia/core @virentia/router @virentia/router-paths
pnpm add @virentia/react @virentia/router-react react
pnpm add history

The 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):

React (@virentia/router-react):

React Native (@virentia/router-react-native):

Other: