Installation

Add the AvaloniaUIKit package and the GpuiTheme to your App.axaml.

Package

dotnet add package AvaloniaUIKit

The themes for Avalonia's optional packages are separate, so an app that does not use them takes no extra dependency:

dotnet add package AvaloniaUIKit.ColorPicker
dotnet add package AvaloniaUIKit.DataGrid

The library targets the current Avalonia 12 release and the latest .NET SDK.

Theme

Add GpuiTheme to the application's styles. It is a Styles theme, like FluentTheme, and works on its own: it also themes the window, popups, the adorner layer and the focus ring, as GPUI draws them.

App.axaml
<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:uikit="clr-namespace:AvaloniaUIKit;assembly=AvaloniaUIKit"
             x:Class="MyApp.App">
  <Application.Styles>
    <uikit:GpuiTheme />
  </Application.Styles>
</Application>

The optional packages add a theme each, after GpuiTheme:

App.axaml
<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:uikit="clr-namespace:AvaloniaUIKit;assembly=AvaloniaUIKit"
             xmlns:uikitcolor="clr-namespace:AvaloniaUIKit;assembly=AvaloniaUIKit.ColorPicker"
             xmlns:uikitgrid="clr-namespace:AvaloniaUIKit;assembly=AvaloniaUIKit.DataGrid"
             x:Class="MyApp.App">
  <Application.Styles>
    <uikit:GpuiTheme />
    <uikitcolor:GpuiColorPickerTheme />
    <uikitgrid:GpuiDataGridTheme />
  </Application.Styles>
</Application>

In XAML that uses the new controls, map the namespace with using::

xmlns:gpui="using:AvaloniaUIKit"

On top of FluentTheme

GpuiTheme only themes the controls on the Compatibility page. To keep a look for the others, add FluentTheme first; the later theme wins, and the themed controls look the same with or without Fluent underneath.

App.axaml
<Application.Styles>
  <FluentTheme />
  <uikit:GpuiTheme />
</Application.Styles>

NativeAOT

AvaloniaUIKit and AvaloniaUIKit.ColorPicker are trimmable and AOT compatible: compiled bindings by default, and reflection is banned by an analyzer. Avalonia's DataGrid itself is not trimmable, so AvaloniaUIKit.DataGrid gives no NativeAOT guarantee; the basic table is TableView, in the main package.