Getting started with Plumix

Plumix is a Flutter-faithful UI framework for .NET. This guide takes you from dotnet new to your first widget tree rendered on screen.

What Plumix is

Plumix mirrors Flutter's three-tree architecture in C#. You describe the UI as a tree of immutable Widgets. The framework instantiates a parallel tree of mutable Elements, which in turn manage RenderObjects that perform layout, paint and hit-testing.

Avalonia provides the platform host — window, input events, GPU-backed surface. Everything above that surface is owned by Plumix, which is what separates it from a wrapper library: there is no second control set underneath translating your widgets into someone else's layout system.

If you have written Flutter before, the payoff is that porting a Dart widget to C# is closer to translation than to a rewrite. If you haven't, Plumix is still a normal declarative UI framework — no XAML, no code-behind, just C#. The architecture page explains the three trees in detail.

Installation

Plumix targets net10.0, so you need the .NET 10 SDK. Create a console app and add the packages — they are in beta, hence --prerelease. Avalonia.Desktop provides the window on Windows, macOS and Linux:

terminal
dotnet new console -n HelloPlumix
cd HelloPlumix
dotnet add package Plumix --prerelease
dotnet add package Plumix.Material --prerelease
dotnet add package Avalonia.Desktop

Plumix alone is enough for the core widget set. Add Plumix.Material for Material Design 3 controls, or Plumix.Cupertino for iOS-style ones — see the controls catalog for what ships in each.

Your first app

Compose a simple Material scaffold, then hand it to a PlumixApplication: an Avalonia application whose only job is to create the root widget. Avalonia's AppBuilder opens the window, and Plumix mounts the widget tree into it.

Program.cs
using Avalonia;
using Plumix;
using Plumix.Material;
using Plumix.Widgets;

public sealed class HelloApp : StatelessWidget
{
    public override Widget Build(BuildContext context)
    {
        return new MaterialApp(
            home: new Scaffold(
                appBar: new AppBar(title: new Text("Hello, Plumix")),
                body: new Center(
                    child: new Text("Welcome to the Flutter model in C#.")
                )
            )
        );
    }
}

// The Avalonia application that hosts the widget tree.
public sealed class App : PlumixApplication
{
    protected override Widget CreateRootWidget() => new HelloApp();

    protected override PlumixOptions CreateOptions() => new() { Title = "Hello, Plumix" };
}

public static class Program
{
    [STAThread]
    public static void Main(string[] args) => AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .StartWithClassicDesktopLifetime(args);
}

Run it with dotnet watch rather than dotnet run. Hot reload preserves State across edits, so counters and scroll positions survive while the widget tree rebuilds — the workflow Flutter developers expect.

The same widget tree runs on mobile and in the browser: Plumix.Android ships PlumixMainActivity for Android, and the repository contains iOS and WebAssembly sample hosts. These hosts are in beta — cross-host stability is the current milestone on the roadmap.

Where to go next