Skip to main content
net8.0

Avalonia Blazor Bindings enables using Blazor syntax in .razor files to build native Avalonia apps.

Published
Jul 7, 2025
1y ago
Total Downloads
6.3K
6,270

Install

dotnet add package Blazonia --version 0.0.0-alpha.0.894
ProductVersions
.NET
net8.0

README

🪢 Blazonia

Nuget

🤔 What is this?

Blazonia enables developers to use the Blazor syntax to build Avalonia applications. Compared to Avalonia’s original XAML syntax, Blazonia’s Blazor-based approach is more concise and straightforward, allowing you to develop pages using a single file. It is particularly suitable for small to medium-sized client applications.

✨ Note

  • 🚫 After using Blazonia, there will be no HTML code or WebView components involved.
  • 🤩 Fully utilizes native Avalonia controls

Thanks to Avalonia's cross-platform capabilities, Blazonia enables developers to rapidly build beautiful, pixel-perfect applications for 💻 desktop, 📱 mobile, and 🌐 web platforms.

🌰 A Simple Example

@page "/"

<Window Title="Counter" Width="600" Height="400">
    <StackPanel>
        <Label FontSize="30">You pressed @_count times </Label>
        <CheckBox @bind-IsChecked="_showButton">Button visible</CheckBox>
        @if (_showButton! == true)
        {
            <Button OnClick="OnButtonClick">+1</Button>
        }
    </StackPanel>
</Window>

@code {

    int _count;
    
    bool? _showButton = true;
    
    void OnButtonClick() => _count++;
}

Counter

🛫 Start

  1. Install project template
dotnet new install BlazoniaTemplate
  1. Create a new project
dotnet new blazonia -o BlazoniaApp

Please use Rider to edit the project, because the code hints of razor files in Visual Studio 2022 and VS Code may fail.

📄 Acknowledge

Blazonia is a fork of the https://github.com/Epictek/Avalonia-Blazor-Bindings branch, maintained by developers including Microsoft, Dreamescaper, warappa, and Epictek.

Blazor's syntax is highly approachable and beginner-friendly. However, since the original repository appears to be inactive, I will continue to maintain this project. As the original name is already taken on NuGet, I have renamed it to Blazonia (Blazor + Avalonia) to facilitate publishing the NuGet package and project template.

Changes from Previous Version

No structural changes between v0.0.0-alpha.0.890 and v0.0.0-alpha.0.894.

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.