RichTextViewer.Avalonia
1.0.0
dotnet add package RichTextViewer.Avalonia --version 1.0.0
NuGet\Install-Package RichTextViewer.Avalonia -Version 1.0.0
<PackageReference Include="RichTextViewer.Avalonia" Version="1.0.0" />
<PackageVersion Include="RichTextViewer.Avalonia" Version="1.0.0" />
<PackageReference Include="RichTextViewer.Avalonia" />
paket add RichTextViewer.Avalonia --version 1.0.0
#r "nuget: RichTextViewer.Avalonia, 1.0.0"
#:package RichTextViewer.Avalonia@1.0.0
#addin nuget:?package=RichTextViewer.Avalonia&version=1.0.0
#tool nuget:?package=RichTextViewer.Avalonia&version=1.0.0
RichTextViewer.Avalonia
A read-only rich text viewer control for Avalonia applications that enhances plain text with clickable hyperlinks, limited inline Markdown formatting, quote styling, and find-and-highlight — without the overhead of a full HTML or Markdown renderer.
The control displaying quoted text at multiple depths, inline Markdown formatting, and highlighted find matches.
Features
- Inline Markdown detection — bold (
**text**), italic (*text*/_text_), bold-italic (***text***), strikethrough (~~text~~), and inline code (`code`). - Clickable hyperlinks — HTTP, HTTPS, FTP, and
mailto:links detected automatically; scheme allowlist and blocklist enforced at both detection time and click time. - Multi-level quote styling — lines prefixed with
>are coloured and indented by quote depth, up to three levels; configurable depth colours via Avalonia resource keys. - Extended quote detection — initials-style markers (
AG>,pF>>), dash-prefix markers (->,->>), empty quote line collapsing, and decorative-divider detection. - Find and highlight — case-insensitive search with a 150ms debounce; matches highlighted with configurable brush colours.
- Preformatted line support — lines beginning with a single leading space can be rendered in a monospace font (Gopher convention).
- Custom span detectors — plug-in
ISpanDetectorimplementations to detect domain-specific syntax not handled by the built-in pipeline. - Custom span renderers — plug-in
ISpanRendererimplementations to apply custom styling to anySpanType. - Theming via Avalonia resource keys — override any of the six named brush resources from the host application's resource dictionary.
- Word-wrap toggle — switch between wrapping and horizontal scrolling at runtime.
Installation
dotnet add package RichTextViewer.Avalonia
Minimal Usage
Add the control to a window or user control:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:rtv="clr-namespace:RichTextViewer.Avalonia.Controls;assembly=RichTextViewer.Avalonia"
x:Class="MyApp.MainWindow">
<rtv:RichTextViewer Text="Hello, **world**! Visit https://avaloniaui.net" />
</Window>
The control embeds its own default styles and works without any additional setup in App.axaml. If you want to override the library's named brush resources (such as RichTextViewer.QuoteDepth1Brush), see https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/theming.md for the required StyleInclude entry.
Equivalent C# code-behind:
RichTextViewer viewer = new RichTextViewer
{
Text = "Hello, **world**! Visit https://avaloniaui.net"
};
Documentation
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/getting-started.md — installation, prerequisites, and first steps.
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/configuration.md — all properties, defaults, and examples.
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/custom-detectors.md — implementing and registering
ISpanDetector. - https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/custom-renderers.md — implementing and registering
ISpanRenderer. - https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/theming.md — overriding brush resource keys and dark-theme support.
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/find.md — find-and-highlight, debounce, and known limitations.
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/security.md — scheme allowlist, blocklist, and threat model.
- https://github.com/57951/RichTextViewer.Avalonia/blob/main/docs/known-limitations.md — deliberate design constraints.
License
RichTextViewer.Avalonia is released under the GNU Affero General Public License v3.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Avalonia (>= 11.3.12)
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 |
|---|---|---|
| 1.0.0 | 67 | 2/28/2026 |
Initial release.