Skip to main content
Avalonia UI is a true cross-platform UI framework that enables you to build applications that run on Windows, macOS, Linux, iOS, Android, and WebAssembly from a single codebase.

Supported Platforms

Desktop

Windows, macOS, and Linux desktop applications

Mobile

iOS and Android native mobile apps

Web

WebAssembly applications running in browsers

Platform Architecture

Avalonia uses a layered architecture that enables true cross-platform development:
┌─────────────────────────────────────────┐
│     Application Code & XAML UI          │
├─────────────────────────────────────────┤
│     Avalonia Core Framework             │
├─────────────────────────────────────────┤
│     Platform Abstraction Layer          │
├─────────────────────────────────────────┤
│  Platform-Specific Implementations      │
│  Win32 | Native | X11 | iOS | Android   │
│              | Browser                   │
└─────────────────────────────────────────┘

Rendering Backends

Avalonia supports multiple rendering backends with automatic fallback:
  • Skia: Primary rendering engine for desktop and mobile
  • OpenGL/EGL: Hardware-accelerated graphics on Android and iOS
  • Metal: Native iOS rendering (experimental)
  • Vulkan: High-performance rendering on Android
  • WebGL: Browser-based hardware acceleration
  • Direct2D: Windows-specific acceleration
  • Software: CPU-based fallback rendering

Platform Detection

Avalonia provides automatic platform detection for desktop applications:
AppBuilder.Configure<App>()
    .UsePlatformDetect()  // Automatically detects and loads platform
    .LogToTrace()
    .StartWithClassicDesktopLifetime(args);

Manual Platform Selection

You can manually specify platforms for more control:
AppBuilder.Configure<App>()
    .UseWin32()
    .UseSkia()
    .StartWithClassicDesktopLifetime(args);

Platform Capabilities

FeatureWindowsmacOSLinuxiOSAndroidBrowser
Window ManagementLimited
Native Menus
System Tray
File Dialogs✓ (Polyfill)
Clipboard
Drag & Drop
Touch Input
IME/Text Input
Screen Info
GPU Acceleration

Code Sharing

Avalonia enables maximum code sharing across platforms:
  • UI Code: 100% shared XAML and controls
  • Business Logic: 100% shared C# code
  • Platform-Specific: Only when accessing native APIs
// Shared UI code works everywhere
public class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        
        // Platform-specific customization when needed
        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            // Windows-specific code
        }
    }
}

Runtime Platform Information

Access platform information at runtime:
using Avalonia.Platform;

var runtimeInfo = AvaloniaLocator.Current
    .GetService<IRuntimePlatform>();

var runtimeInfo = runtimeInfo?.GetRuntimeInfo();
if (runtimeInfo != null)
{
    Console.WriteLine($"OS: {runtimeInfo.OperatingSystem}");
    Console.WriteLine($"Desktop: {runtimeInfo.IsDesktop}");
    Console.WriteLine($"Mobile: {runtimeInfo.IsMobile}");
}

Platform-Specific Features

For platform-specific functionality, see:

Next Steps

Desktop Development

Build Windows, macOS, and Linux applications

Mobile Development

Create iOS and Android apps

Web Development

Deploy to browsers with WebAssembly

Platform-Specific APIs

Access native platform features

Build docs developers (and LLMs) love