Blazor is a .NET framework for building interactive web user interfaces using C# instead of JavaScript. It provides a component-based UI composition model where reusable, self-contained UI elements are built with C# logic and Razor markup, supporting nesting, parameters, and lifecycle events. The framework offers two primary rendering models: a client-side runtime that compiles C# to WebAssembly and executes directly in the browser, and a server-side model that renders UI on the server and sends incremental DOM updates over a persistent SignalR connection.
A central capability of Blazor is its JavaScript interop bridge, which enables bidirectional communication between .NET and JavaScript. This includes invoking JavaScript functions from .NET, calling .NET methods from JavaScript (including synchronous calls on WebAssembly), and managing object references, stream transfers, and byte array transfers without Base64 encoding overhead. The framework also supports loading JavaScript from standard ES modules to keep component dependencies self-contained and avoid global namespace pollution.
Beyond web development, Blazor extends to cross-platform .NET UI development by embedding components inside native desktop or mobile apps using an embedded web view control with a local interop channel. The framework includes ahead-of-time IL trimming to reduce published application size, with configurable granularity and the ability to preserve types and parameter names for reflection-dependent code. Code can be shared across .NET platforms by referencing libraries that conform to a common standard, enabling consistent business logic across web, desktop, and mobile projects.