Search⌘ K
AI Features

Razor Components

Explore how to build and use Razor components within Blazor WebAssembly applications. Understand component parameters for dynamic behavior, component syntax, naming conventions, and the asynchronous lifecycle methods that manage component rendering and integration with JavaScript.

Blazor WebAssembly is a component-driven framework. Razor components are the fundamental building blocks of a Blazor WebAssembly application. They are classes that are implemented using a combination of C#, HTML, and Razor markup. When the web app loads, the classes get downloaded into the browser as normal .NET assemblies (DLLs).

Note: In this course, the terms “Razor component” and “component” are used interchangeably.

Using components

HTML element syntax is used to add a component to another component. The markup looks like an HTML tag where the name of the tag is the component type.

The following markup in ...