https://github.com/soenneker/soenneker.blazor.utils.navigation
A Blazor WebAssembly library that features navigate back, login/logout, reload and more
https://github.com/soenneker/soenneker.blazor.utils.navigation
blazor csharp dotnet navigation utils
Last synced: 13 days ago
JSON representation
A Blazor WebAssembly library that features navigate back, login/logout, reload and more
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.blazor.utils.navigation
- Owner: soenneker
- License: mit
- Created: 2023-04-28T00:17:10.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-06-13T21:46:16.000Z (17 days ago)
- Last Synced: 2026-06-13T23:22:48.068Z (17 days ago)
- Topics: blazor, csharp, dotnet, navigation, utils
- Language: C#
- Homepage: https://soenneker.com
- Size: 1.76 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/Soenneker.Blazor.Utils.Navigation/)
[](https://github.com/soenneker/soenneker.blazor.utils.navigation/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/Soenneker.Blazor.Utils.Navigation/)
[](https://github.com/soenneker/soenneker.blazor.utils.navigation/actions/workflows/codeql.yml)
#  Soenneker.Blazor.Utils.Navigation
Can work side-by-side existing Blazor [NavigationManager](https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-7.0) usage, and still work with navigate back
## Installation
```
dotnet add package Soenneker.Blazor.Navigation
```
## Usage
1. Register `INavigationUtil` within `Program.cs` or wherever your registering your services:
```csharp
public static async Task Main(string[] args)
{
...
builder.Services.AddNavigationUtil();
}
```
2. Warm it up so it can begin recording navigation history. Call after the `WebAssemblyHost` has been built:
```csharp
public static async Task Main(string[] args)
{
...
WebAssemblyHost host = builder.Build();
host.Services.WarmupNavigation();
}
```
3. Inject `INavigationUtil` within pages/components where you need to access navigation methods:
```csharp
@using Soenneker.Blazor.Navigation.Abstract
@inject INavigationUtil NavigationUtil
```
### Navigating back
```csharp
NavigationUtil.NavigateBack();
```
### Navigating
```csharp
// within the SPA client
NavigationUtil.NavigateTo("/users");
// forcing a page load
NavigationUtil.NavigateTo("/users", true);
```