Brouter documentation
Brouter is a modern, declarative, nestable router for Blazor - framework-parity route templates plus the capabilities modern router libraries are measured by: guards, data loaders with stale-while-revalidate caching, keep-alive, view transitions, and a source generator for compile-time-safe URLs.
Why another router?
Blazor's built-in Router stops at matching a URL to a component. Everything
else a modern SPA expects from its router - nested layouts, navigation guards, route-level
data loading with caching, page transitions, kept-alive page state - is left to every app
to hand-roll. Brouter provides all of it declaratively, while staying superset-compatible:
every @page template matches identically, [Authorize] keeps
being enforced by the framework's own components, and the built-in Router's templates port
over verbatim. Its API design is informed by React Router, Vue Router, Angular Router,
SvelteKit and TanStack Router - and by ASP.NET Core's route matcher.
These docs are a working showcase: this site is a Blazor app routed by Brouter itself, and nearly every page links to live routes you can click. The playground indexes all of them.
Three ways in
The pages below read in order, but nobody has to. Pick the entry point that matches what you are doing right now.
Learn it
Install the package, then follow the pipeline that runs behind every navigation - what happens before the URL moves, and what each step can do about it.
Start reading →Look it up
Every component parameter, service member, option and value type in one page, with its default - the page to keep open while you write code.
API reference →Copy an answer
Protected areas, unsaved-changes prompts, revalidation after a mutation, breadcrumbs, query-state filters - task-shaped solutions, written as code.
Recipes →Every page, by topic
The whole table of contents, with what each page covers. This is the same catalog the sidebar, the search box and the previous/next pager are built from - and the same one the MCP server hands to an AI agent.