Zafiro.Avalonia.Icons.Svg
51.2.0
dotnet add package Zafiro.Avalonia.Icons.Svg --version 51.2.0
NuGet\Install-Package Zafiro.Avalonia.Icons.Svg -Version 51.2.0
<PackageReference Include="Zafiro.Avalonia.Icons.Svg" Version="51.2.0" />
<PackageVersion Include="Zafiro.Avalonia.Icons.Svg" Version="51.2.0" />
<PackageReference Include="Zafiro.Avalonia.Icons.Svg" />
paket add Zafiro.Avalonia.Icons.Svg --version 51.2.0
#r "nuget: Zafiro.Avalonia.Icons.Svg, 51.2.0"
#:package Zafiro.Avalonia.Icons.Svg@51.2.0
#addin nuget:?package=Zafiro.Avalonia.Icons.Svg&version=51.2.0
#tool nuget:?package=Zafiro.Avalonia.Icons.Svg&version=51.2.0
Zafiro.Avalonia
A UI components library for Avalonia 11.3.x that provides controls, dialogs, behaviors, and helpers for desktop, mobile, and browser applications. Built with ReactiveUI, a strong functional-reactive orientation (Result<T>, Maybe<T>, IObservable<T>), and absolute respect for the MVVM pattern — no logic in views, no UI in ViewModels.
Packages
Getting Started
dotnet add package Zafiro.Avalonia
For dialogs:
dotnet add package Zafiro.Avalonia.Dialogs
For auto-generated view locators and section registrations (recommended):
dotnet add package Zafiro.Avalonia.Generators
Quick Start
Application Bootstrap with Connect
Wire up your app in one line — works on Desktop, Mobile, and Browser:
public override void OnFrameworkInitializationCompleted()
{
this.Connect(() => new MainView(), view => CompositionRoot.Create(view), () => new MainWindow());
base.OnFrameworkInitializationCompleted();
}
Connect handles IClassicDesktopStyleApplicationLifetime and ISingleViewApplicationLifetime automatically, so the same code runs everywhere.
Shell, Sections, and Navigation
A section-based navigation system integrated with Microsoft.Extensions.DependencyInjection:
ServiceCollection services = new();
services.AddSingleton<IShell, Shell>();
services.AddSingleton(DialogService.Create());
services.AddScoped<INavigator>(provider => new Navigator(provider, logger, RxApp.MainThreadScheduler));
services.AddAllSectionsFromAttributes(logger); // auto-discovers [Section] ViewModels
services.AddTransient<MainViewModel>();
var serviceProvider = services.BuildServiceProvider();
return serviceProvider.GetRequiredService<MainViewModel>();
Combined with Zafiro.Avalonia.Generators, sections are discovered from [Section] attributes and registered automatically.
Dialogs and Wizards
Dialogs that work on both desktop and mobile:
Result<Maybe<T>> result = await dialog.ShowAndGetResult(viewModel, "Title");
Build multi-step wizards declaratively with SlimWizard:
var wizard = WizardBuilder
.StartWith(() => new Page1ViewModel(), "Step 1")
.NextWith(model => model.Continue.Enhance("Next"))
.Then(result => new Page2ViewModel(result), "Step 2")
.NextWhenValid((vm, prev) => Result.Success(vm.Text!))
.WithCompletionFinalStep();
EnhancedCommand
Wraps ReactiveCommand with UX metadata (text, icon, name) and busy state — distinguishing between busy (executing) and disabled (can't execute) via IEnhancedCommand:
var command = ReactiveCommand.CreateFromTask(() => DoSomething());
var enhanced = command.Enhance("Save", name: "save");
// enhanced.IsBusy tracks execution; enhanced.CanExecute tracks enablement
View Locators
Automatically resolves Views for ViewModels by naming convention (MainViewModel → MainView) and by x:DataType discovery via source generators:
DataTemplates.Add(new NamingConventionViewLocator());
With Zafiro.Avalonia.Generators, x:DataType declarations in .axaml files are discovered at compile time and registered automatically.
Key Features
Navigation and Shell
- Shell / ShellView — Section-based application shell with sidebar navigation.
- Navigator — Observable navigation stack integrated with DI.
- SectionStrip — Tab-like section navigation with grouping support.
- Sections auto-registration — Source generator discovers
[Section]ViewModels and wires DI.
Controls
| Control | Description |
|---|---|
| HeaderedContainer | Content with header, footer, and configurable spacing |
| EdgePanel | Panel with Start, Content, and End regions |
| EnhancedButton | Button with icon, role-based theming, and box shadow |
| Loading | Loading indicator with content transition |
| BalancedWrapGrid | Wrap panel with balanced column widths and MaxItemWidth |
| MasterDetailsView | Side list with detail panel, responsive layout |
| ResponsivePresenter | Width-based content swap (Narrow/Wide + Breakpoint) |
| StepIndicator | Visual step progress for wizards |
Services
- DialogService — Show dialogs from ViewModels without coupling to the View layer.
- NotificationService — Push notifications from ViewModels.
- ILauncherService — Open URLs and files from ViewModels.
Commands and Selection
- EnhancedCommand —
ReactiveCommandwrapper with text/icon metadata, busy/disabled distinction viaIEnhancedCommand. - ReactiveSelection — Observable selection model with multi-select support.
- CommandPool / EnqueueCommandAction — Throttled, pooled command execution.
Helpers
Connect— One-line app bootstrap for all platforms (Desktop, Mobile, Browser).- NamingConventionViewLocator + DataTypeViewLocator — Convention and
x:DataTypebased ViewModel → View resolution. - IconExtension — Unified icon markup extension supporting Projektanker and SVG providers.
- ReturnExtension — Markup extension for returning observables in design-time data.
Samples
The solution includes runnable samples that demonstrate all features:
# Desktop
dotnet run --project samples/TestApp/TestApp.Desktop
# Browser (WASM)
dotnet run --project samples/TestApp/TestApp.Browser
Philosophy
- Functional + Reactive —
Result<T>,Maybe<T>, andIObservable<T>throughout. No exceptions for control flow, explicit error handling everywhere. - MVVM purist — Strict separation: no UI logic in ViewModels, no business logic in Views. Services are injected, never resolved from Views.
- Composition over inheritance — Small, composable building blocks and extension methods.
- ReactiveUI-first — State as observables, commands for intents, no imperative event handlers.
- Cross-platform — Desktop, Android, iOS, and Browser from the same codebase.
Disclaimer
Zafiro.Avalonia is an independent community project and is not affiliated with, endorsed by, or sponsored by AvaloniaUI OÜ.
Avalonia is a trademark of AvaloniaUI OÜ.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Avalonia (>= 11.3.12)
- Avalonia.Controls.DataGrid (>= 11.3.12)
- CSharpFunctionalExtensions (>= 3.6.0)
- FluentAvaloniaUI (>= 2.4.1)
- JetBrains.Annotations (>= 2025.2.2)
- ReactiveProperty (>= 9.8.0)
- ReactiveUI (>= 22.2.1)
- ReactiveUI.Avalonia (>= 11.3.8)
- ReactiveUI.Validation (>= 6.0.5)
- Serilog (>= 4.3.0)
- Svg.Controls.Skia.Avalonia (>= 11.3.9.2)
- System.Linq.Async (>= 6.0.3)
- Xaml.Behaviors.Avalonia (>= 11.3.8.2)
- Xaml.Behaviors.Interactions.DragAndDrop (>= 11.3.8.2)
- Xaml.Behaviors.Interactions.Draggable (>= 11.3.8.2)
- Xaml.Behaviors.Interactions.Events (>= 11.3.8.2)
- Zafiro.Avalonia (>= 51.2.0)
- Zafiro.UI (>= 47.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 51.2.0 | 80 | 4/2/2026 |
| 51.1.0 | 89 | 3/27/2026 |
| 51.0.17 | 81 | 3/27/2026 |
| 51.0.16 | 89 | 3/27/2026 |
| 51.0.15 | 73 | 3/26/2026 |
| 51.0.14 | 74 | 3/26/2026 |
| 51.0.13 | 75 | 3/26/2026 |
| 51.0.12 | 77 | 3/26/2026 |
| 51.0.11 | 75 | 3/26/2026 |
| 51.0.10 | 84 | 3/25/2026 |
| 51.0.9 | 82 | 3/25/2026 |
| 51.0.8 | 83 | 3/24/2026 |
| 51.0.7 | 80 | 3/24/2026 |
| 51.0.5 | 76 | 3/23/2026 |
| 51.0.4 | 73 | 3/23/2026 |
| 51.0.3 | 82 | 3/23/2026 |
| 51.0.2 | 85 | 3/23/2026 |
| 51.0.1 | 80 | 3/22/2026 |
| 51.0.0 | 120 | 3/17/2026 |
| 50.0.2 | 86 | 3/17/2026 |