Blazor.NavigablePages 1.0.5

dotnet add package Blazor.NavigablePages --version 1.0.5
                    
NuGet\Install-Package Blazor.NavigablePages -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazor.NavigablePages" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blazor.NavigablePages" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="Blazor.NavigablePages" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Blazor.NavigablePages --version 1.0.5
                    
#r "nuget: Blazor.NavigablePages, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Blazor.NavigablePages@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Blazor.NavigablePages&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=Blazor.NavigablePages&version=1.0.5
                    
Install as a Cake Tool

Blazor.NavigablePages

Meet Blazor.NavigablePages! A small library for navigation in Blazor. Define each page's details about how to navigate to it locally via an interface and navigate ergonomically using NavigationManager extension methods. With or without parameters.

Installation

  • NuGet: Blazor.NavigablePages
  • dotnet CLI: dotnet add package Blazor.NavigablePages
  • Import namespace: using Blazor.NavigablePages;

Note: In the examples below, Microsoft.AspNetCore.WebUtilities (QueryHelpers) is optionally used to conveniently build query strings.

Parameterless Navigation

Implement the interface with the matching page directive:

@page "/vans"
@using Blazor.NavigablePages
@implements INavigablePage<VansPage>

@code {
    public static string Path => "/vans";
}

Navigate to the page:

@using Blazor.NavigablePages
@inject NavigationManager Nav

<button @onclick="() => Nav.NavigateTo<VansPage>()">Go to Vans</button>

Implement the generic interface variant with a parameter type:

using Blazor.NavigablePages;
using Microsoft.AspNetCore.Components;

public partial class VansEditPage : INavigablePage<VansEditPage, Guid>
{ 
    [SupplyParameterFromQuery(Name = "id")]
    private Guid? VanId { get; set; }
    
    public static string Path => "/vans/edit";

    public static string GetPathWithParameters(Guid id)
    {
        return Path + "/" + id;
    }
}

Navigate to the page:

@using Blazor.NavigablePages;
@inject NavigationManager Nav

<button @onclick="GoToEdit">Edit Van</button>

@code {
    void GoToEdit()
    {
        Nav.NavigateTo<VansListPage, Guid>(Guid.NewGuid();
    }
}

Implement the generic interface variant with a parameter type.

using Blazor.NavigablePages;
using Microsoft.AspNetCore.WebUtilities; // optional for QueryHelpers

public record Parameter(string Sort, string Brand);

public partial class VansListPage : INavigablePage<VansListPage, Parameter>
{ 
    public static string Path => "/vans/list";

    public static string GetPathWithParameters(Parameter p)
    {
        var dict = new Dictionary<string, string>
        {
            ["sort"] = p.Sort,
            ["brand"] = p.Brand
        };
        return QueryHelpers.AddQueryString(Path, dict);
    }
}

Navigate to the page:

@inject NavigationManager Nav

<button @onclick="GoToFiltered">Filtered Vans</button>

@code {
    void GoToFiltered()
    {
        var parameter = new Parmeter(Sort: "asc", Brand: "Opel");
        Nav.NavigateTo<VansListPage, Parmeter>(parameter);
    }
}

Why this package?

  • No string literals scattered throughout your code
  • Readable navigation via NavigationManager.NavigateTo<TPage>()
  • Extensible for parameters through GetPathWithParameters

Support

Found an issue or have an idea? Please open an issue in the repository. Happy navigating!

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 276 9/14/2025
1.0.4 243 9/14/2025
1.0.3 379 4/28/2025 1.0.3 is deprecated because it is no longer maintained.
0.0.2 352 4/28/2025 0.0.2 is deprecated because it is no longer maintained.
0.0.1 383 4/28/2025 0.0.1 is deprecated because it is no longer maintained.