TheNerdCollective.Components.BlazorServerCircuitHandler 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TheNerdCollective.Components.BlazorServerCircuitHandler --version 1.0.0
                    
NuGet\Install-Package TheNerdCollective.Components.BlazorServerCircuitHandler -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="TheNerdCollective.Components.BlazorServerCircuitHandler" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TheNerdCollective.Components.BlazorServerCircuitHandler" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="TheNerdCollective.Components.BlazorServerCircuitHandler" />
                    
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 TheNerdCollective.Components.BlazorServerCircuitHandler --version 1.0.0
                    
#r "nuget: TheNerdCollective.Components.BlazorServerCircuitHandler, 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 TheNerdCollective.Components.BlazorServerCircuitHandler@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=TheNerdCollective.Components.BlazorServerCircuitHandler&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=TheNerdCollective.Components.BlazorServerCircuitHandler&version=1.0.0
                    
Install as a Cake Tool

TheNerdCollective.Components.BlazorServerCircuitHandler

A production-ready Blazor Server circuit reconnection handler with automatic reconnection UI and graceful error handling.

Overview

This package provides a drop-in Razor component that handles Blazor Server circuit reconnection scenarios with:

  • Automatic reconnection with exponential backoff
  • Silent reconnection for brief interruptions
  • Professional reconnection overlay with countdown timer
  • Graceful handling of server restarts and deployments

Quick Start

Installation

dotnet add package TheNerdCollective.Components.BlazorServerCircuitHandler

Setup

  1. Add to your root component (App.razor):
<Routes @rendermode="InteractiveServer" />
<CircuitReconnectionHandler @rendermode="InteractiveServer" />
  1. Import in _Imports.razor:
@using TheNerdCollective.Components.BlazorServerCircuitHandler
  1. Done! The component handles everything automatically.

Features

✅ Automatic Reconnection - Infinite reconnection with exponential backoff (1s → 5s)
✅ Silent First Attempts - No UI shown for quick reconnects (first 5 attempts)
✅ Professional UI - Beautiful reconnection overlay with countdown timer
✅ Error Suppression - Filters out MudBlazor and expected disconnection errors
✅ Graceful Fallback - Auto-reload when circuits expire
✅ Zero Configuration - Works out of the box

How It Works

Scenario 1: Brief Network Interruption

Connection lost → 5 silent reconnection attempts → Connected
Result: User sees nothing

Scenario 2: Extended Disconnection

Connection lost → 5 failed attempts → UI overlay shown
User waits or clicks "Reload Now" → Connection restored
Result: Overlay disappears, app continues normally

Scenario 3: Server Restart/Deployment

Circuit expires → Auto-reload triggered
Result: Fresh session with new app instance

Configuration

The handler uses sensible defaults, but you can customize circuit retention in your host's Program.cs:

builder.Services.Configure<CircuitOptions>(options =>
{
    options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(10);
    options.JSInteropDefaultCallTimeout = TimeSpan.FromSeconds(30);
    options.DetailedErrors = builder.Environment.IsDevelopment();
});

Dependencies

  • MudBlazor 8.15+ (optional, but recommended)
  • .NET 10.0+
  • Blazor Server enabled

Browser Compatibility

  • ✅ Chrome 60+
  • ✅ Firefox 55+
  • ✅ Safari 12+
  • ✅ Edge 79+

License

Apache License 2.0 - See LICENSE file for details

Repository

TheNerdCollective.Components on GitHub


Built with ❤️ by The Nerd Collective Aps

By Jan Hjørdie - LinkedIn | Dev.to

MIT License - See LICENSE file for details

Support

For issues, questions, or contributions, visit:

Version History

  • 1.0.0 (2025-12-19) - Initial release with infinite reconnection handler, professional UI, and error suppression

Built with ❤️ for the Blazor Server community

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.2.1 196 3/2/2026
1.2.0 172 1/13/2026 1.2.0 is deprecated because it is no longer maintained.
1.1.0 149 1/10/2026
1.0.0 277 12/19/2025