EasyMDE.Blazor 1.0.5

dotnet add package EasyMDE.Blazor --version 1.0.5
                    
NuGet\Install-Package EasyMDE.Blazor -Version 1.0.5
                    
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="EasyMDE.Blazor" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EasyMDE.Blazor" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="EasyMDE.Blazor" />
                    
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 EasyMDE.Blazor --version 1.0.5
                    
#r "nuget: EasyMDE.Blazor, 1.0.5"
                    
#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 EasyMDE.Blazor@1.0.5
                    
#: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=EasyMDE.Blazor&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=EasyMDE.Blazor&version=1.0.5
                    
Install as a Cake Tool

EasyMDE.Blazor

A Blazor wrapper around EasyMDE with:

  • Two-way binding (@bind-Value)
  • Strongly-typed EasyMDE options (no object-typed option surface)
  • Strongly-typed Toolbar, Status, and ReadOnly unions
  • Optional key interception (fast-path in JavaScript; only calls .NET for registered keys)
  • Optional ability to block specific keys (e.g., prevent Enter from inserting a newline)

Package goals

  1. Keep the C# API strongly typed (simple primitives/enums/unions)
  2. Keep the JavaScript surface minimal
  3. Support Blazor Server and Blazor WebAssembly
  4. Avoid editor churn and event loops (programmatic Value updates don’t re-trigger input handlers)

Installation

In your Blazor application, load the bundled EasyMDE stylesheet and script files:

<link rel="stylesheet" href="_content/EasyMDE.Blazor/lib/easymde/easymde.min.css" />
<script src="_content/EasyMDE.Blazor/lib/easymde/easymde.min.js"></script>

Basic usage

@using EasyMDE.Blazor

<EasyMdeEditor @bind-Value="Markdown" />

@code {
    private string? Markdown = "# Hello";
}

Strongly-typed options

<EasyMdeEditor @bind-Value="Markdown" Options="Options" />

@code {
    private string? Markdown;

    private readonly EasyMdeOptions Options = new()
    {
        Placeholder = "Write markdown...",
        MinHeight = "300px",

        Toolbar = EasyMdeToolbar.Custom(new ToolbarItem[]
        {
            ToolbarItem.BuiltIn(ToolbarButton.Bold),
            ToolbarItem.BuiltIn(ToolbarButton.Italic),
            ToolbarItem.Separator,
            ToolbarItem.BuiltIn(ToolbarButton.Preview),
            ToolbarItem.BuiltIn(ToolbarButton.Fullscreen),
        }),

        Status = EasyMdeStatus.Custom(new StatusItem[]
        {
            StatusItem.BuiltIn(StatusElement.Lines),
            StatusItem.BuiltIn(StatusElement.Words),
            StatusItem.BuiltIn(StatusElement.Cursor),
        }),

        ReadOnly = EasyMdeReadOnly.Disabled
    };
}

ReadOnly modes

ReadOnly = EasyMdeReadOnly.Disabled; // editable (readOnly: false)
ReadOnly = EasyMdeReadOnly.Enabled;  // readOnly: true
ReadOnly = EasyMdeReadOnly.NoCursor; // readOnly: "nocursor"

Key interception and blocking (fast-path)

To avoid sending every keystroke to .NET (especially on Blazor Server), the wrapper supports pre-registered key filters.

  • JS listens to keydown
  • If the key is not registered, nothing happens (fast-path)
  • If the key is registered:
    • BlockInJs = true blocks synchronously with no .NET call
    • NotifyDotNet = true calls .NET (no blocking guarantee, just notification)
    • AskDotNet = true calls .NET for an allow/deny decision (see notes below)

Block Enter from inserting a newline (no .NET round-trip)

<EasyMdeEditor @bind-Value="Markdown"
               InterceptKeys="Keys" />

@code {
    private string? Markdown;

    private readonly EasyMdeKeyRegistration[] Keys =
    [
        new()
        {
            Key = "Enter",
            BlockInJs = true
        }
    ];
}

Notify .NET on Ctrl+S (save)

<EasyMdeEditor @bind-Value="Markdown"
               InterceptKeys="Keys"
               OnKey="HandleKey" />

@code {
    private string? Markdown;

    private readonly EasyMdeKeyRegistration[] Keys =
    [
        new() { Key = "s", Ctrl = true, NotifyDotNet = true }
    ];

    private ValueTask<bool> HandleKey(EasyMdeKeyEvent e)
    {
        if (e.Ctrl && (e.Key is "s" or "S"))
        {
            // trigger save
        }

        return ValueTask.FromResult(true);
    }
}

License

MIT

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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 (1)

Showing the top 1 popular GitHub repositories that depend on EasyMDE.Blazor:

Repository Stars
LANCommander/LANCommander
Version Downloads Last Updated
1.0.5 6,056 1/8/2026
1.0.4 1,916 1/2/2026
1.0.3 141 12/29/2025
1.0.2 119 12/28/2025
1.0.1 128 12/28/2025
1.0.0 124 12/28/2025