Avalonia HTML Editor Control

Give your Avalonia application a complete HTML authoring workspace. Native toolbars, visual editing, source view and preview help users create messages, reports and reusable templates without leaving your app.

Clone from GitHub

The same samples, nothing to unblock

Download samples

The same samples, zipped

Book a live demo

Free, 1:1 with a domain expert

The download and the GitHub repository hold exactly the same samples. Take the zip if you are behind a firewall that blocks GitHub, otherwise clone it: a clone carries no mark of the web, so there is nothing to unblock before Visual Studio will build it.

Full C# source code license available

.NET: 8 (net8.0) · Avalonia: 12.1.4 · Operating system: Windows 11 (x64) · Browser runtime: Microsoft Edge WebView2 · Application type: Avalonia desktop applications · .NET SDK: 9.0.300 or newer (SDK 10 recommended)

Avalonia editor embedded in a desktop application with a formatted service-renewal message.
Visual HTML editing in an Avalonia application.
Official MCP serveryour assistant uses the real API 14-day trialno licence key to evaluate Perpetual licensepay once · no subscription

Give users rich text editing inside your Avalonia app.

Bind HTML to your ViewModel, customize the tools and save through awaited APIs.

Quick start

Add HTML authoring to your Avalonia application.

Host the native control, await readiness, and keep loading and saving in your application's workflow. The initial edition is Windows qualified; native browser prerequisites still apply.

View the Avalonia package on NuGet to add this edition to your project.

Official MCP server

Your assistant can find API members by intent, then read this control's real signatures and documentation pages instead of guessing from stale training data, so the first integration it writes actually compiles.

Paste this into your AI coding tool
Use the SpiceLogic documentation MCP server for this: https://mcp.spicelogic.com/html-editor/avalonia (name it spicelogic-avalonia-editor, and add it to my MCP configuration if it is not there yet). If its tools do not respond, stop and tell me rather than writing code from memory.

Add an Avalonia HTML editor to my application, await its Ready task after the window opens, load a sample document with SetBodyHtmlAsync, and save the acknowledged document with GetDocumentHtmlAsync. Use this edition's real APIs and native browser prerequisites.

Works with Claude Code, GitHub Copilot, Cursor, OpenAI Codex, Google Antigravity, and many other MCP-compatible tools. For client-specific setup, see the MCP server documentation.

Or write it yourself: XAML binding or code-behind, both work. MVVM two-way binding included.

XAML
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:editor="clr-namespace:SpiceLogic.HtmlEditor.Avalonia;assembly=SpiceLogic.HtmlEditor.Avalonia">
    <editor:AvaloniaHtmlEditor x:Name="HtmlEditor" />
</Window>
C#
// After the containing window has opened:
await HtmlEditor.Ready;
await HtmlEditor.SetBodyHtmlAsync("<p>Welcome to your document.</p>");

// In your application's asynchronous Save command:
string document = await HtmlEditor.GetDocumentHtmlAsync();
await File.WriteAllTextAsync("output.html", document);

Call initialization after the window opens. Await each operation and handle failures in your application. The editor's Ready task completes after its native browser and latest content bindings are ready.

Or start from something that already runs: clone, build, done.

Terminal
git clone https://github.com/spicelogic/avalonia-html-editor-control-samples.git

A C# Avalonia sample with setup instructions, on GitHub. They reference the published package, so a clone restores it and builds with no key to enter and nothing to unblock. MIT licensed, so you can lift any of it straight into your own application.

01

Put visual HTML authoring inside your application

Give users a document workspace where they already work. Format messages, revise business content and keep the resulting HTML connected to your Avalonia application.

Read the walkthrough
Avalonia editor embedded in a desktop application with a formatted service-renewal message.
02

Keep document ownership in your application

Your application supplies the content, decides when to save and chooses where the document belongs. Load and export body fragments or complete documents through awaited operations.

Read the walkthrough
HTML reopened after a real edit and save, with its sentence, headings, table and list retained.
03

Compose visually and inspect the markup

Use visual editing for ordinary authoring, source editing for precise markup and preview for reviewing the document. Source changes use an explicit apply or discard workflow, keeping unfinished edits visible when an operation cannot complete.

Read the walkthrough
Actual HTML source view with syntax colors, indented table markup and selected text.

More features

04 Build reusable templates with mail merge fields Let users place application-defined fields in a template, then resolve the values when generating the finished document.

Let users place application-defined fields in a template, then resolve the values when generating the finished document. Names, references and other supplied values become literal text while surrounding document structure remains intact.

Actual customer-name field inserted into an HTML template in the public Avalonia sample.
Read the walkthrough
05 Edit tables within the document Create tables and revise rows, columns, cells and supported styles within the authoring workflow.

Create tables and revise rows, columns, cells and supported styles within the authoring workflow. Awaited table APIs let your application offer its own commands alongside the native authoring tools.

Four actual table cells selected for a rectangular table-authoring operation.
Read the walkthrough
06 Keep embedded images with the saved HTML Use embedded raster images when the document should travel with its content.

Use embedded raster images when the document should travel with its content. Set meaningful alternative text and dimensions, then inspect the saved markup as part of your application's document workflow.

Embedded image selected with native resize handles in a formatted HTML document.
Read the walkthrough
07 Make commands and menus your own Customize the native toolbars, replace built-in command routes and adapt the document context menu to your application.

Customize the native toolbars, replace built-in command routes and adapt the document context menu to your application. Named item references keep familiar commands accessible without rebuilding the authoring surface.

Actual application-owned Avalonia context menu alongside the editor's native toolbar.
Read the walkthrough
08 Give users local spelling review Use inline spelling marks and interactive review with bundled dictionaries.

Use inline spelling marks and interactive review with bundled dictionaries. Choose the dictionary for the document and save approved custom words in a configured local dictionary.

Actual local spelling review with suggested corrections and native Replace actions.
Read the walkthrough
09 Match the surrounding application Style native Avalonia controls and choose the editor's user-interface language.

Style native Avalonia controls and choose the editor's user-interface language. Configure document fonts and colors separately so application appearance and saved HTML each follow the workflow's requirements.

Native Avalonia Light theme and complete editor toolbars around the authored document.
Read the walkthrough

Supported environments.

.NET

8 (net8.0)

Avalonia

12.1.4

Operating system

Windows 11 (x64)

Browser runtime

Microsoft Edge WebView2

Application type

Avalonia desktop applications

.NET SDK

9.0.300 or newer (SDK 10 recommended)

Terms that have become rare.

01

Your application controls its data.

The built-in editor and spelling review run locally. Your application decides how to store documents and which external resources to load.

02

You buy it once. It is yours.

A true perpetual license, sold this way since 2007. No subscription meter running while you finish the work.

03

One-to-one support from a human domain expert.

Not a chatbot, not a call center. Support is a live conversation with the engineers who build the software. One call away, on Zoom or Teams, free.

Integrating this week? Talk to the engineers who build it.

Every trial and every license includes free live 1:1 sessions on Zoom or Teams. You will talk to a real human, a domain expert who builds this software, and we will help you wire it into your app. No chatbot, no call center, no ticket queue.

Weigh it yourself. The evaluation build is the full control, in your solution, today.

Download samples

The same samples, zipped

Book a live demo

Free, 1:1 with our engineers