BlazorWasm.PageFx 1.0.0

dotnet add package BlazorWasm.PageFx --version 1.0.0
                    
NuGet\Install-Package BlazorWasm.PageFx -Version 1.0.0
                    
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="BlazorWasm.PageFx" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorWasm.PageFx" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BlazorWasm.PageFx" />
                    
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 BlazorWasm.PageFx --version 1.0.0
                    
#r "nuget: BlazorWasm.PageFx, 1.0.0"
                    
#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 BlazorWasm.PageFx@1.0.0
                    
#: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=BlazorWasm.PageFx&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BlazorWasm.PageFx&version=1.0.0
                    
Install as a Cake Tool

icon

BlazorWasm.PageFx

PRs Welcome License: MIT

Lightweight, plug-and-play page transition animations for Blazor WebAssembly navigation.

View in DocFx

This package provides a simple way to animate route changes without rewriting your routing logic or introducing heavy animation frameworks.

⚠️ Blazor WebAssembly only
This package is designed and tested exclusively for Blazor WASM projects.

Features

  • Smooth page transition animations on navigation
  • Minimal setup (no custom router required)
  • Lightweight (no external dependencies)
  • Works with existing Router
  • CSS-based animations (easy to customise)

Installation

dotnet add package BlazorWasm.PageFx

Setup

Register the service

Modify your Program.cs:

using Racer.BlazorWasm.PageFx.Services;

// --snip--
builder.Services.AddPageFxService();

// Replace:
// await builder.Build().RunAsync();

// With:
var host = builder.Build();

await host.Services
    .GetRequiredService<PageFxService>()
    .InitializeAsync();

await host.RunAsync();

NB: The default selectors where the transition animations will be applied are .page-fx-app and page-fx-content. They have to be referenced in your MainLayout.razor file like so:

<div class="app page-fx-app">  
    <NavBar/>  
    <div class="container page-fx-content">  
        <div class="second-container">  
            @Body  
        </div>  
    </div>  
    <PageFooter/>  
</div>

page-fx-app - Transition animation will be applied to the entire page.
page-fx-content - Transition animation will be applied only to the page content.

Wrap your router(Optional)

Modify your App.razor:

@using Racer.BlazorWasm.PageFx.Components

<PageFxHost>
	<Router AppAssembly="typeof(App).Assembly" />
	@* --snip-- *@
	</Router>
</PageFxHost>

NB: Without this, only the initial page load transition animation will not be applied.

Reference the CSS file

In wwwroot/index.html, inside the <head> section:

<link rel="stylesheet" href="_content/BlazorWasm.PageFx/pageFx.css" />

Customization

1. Extend/Override Transitions

Transition animations are driven by CSS, so you can easily override or extend animations.
Add this to any referenced CSS file in your project:

.page-fx-route-in {  
    transform: initial;  
    opacity: initial;  
}  
  
.page-fx-route-out {  
    transform: scale(0.98);  
    opacity: 0;  
}

Parameters:

  • .page-fx-route-in - in-transition animation on subsequent page navigations
  • .page-fx-route-out - out-transition animation on subsequent page navigations

Other Parameters(extendable):

  • .page-fx-init-in - in-transition animation on initial page loads
  • .page-fx-init-out - out-transition animation on initial page loads

FAQs

Does this work with Blazor Server?

No. This package targets Blazor WebAssembly only.

Does it replace the Router?

No. It wraps the existing Router component.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

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.0 155 1/31/2026

First release