Avalonia.Controls.Maui 11.0.0-preview.2.26082.825

Prefix Reserved
This is a prerelease version of Avalonia.Controls.Maui.
dotnet add package Avalonia.Controls.Maui --version 11.0.0-preview.2.26082.825
                    
NuGet\Install-Package Avalonia.Controls.Maui -Version 11.0.0-preview.2.26082.825
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Avalonia.Controls.Maui" Version="11.0.0-preview.2.26082.825" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Avalonia.Controls.Maui" Version="11.0.0-preview.2.26082.825" />
                    
Directory.Packages.props
<PackageReference Include="Avalonia.Controls.Maui" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Avalonia.Controls.Maui --version 11.0.0-preview.2.26082.825
                    
#r "nuget: Avalonia.Controls.Maui, 11.0.0-preview.2.26082.825"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Avalonia.Controls.Maui@11.0.0-preview.2.26082.825
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Avalonia.Controls.Maui&version=11.0.0-preview.2.26082.825&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Avalonia.Controls.Maui&version=11.0.0-preview.2.26082.825&prerelease
                    
Install as a Cake Tool

Avalonia.Controls.Maui

Avalonia.Controls.Maui replaces .NET MAUI's native platform controls with Avalonia-drawn controls. This enables MAUI apps to run on platforms that MAUI doesn't natively support, such as Linux and WASM, as well as platforms Avalonia supports, such as macOS AppKit. All while maintaining a consistent look across all platforms.

Getting Started

Prerequisites

  • .NET 11 SDK
  • A .NET MAUI workload installed (dotnet workload install maui)
  • If using WASM, install wasm-tools (dotnet workload install wasm-tools)

Quick Start

The fastest way to get started is with a MAUI single-project app using the Avalonia.Controls.Maui.Desktop package.

For other cases, refer to our docs.

1. Include the standard TFM and NuGet packages to your .csproj:

<PropertyGroup>
    
    <TargetFrameworks>net11.0;net11.0-android;net11.0-ios;net11.0-maccatalyst</TargetFrameworks>
    <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">
        $(TargetFrameworks);net11.0-windows10.0.19041.0</TargetFrameworks>
    <OutputType>Exe</OutputType>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
</PropertyGroup>

<ItemGroup>
    <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
    <PackageReference Include="Avalonia.Controls.Maui" Version="..." />
    
    <PackageReference Include="Avalonia.Controls.Maui.Desktop"
                      Condition="'$(TargetFramework)' == 'net11.0'" Version="..." />
</ItemGroup>

If you include the Avalonia.Controls.Maui.Desktop package, it will automatically create the Avalonia bootstrap code through its source generator. No manual Avalonia Program.cs or AppBuilder setup is needed for desktop.

2. Call UseAvaloniaApp() in your MauiProgram.cs:

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
// `UseAvaloniaApp()` replaces all MAUI controls with Avalonia-drawn equivalents.
#if !IOS && !MACCATALYST && !ANDROID && !WINDOWS
            .UseAvaloniaApp()
#else
// `UseAvaloniaEmbedding<AvaloniaApp>()` lets you embed Avalonia views inside the native MAUI shell.
            .UseAvaloniaEmbedding<AvaloniaApp>()
#endif
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

        return builder.Build();
    }
}

That's it — run with dotnet run and your MAUI app renders with Avalonia.

WASM / Browser

Because the WASM target framework requires a different SDK, we can't reference it inside of the .NET MAUI Single Project application. Instead, we can create a separate browser project that references your MAUI library.

1. Create a browser .csproj:

<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
    <PropertyGroup>
        <TargetFramework>net11.0-browser</TargetFramework>
        <OutputType>Exe</OutputType>
        <UseMaui>true</UseMaui>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Avalonia.Controls.Maui" Version="..." />
        <PackageReference Include="Avalonia.Browser" Version="..." />
        <PackageReference Include="Avalonia.Themes.Fluent" Version="..." />
        <PackageReference Include="Avalonia.Fonts.Inter" Version="..." />
        <PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="../YourMauiApp/YourMauiApp.csproj" />
    </ItemGroup>
</Project>

Your MAUI code can live in a class library referenced by both the single-project app and the browser project. Alternatively, you can keep a single-project app and disable OutputType Exe for the net11.0-browser TFM.

2. Add a MauiProgram.cs with useSingleViewLifetime: true:

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<MauiAppStub>()
// Hint: useSingleViewLifetime also applies to Mobile platforms, like iOS/Android, and Mac Catalyst.
#if BROWSER
            .UseAvaloniaApp(useSingleViewLifetime: true)
#endif
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                ...
            });

        return builder.Build();
    }
}

Browser apps use useSingleViewLifetime: true since WebAssembly runs in a single-view context.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible.  net11.0-android36.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Avalonia.Controls.Maui:

Package Downloads
Avalonia.Controls.Maui.Compatibility

Avalonia.Controls.Maui.Compatibility provides handlers for legacy/obsolete MAUI controls (ListView, Frame, TableView, Cells) using Avalonia-based implementations. These controls are provided for backward compatibility with apps porting from Xamarin.Forms.

Avalonia.Controls.Maui.Desktop

.NET MAUI Desktop platform support for Avalonia.Controls.Maui.

Avalonia.Controls.Maui.SkiaSharp.Views

Avalonia.Controls.Maui.SkiaSharp.Views provides an implementation of SkiaSharp.Views.Maui.Controls, using Avalonia-based implementations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.0-preview.2.26082.825 7 3/23/2026
11.0.0-preview.2.26075.1512 126 3/16/2026