MarkdownViewer is a high-performance and cross-platform markdown viewer based on MewUI, built with .NET 10 and implemented in 100% C#, with support for Native AOT publishing.
- Real-time Markdown rendering: 50 ms debounce
- Supports supper long document
- Supports export files as .png, .pdf, .docx, .html, all codes in the control, no more third party library referenced
- Selectable preview: supports selection and copy via
SelectableTextBlock - Table rendering: supports GFM tables and column alignment (left/center/right)
- GitHub-style formatting: headings, bold, italic, strikethrough, code blocks, tables, task lists, blockquotes, indented code blocks, and more
- Cross-platform: Windows, Linux, macOS
- AOT publishing: can be compiled into a standalone executable with no .NET runtime required
- Graphics backend: using MewUI.Skia and interops with Direct2D/Gdi/MewVG
- Markdown parser: pure C# implementation with no external dependencies, optimized using
ReadOnlySpan<char>and[MethodImpl(AggressiveInlining)] - GFM support: tables, task lists
- [ ]/- [x], fenced code blocks, inline code, links, images, and more - Rendering control: custom
MarkdownRendererthat transforms the AST into native MewUI controls
[!NOTE]
- Relies on the latest MewUI project since 2026/06/03.
- 😺 MewUI (https://github.com/aprillz/MewUI) is a cross-platform and lightweight, code-first .NET GUI framework aimed at NativeAOT.
- Thanks to LumNote (https://github.com/LdotJdot/LumNote) for the high-performance Avalonia.Net editor. This project ported many codes from LumNote.MarkdownEditor.
- 📦 NativeAOT + trimming first
- 🪶 Lightweight by design (small EXE, low memory footprint, fast first frame)
- 🧩 Support MewUI Fluent C# markup (no XAML)
- git clone https://github.com/aprillz/MewUI
- git clone https://github.com/shonescript/MarkdownViewer
- build and run MarkdownViewer.sln
-
Sample source
var window = new Window() .Title("Hello MarkdownViewer for MewUI") .Size(520, 360) .Padding(12) .Content( new StackPanel() .Spacing(8) .Children( new MarkdownViewer() .Text("# Markdown texts ...") new Button() .Content("Quit") .OnClick(() => Application.Quit()) ) ); Application.Run(window);