Skip to content
oneo-mePublic

About

Avalonia UI toolkit and MVVM framework: an M-prefixed control set, OKLch light/dark themes, region and tab navigation, modal dialogs, and generated language keys. Targets .NET 10.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

Manta

Manta

English | 简体中文

GitHub Blog X GitHub Sponsors

Manta is a UI toolkit and MVVM framework for building cross-platform desktop applications on Avalonia. It provides themeable controls, an explicit MVVM runtime, and compile-time code generation.

The MantaDemo overview screen

Features

  • A broad set of M-prefixed controls, plus themed styles for supported Avalonia controls.
  • Light and dark themes built on the OKLch color space.
  • Model, ViewModel, WindowModel and DialogModel base classes for the MVVM layer.
  • Attribute-based view registration that generates view creation at compile time.
  • Native AOT and trimming compatibility, with reflection-free view and language generation.
  • Region and tab navigation with RegionManager<T>.
  • Modal dialogs with DialogModel.
  • Type-safe language keys generated from YAML files.

Install

Manta targets .NET 10 and Avalonia 12. Packages are published to NuGet.org.

dotnet add package ONEO.Manta
dotnet add package ONEO.Manta.Generators

Add ONEO.Manta.Generators to use the [View<T>] and language-key generators.

Native AOT

Manta is Native AOT and trimming compatible. The library builds with IsAotCompatible, and its generators wire views and language keys without reflection-based discovery. MantaDemo publishes with PublishAot in Release.

<PropertyGroup>
    <PublishAot>true</PublishAot>
    <PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

Usage

Create the application entry point and subclass MApp:

using Avalonia;
using Manta;

static class Program
{
    [STAThread]
    public static void Main(string[] args)
    {
        MApp.Build<App>().StartWithClassicDesktopLifetime(args);
    }
}

Register the theme and a main window model in the application:

<MApp xmlns="https://github.com/avaloniaui"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      x:Class="MyApp.App">
    <MApp.Styles>
        <MantaTheme />
    </MApp.Styles>
</MApp>
sealed class App : MApp
{
    public override void Initialize() => AvaloniaXamlLoader.Load(this);

    protected override void OnInitialize(out MAppOptions options)
    {
        options = new() { MainModel = () => new Main_Model() };
    }
}

Pair a view model with its view using the View attribute. The generator supplies CreateView, so the model only declares its bindings:

[View<Main>]
sealed partial class Main_Model : WindowModel
{
}

sealed partial class Main : MView
{
    public Main() => InitializeComponent();
}

Read the architecture overview before extending the library.

Samples

samples/ holds standalone applications that consume the published packages instead of the projects under source/. MantaSample demonstrates startup, MVVM, region navigation, dialogs, localization and the common controls. MantaComponents is a plain Avalonia application that only adds the Manta theme and controls, without the Manta MVVM runtime. MantaThemeSample uses only the Manta theme variables, without any Manta control or runtime. AvaloniaI18nSample adds Manta localization to an otherwise stock Avalonia application.

cd samples
dotnet run --project MantaSample
dotnet run --project MantaComponents
dotnet run --project MantaThemeSample
dotnet run --project AvaloniaI18nSample

Documentation

Development

Install the .NET 10 SDK. The library and demo projects live under source/; run the commands from there:

cd source
dotnet build Manta.slnx
dotnet run --project MantaDemo

After editing a control's Design.PreviewWith block or theme files, regenerate the derived files:

dotnet run --project MantaPrepare

Release by pushing a v<major>.<minor>.<patch> tag. The release workflow publishes the packages to NuGet.org and creates the GitHub release, taking its body from the matching CHANGELOG.md section. Publishing uses NuGet trusted publishing: the workflow exchanges its GitHub OIDC token for a short-lived API key, so only the NUGET_USER repository secret (your nuget.org username) is required, and a trusted publishing policy for release.yml must exist on nuget.org.

Contributor rules live in AGENTS.md.

Website

The marketing site lives in website/ and is built with React Router and shadcn/ui. The Website workflow deploys it to GitHub Pages.

cd website
bun install
bun run dev

See website/README.md for the build and deployment details.

Changelog

See CHANGELOG.md for user-visible changes.

License

Manta is released under the MIT license.

About

Avalonia UI toolkit and MVVM framework: an M-prefixed control set, OKLch light/dark themes, region and tab navigation, modal dialogs, and generated language keys. Targets .NET 10.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages