.NET › Blazor (Server & WebAssembly)

How does Blazor's render mode system (Static, Interactive Server, Interactive WebAssembly, Interactive Auto) work in .NET 8+'s unified Blazor model?

Advanced

Answer

Since .NET 8, a single Blazor project can mix render modes per component: Static Server-Side Rendering (no interactivity, fastest initial load), Interactive Server (SignalR-based, like classic Blazor Server), Interactive WebAssembly (client-side execution, like classic Blazor WASM), and Interactive Auto (starts with Server for instant interactivity, then switches to WebAssembly once the client-side runtime finishes downloading in the background) -- letting you choose the optimal trade-off per-component rather than committing the entire app to one model.
@page "/counter"
@rendermode InteractiveAuto

<button @onclick="IncrementCount">Count: @count</button>

@code {
    private int count = 0;
    private void IncrementCount() => count++;
}
Real-world example A content-heavy marketing site uses Static SSR for most pages (fastest possible load, good SEO) but applies InteractiveServer render mode only to a specific contact form component that needs client-side validation feedback.

Common follow-ups: How does Interactive Auto decide when to switch from Server to WebAssembly?;What are the constraints on mixing render modes within one component tree?