AvalonMarkdown 8.0.0

dotnet add package AvalonMarkdown --version 8.0.0
                    
NuGet\Install-Package AvalonMarkdown -Version 8.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AvalonMarkdown" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AvalonMarkdown" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AvalonMarkdown" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AvalonMarkdown --version 8.0.0
                    
#r "nuget: AvalonMarkdown, 8.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AvalonMarkdown@8.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AvalonMarkdown&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AvalonMarkdown&version=8.0.0
                    
Install as a Cake Tool

AvalonMarkdown

A Markdown preview control built on AvaloniaUI's NativeWebView β€” renders Markdown with math (KaTeX), code highlighting (highlight.js), diagrams (Mermaid / PlantUML), and video embeds.

🌏 δΈ­ζ–‡ζ–‡ζ‘£

Installation

dotnet add package AvalonMarkdown

MarkdownView

A drop-in Markdown preview control.

<Window xmlns="https://github.com/avaloniaui"
        xmlns:md="clr-namespace:AvalonMarkdown.Views;assembly=AvalonMarkdown">
    <md:MarkdownView x:Name="Preview" />
</Window>

Rendering content

Recommended β€” bind the Text property (updates are deduplicated automatically):

<md:MarkdownView Text="{Binding MarkdownContent}" />

Or render explicitly once the control is ready:

Preview.OnReady += async (_, _) =>
{
    await Preview.RenderMarkdownAsync("# Hello World\n\n**Bold** *Italic*");
};

Every hyperlink click is raised as LinkClicked. Set Handled = true to take over navigation (e.g. in-app routing); otherwise the link opens in the system browser by default.

Preview.LinkClicked += (_, e) =>
{
    if (e.Url.StartsWith("app://"))
    {
        NavigateInternal(e.Url);
        e.Handled = true; // suppress the default system-browser launch
    }
};

Preview configuration

Content updates auto-scroll to the newest content, pausing while you operate the scrollbar. Tune via ApplyConfigAsync:

await Preview.ApplyConfigAsync("setPreviewConfig({ autoScrollOnUpdate: true, autoScrollCooldown: 2000 })");

Key API

Member Type Description
Text string? Markdown content (two-way bindable)
Placeholder string? Text shown when content is empty (default blank)
OnReady event Fires when the preview is ready to render
LinkClicked event Fires on every hyperlink click; Handled = true intercepts navigation
ErrorOccurred event Fires on internal recoverable errors
RenderMarkdownAsync(text) Task Renders Markdown content
RestartPreviewAsync() Task Restarts the preview
ApplyConfigAsync(js) Task Applies preview configuration
ApplyCustomCssAsync(css) Task Injects custom CSS overrides
InvokeScriptAsync(js) Task<string?> Executes custom JavaScript
ScrollToProgressAsync(percent) Task Scrolls the preview to a vertical progress position (0–100)
GetScrollProgressAsync() Task<double?> Returns the current vertical scroll progress (0–100)
NavigateToHeadingAsync(heading) Task<bool> Scrolls to the matching heading (for TOC); returns whether found
GetHeadingsAsync() Task<IReadOnlyList<MarkdownHeading>> Lists all headings (text + level) to build a table of contents

MarkdownThemeView

A built-in theme editor that targets a MarkdownView. RGB sliders for colors, plus controls for typography, code highlighting, and Mermaid/PlantUML styles β€” changes auto-apply.

<md:MarkdownView x:Name="Preview" />
<md:MarkdownThemeView Target="{Binding #Preview}" />

Collapsed by default; click the title bar to expand.

License

MIT

Product 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-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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
8.0.0 94 8/22/2026
6.0.0 89 8/22/2026