Getting Started

BlazorCompose lets you write Blazor UI as plain C#. This page is itself rendered from Markdown, converted at build time and injected through Html.Raw.

Installation#

Add the runtime and the source generator to your project, then derive your components from ComposeComponentBase.

A first component#

using Microsoft.AspNetCore.Components;
using BlazorCompose;
using static BlazorCompose.Html;

[Route("/")]
public partial class Home : ComposeComponentBase
{
    protected override View Body =>
        Div(
            H1("Hello"),
            Span("Welcome to BlazorCompose."));
}

Next steps#

An unhandled error has occurred. Reload 🗙