blazor
Installation
SKILL.md
Blazor Guide
Applies to: Blazor (.NET 8+), C# 12+, WebAssembly, Server, Blazor United, Interactive Web Apps
Core Principles
- Component-Based: Build encapsulated
.razorcomponents that own their state and rendering - Hosting Flexibility: Choose WebAssembly, Server, or Blazor United (hybrid) per-component
- C# Everywhere: Share models, validation, and logic between client and server
- Type Safety: Leverage nullable reference types and strong parameter typing
- Lifecycle Awareness: Understand component lifecycle to avoid leaks and race conditions
Hosting Models
| Model | Runs In | Best For |
|---|---|---|
| WebAssembly | Browser (WASM) | Offline-capable apps, PWAs, reduced server load |
| Server | Server (SignalR) | Low-latency, SEO, thin clients |
| United (.NET 8) | Hybrid SSR + interactive | Per-component render mode selection |