RTBlazorfied 1.0.69

There is a newer version of this package available.
See the version list below for details.
dotnet add package RTBlazorfied --version 1.0.69
NuGet\Install-Package RTBlazorfied -Version 1.0.69
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="RTBlazorfied" Version="1.0.69" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RTBlazorfied --version 1.0.69
#r "nuget: RTBlazorfied, 1.0.69"
#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.
// Install RTBlazorfied as a Cake Addin
#addin nuget:?package=RTBlazorfied&version=1.0.69

// Install RTBlazorfied as a Cake Tool
#tool nuget:?package=RTBlazorfied&version=1.0.69

RT Blazorfied

Author: Ryan Kueter
Updated: June, 2024

About

RT Blazorfied is a free .NET library available from the NuGet Package Manager that allows Blazor developers to easily add a rich text box / html editor to their blazor application.

The editor also uses Google's Font Icons. It does not reference the icon library. However, it does embed .svg versions of those icons so they are customizable.

Targets:

  • .NET 8

Adding a Rich Textbox

Add the JavaScript Reference

Add the following reference to the end of your index.html file:

<script src="_content/RTBlazorfied/js/RTBlazorfied.js"></script>

Add the Element

In this example, the @Html is the html string.

@using RichTextBlazorfied

<RTBlazorfied @ref="box" Html="@Html" />

The element reference can be used to get the html or plaintext for saving.

private RTBlazorfied box { get; set; } = new();
private string? html { get; set; }
private string? plaintext { get; set; }

private async Task GetHtml() => 
    html = await box.GetHtmlAsync();

private async Task GetPlainText() => 
    plaintext = await box.GetPlainTextAsync();

The element reference also provides a method for restoring the text to the beginning:

box.Reinitialize();

Configure the Options

RTBlazorfied was designed to allow developers to highly customize the appearance of the rich textbox with the following configuration options:

<RTBlazorfied Html="@Html" Options="@GetOptions()" />

Leaving of the ButtonVisibility options will display all the buttons.

public Action<IRTBlazorfiedOptions> GetOptions() => (o =>
{
    o.ToolbarStyles(o =>
    {
        o.BackgroundColor = "#00FF00";
        o.BorderColor = "#FF0000";
        o.BorderWidth = "1px";
        o.BorderStyle = "solid";
        o.BorderRadius = "10px 0px";
        o.DropdownBackgroundColor = "#333333";
        o.DropdownTextColor = "#FFFFFF";
        o.DropdownBackgroundColorHover = "#777777";
        o.DropdownTextColorHover = "#FFFFAA";
    });
    o.ModalStyles(o =>
    {
        o.BackgroundColor = "#333333";
        o.TextColor = "#FFFFAA";
        o.TextboxBackgroundColor = "#333333";
        o.TextboxTextColor = "#FFFFAA";
        o.TextboxBorderColor = "#FFFFAA";
        o.CheckboxAccentColor = "#FFFFAA";
    });
    o.ButtonStyles(o =>
    {
        o.TextColor = "#ff0000";
        o.TextSize = "30px";
        o.BackgroundColor = "#0000FF";
        o.BackgroundColorHover = "inherit";
        o.BackgroundColorSelected = "inherit";
        o.BorderColor = "#FFF000";
        o.BorderColorHover = "#FF0000";
        o.BorderColorSelected = "#0000FF";
        o.BorderStyle = "solid";
        o.BorderRadius = "0px";
        o.BorderWidth = "1px";
    });
    o.EditorStyles(o =>
    {
        o.Width = "500px";
        o.Height = "700px";
        o.BorderRadius = "10px";
        o.BoxShadow = "3px 3px 5px 6px #ccc";
        o.BorderStyle = "dotted";
        o.BorderWidth = "10px";
        o.BorderColor = "#FF0000";
    });
    o.ContentStyles(o =>
    {
        o.ContentBoxShadow = "inset 0 0 7px #eee";
        o.BackgroundColor = "#FFFF99";
        o.TextColor = "#333";
    });
    o.ScrollbarStyles(o =>
    {
        o.Width = "5px";
        o.Opacity = "0.5";
        o.ThumbBackground = "#0000FF";
        o.ThumbBackgroundHover = "#00FFFF";
        o.BackgroundColor = "transparent";
        o.ThumbBorderRadius = "10px";
    });
    o.ButtonVisibility(o =>
    {
        o.ClearAll();
        o.Size = true;
        o.Font = true;
        o.Format = true;
        o.Bold = true;
        o.Italic = true;
        o.Underline = true;
        o.Strikethrough = true;
        o.Subscript = true;
        o.Superscript = true;
        o.TextColor = true;
        o.Alignleft = true;
        o.Aligncenter = true;
        o.Alignright = true;
        o.Alignjustify = true;
        o.Copy = true;
        o.Cut = true;
        o.Delete = true;
        o.Selectall = true;
        o.Image = true;
        o.Link = true;
        o.Undo = true;
        o.Redo = true;
    });
});

Contributions

This project is being developed for free by me, Ryan Kueter, in my spare time. So, if you would like to contribute, please submit your ideas on the Github project page.

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. 
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
1.0.74 3 6/28/2024
1.0.73 27 6/28/2024
1.0.72 22 6/28/2024
1.0.71 22 6/28/2024
1.0.70 32 6/27/2024
1.0.69 32 6/26/2024
1.0.68 37 6/26/2024
1.0.67 77 6/22/2024
1.0.66 77 6/22/2024
1.0.65 80 6/21/2024
1.0.64 72 6/20/2024
1.0.63 74 6/19/2024
1.0.62 69 6/19/2024
1.0.61 80 6/19/2024
1.0.60 72 6/18/2024
1.0.59 67 6/17/2024
1.0.58 63 6/17/2024
1.0.57 62 6/17/2024
1.0.56 60 6/17/2024
1.0.55 66 6/17/2024
1.0.54 62 6/17/2024
1.0.53 63 6/17/2024
1.0.52 62 6/17/2024
1.0.51 73 6/17/2024
1.0.50 68 6/17/2024
1.0.49 64 6/17/2024
1.0.48 74 6/17/2024
1.0.47 70 6/17/2024
1.0.46 68 6/16/2024
1.0.45 61 6/16/2024
1.0.44 75 6/16/2024
1.0.43 68 6/16/2024
1.0.42 71 6/16/2024
1.0.41 71 6/16/2024
1.0.40 71 6/16/2024
1.0.39 74 6/16/2024
1.0.38 82 6/16/2024
1.0.37 86 6/16/2024
1.0.36 74 6/14/2024
1.0.35 64 6/13/2024
1.0.34 67 6/13/2024
1.0.33 67 6/13/2024
1.0.32 64 6/13/2024
1.0.31 64 6/12/2024
1.0.30 61 6/12/2024
1.0.29 68 6/12/2024
1.0.28 63 6/11/2024
1.0.27 60 6/11/2024
1.0.26 60 6/10/2024
1.0.25 55 6/10/2024
1.0.24 61 6/10/2024
1.0.23 72 6/10/2024
1.0.22 75 6/10/2024
1.0.21 73 6/8/2024
1.0.20 68 6/8/2024
1.0.19 69 6/8/2024
1.0.18 75 6/8/2024
1.0.17 73 6/8/2024
1.0.16 70 6/7/2024
1.0.15 72 6/7/2024
1.0.14 79 6/7/2024
1.0.13 72 6/7/2024
1.0.12 74 6/7/2024
1.0.11 71 6/7/2024
1.0.9 78 6/6/2024
1.0.8 72 6/6/2024
1.0.7 76 6/6/2024
1.0.6 69 6/6/2024
1.0.5 69 6/6/2024
1.0.4 73 6/6/2024
1.0.3 73 6/6/2024
1.0.2 70 6/6/2024
1.0.1 73 6/6/2024

Small bug fixes to improve the usability of the editor.