DrylReconnectModal
A drop-in, on-brand replacement for Blazor Server's default reconnect overlay. Place it once in your layout and it takes over the framework's connection UI — glassy, animated and correct in both color modes, with every message overridable.
How it works
Blazor looks for one element with id="components-reconnect-modal" and toggles
state classes on it as the circuit drops and recovers. DrylReconnectModal
renders exactly that element and hangs all of its visuals — and its enter/exit animation —
on those classes with pure CSS. That matters: while the connection is down
no C# runs, so the two action buttons use a native onclick
(Blazor.reconnect() / location.reload()) that works on a dead circuit.
@* MainLayout.razor — place it ONCE, near the end of the body. *@
<DrylReconnectModal />
@* That's it. It replaces the default #components-reconnect-modal.
Remove any hand-written reconnect markup you had before. *@The three states
The framework drives which state shows. Below, each state is forced on and captured inside a frame (the real component is a full-screen overlay). The spinner and glow are live.
components-reconnect-show
components-reconnect-failed
components-reconnect-rejected
In a real reconnect the reconnecting state also shows a live
Attempt X / Y counter and a Next try in Ns line, filled in by the
framework (keep ShowAttemptCounter on, which is the default).
Custom messages
Every string is a plain parameter with a sensible default — override any of them, e.g. to localize the overlay:
<DrylReconnectModal ReconnectingText="Reconnecting…"
FailedText="Connection failed. The server may be unreachable."
RejectedText="Deine Sitzung ist abgelaufen."
RetryButtonText="Erneut versuchen"
ReloadButtonText="Seite neu laden"
AttemptLabel="Versuch"
NextAttemptLabel="Next attempt in" />