RJRichTextEditor 1.0.0
dotnet add package RJRichTextEditor --version 1.0.0
NuGet\Install-Package RJRichTextEditor -Version 1.0.0
<PackageReference Include="RJRichTextEditor" Version="1.0.0" />
<PackageVersion Include="RJRichTextEditor" Version="1.0.0" />
<PackageReference Include="RJRichTextEditor" />
paket add RJRichTextEditor --version 1.0.0
#r "nuget: RJRichTextEditor, 1.0.0"
#:package RJRichTextEditor@1.0.0
#addin nuget:?package=RJRichTextEditor&version=1.0.0
#tool nuget:?package=RJRichTextEditor&version=1.0.0
π RJRichTextEditor
A WPF WebView2-based Rich Text Editor (WYSIWYG) with full support for editor/viewer modes, theming, word/character limits, and customizable toolbar.
π₯ Demo
Editor Mode
Viewer Mode
(GIF shows typing, formatting text, and switching to Viewer mode)
β¨ Features
- ποΈ Editor + Viewer Mode (toggle at runtime)
- π¨ Customizable Theme via CSS variables
- π§ Configurable Toolbar β hide tools you donβt want
- π Word & Character Limits with live counter
- π Multiple Instances supported in the same app
- β‘ Based on WebView2 β modern HTML5 editing
π Installation
Install from NuGet:
dotnet add package RJRichTextEditor
π§ Quick Start
XAML
<Window x:Class="Sample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:editor="clr-namespace:RJRichTextEditorControl;assembly=RJRichTextEditorControl"
Title="Editor Demo" Height="500" Width="800">
<Grid>
<editor:RJRichTextEditor x:Name="MyEditor" />
</Grid>
</Window>
C# Code-behind
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// Example: set theme
MyEditor.Theme = new EditorTheme
{
DocumentBg = "#f4f6fa",
DocumentColor = "#212121",
ToolbarBg = "#ffffff"
};
// Example: hide some tools
MyEditor.HiddenTools = new List<EditorTool>
{
EditorTool.Paragraph,
EditorTool.Table
};
// Example: set limits
MyEditor.SetMaxWords(100);
MyEditor.SetMaxChars(500);
}
private async void GetHtml_Click(object sender, RoutedEventArgs e)
{
string html = await MyEditor.GetHtmlAsync();
MessageBox.Show(html, "Editor Content");
}
private async void SetHtml_Click(object sender, RoutedEventArgs e)
{
await MyEditor.SetHtmlAsync("<h2>Hello from RJRichTextEditor</h2>");
}
private void ToggleMode_Click(object sender, RoutedEventArgs e)
{
MyEditor.Mode = MyEditor.Mode == EditorMode.Editor
? EditorMode.Viewer
: EditorMode.Editor;
}
}
π¨ Theming
The editor supports theming through CSS variables.
Available Variables
:root {
--document-bg: #f4f6fa;
--document-color: #212121;
--document-border: 1px solid rgb(255, 255, 255);
--document-padding: 5px;
--toolbar-bg: #ffffff;
--toolbar-size: medium;
--toolbar-border: 1px solid rgb(223, 223, 223);
--editor-bg: #ffffff;
--editor-border: 1px solid rgb(223, 223, 223);
--dropshadow: 0 0px 0px rgba(0, 0, 0, 0.04);
--popup-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
/* Word/char counter section */
--wordchar-bg: #ffffff;
--wordchar-color: #ababab;
--wordchar-border: 1px solid rgb(223, 223, 223);
/* Buttons */
--button-bg: rgb(255, 255, 255);
--button-cancel-bg: #860303;
--button-submit-bg: #086d0b;
}
Example usage in C#:
MyEditor.Theme = new EditorTheme
{
DocumentBg = "#fafafa",
ToolbarBg = "#ddd",
ButtonSubmitBg = "#0a7d0f"
};
π§ Toolbar Customization
Hide tools you donβt need:
MyEditor.HiddenTools = new List<EditorTool>
{
EditorTool.Bold,
EditorTool.Paragraph,
EditorTool.Table
};
Available tools:
BoldFontFontSizeParagraphUnorderedListOrderedListTextColorHighlightColorLinkTableUndoRedoRemoveFormat
π Word & Character Limits
Set maximum words or characters allowed in the editor:
MyEditor.SetMaxWords(200);
MyEditor.SetMaxChars(1000);
The live counter (#wordCharCount) will update automatically.
You can also hide the counter:
MyEditor.ShowWordCharCount = false;
π Viewer Mode
Use RJRichTextViewer for a read-only display, or toggle mode dynamically:
MyEditor.Mode = EditorMode.Viewer; // hides toolbar, read-only
MyEditor.Mode = EditorMode.Editor; // full editor
π¦ Repository Structure
RJRichTextEditor/
βββ RJRichTextEditorControl/ # NuGet library
βββ RJRichTextEditor.Sample/ # Sample WPF app
βββ README.md # Documentation
βββ LICENSE # MIT License
βββ RJRichTextEditor.sln # Solution
π License
MIT License Β© 2025 Rijo M P
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows7.0
- Microsoft.Web.WebView2 (>= 1.0.3405.78)
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 | 349 | 8/25/2025 |