Avalonia.Controls.WebView
12.1.0
Prefix Reserved
dotnet add package Avalonia.Controls.WebView --version 12.1.0
NuGet\Install-Package Avalonia.Controls.WebView -Version 12.1.0
<PackageReference Include="Avalonia.Controls.WebView" Version="12.1.0" />
<PackageVersion Include="Avalonia.Controls.WebView" Version="12.1.0" />
<PackageReference Include="Avalonia.Controls.WebView" />
paket add Avalonia.Controls.WebView --version 12.1.0
#r "nuget: Avalonia.Controls.WebView, 12.1.0"
#:package Avalonia.Controls.WebView@12.1.0
#addin nuget:?package=Avalonia.Controls.WebView&version=12.1.0
#tool nuget:?package=Avalonia.Controls.WebView&version=12.1.0
Avalonia WebView
The Avalonia WebView component provides native web browser functionality for your Avalonia applications. Unlike embedded WebView solutions that require bundling Chromium, this implementation leverages the platform's native web rendering capabilities, resulting in smaller application size and better performance.
Features
- Platform-Native Engines: WebView2 (Windows), WebKit (macOS), WebKitGTK (Linux)
- Lightweight: No embedded browser engine required - smaller application footprint
- AOT Compatible: Compatible with Ahead-of-Time compilation and trimming
- Platform Configuration: Supports WebView2 profiles, persistent storage paths, and many other platform-specific options
- Web APIs: JavaScript execution, bidirectional messaging, cookie management, HTTP header interception
- Authentication: Web authentication broker for OAuth and web-based authentication
- Printing: Print web content directly from the WebView
Quick Start
Get started quickly with the WebView component: https://docs.avaloniaui.net/accelerate/components/webview/quickstart
Components
NativeWebView Control
The main control for embedding web content in your app.
<NativeWebView x:Name="WebView"
Source="https://avaloniaui.net" />
Documentation: https://docs.avaloniaui.net/accelerate/components/webview/nativewebview
NativeWebDialog
Native web dialog that provides a way to display web content in a separate window, particularly useful for platforms like Linux where embedded WebView controls might not be available
Documentation: https://docs.avaloniaui.net/accelerate/components/webview/nativewebdialog
WebAuthenticationBroker
WebAuthenticationBroker is a utility class that facilitates OAuth and other web-based authentication flows by providing a secure way to handle web authentication in desktop applications.
Set WebAuthenticatorMode.Browser to run the flow in the user's default browser and capture the callback on a local loopback HTTP listener, which is required by providers that reject embedded webviews.
That listener accepts connections from any process on the machine, so the result is untrusted input. WebAuthenticationResult parses the callback query into Code, State, Error and ErrorDescription (and the full Parameters set); check State against the value you sent, and use PKCE.
Documentation: https://docs.avaloniaui.net/accelerate/components/webview/webauthenticationbroker
OAuth 2.0 authorization code flow with PKCE
AuthorizationCodePkceSession runs the flow against an OAuth 2.0 authorization server: it discovers the endpoints from the issuer, builds the authorization request with PKCE (RFC 7636), validates the callback, and exchanges the code for tokens.
var session = await AuthorizationCodePkceSession.CreateAsync(
"https://id.example.com", clientId, "http://127.0.0.1:5000/callback", "openid profile");
var options = new WebAuthenticatorOptions(session.AuthorizationUri, session.RedirectUri)
{
Mode = WebAuthenticatorMode.Browser,
BrowserOptions = new BrowserOptions { CallbackFilter = session.IsCallbackFor },
};
var result = await WebAuthenticationBroker.AuthenticateAsync(topLevel, options);
var token = await session.ExchangeCodeAsync(result);
Discovery follows RFC 8414 (/.well-known/oauth-authorization-server) and falls back to OpenID Connect discovery. The issuer and every endpoint taken from the metadata document must be https, and the document must declare the issuer it was requested for. Use AuthorizationCodePkceSession.Create instead when the server publishes no metadata and you know the endpoints.
The id_token in the response is returned as received and is not validated.
Sample: samples/Avalonia.Controls.WebView.Samples.Oidc
| 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 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-browser1.0 is compatible. 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. |
-
net10.0
- Avalonia (>= 12.0.0)
-
net10.0-android36.0
- Avalonia (>= 12.0.0)
- Avalonia.Android (>= 12.0.0)
-
net10.0-browser1.0
- Avalonia (>= 12.0.0)
- Avalonia.Browser (>= 12.0.0)
-
net8.0
- Avalonia (>= 12.0.0)
NuGet packages (7)
Showing the top 5 NuGet packages that depend on Avalonia.Controls.WebView:
| Package | Downloads |
|---|---|
|
Insightdive
Official .NET / Avalonia SDK for Insightdive — anonymous in-app feedback surveys. Modal or inline WebView, lifecycle events, cooldown management. |
|
|
Avalonia.Controls.Maui
Avalonia.Controls.Maui are the handlers and renderers for .NET MAUI apps, replacing their default implementations with Avalonia-based ones. |
|
|
Majorsilence.Forms.Avalonia
Avalonia 12 platform backend for Majorsilence.Forms — the default desktop host, so a cross-platform WinForms app gets real native windows on Windows, macOS and Linux, plus Android, iOS and Browser (WebAssembly) through Avalonia's own targets. |
|
|
Avalonia.Controls.Maui.Essentials
Avalonia.Controls.Maui.Essentials provides an implementation of Microsoft.Maui.Essentials, using Avalonia-based implementations. |
|
|
AvalonMarkdown
NativeWebView based Markdown preview control for AvaloniaUI. |
GitHub repositories (7)
Showing the top 7 popular GitHub repositories that depend on Avalonia.Controls.WebView:
| Repository | Stars |
|---|---|
|
Devolutions/UniGetUI
UniGetUI: The Graphical Interface for your package managers. Could be terribly described as a package manager manager to manage your package managers
|
|
|
rmcrackan/Libation
Libation: Liberate your Library
|
|
|
Pixeval/Pixeval
Wow. Yet another Pixiv client!
|
|
|
Synalix/CitrineLauncher
Premium minecraft launcher developed in .NET 10
|
|
|
AvaloniaUI/Avalonia.Controls.Maui
Avalonia-based Handlers for .NET MAUI
|
|
|
Guerra24/LRReader
A feature-complete reader and client for LANraragi
|
|
|
mdgrs-mei/GliderUI
Cross-platform Desktop GUI framework for PowerShell powered by Avalonia
|
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 12.1.0 | 478 | 8/15/2026 | |
| 12.0.1 | 72,770 | 5/13/2026 | |
| 12.0.0 | 34,547 | 4/7/2026 | |
| 12.0.0-rc1 | 1,455 | 3/20/2026 | |
| 12.0.0-preview2 | 680 | 3/16/2026 | |
| 12.0.0-preview1 | 179 | 2/19/2026 | |
| 11.4.1 | 60 | 8/14/2026 | |
| 11.4.0 | 14,889 | 3/20/2026 | |
| 11.3.16 | 19,776 | 1/30/2026 | |
| 11.3.15 | 8,606 | 11/7/2025 | |
| 11.3.14 | 521 | 11/3/2025 | |
| 11.3.13 | 852 | 10/28/2025 | |
| 11.3.12 | 993 | 10/13/2025 | |
| 11.3.11 | 1,452 | 10/13/2025 |