FluentUI.Blazor.Monaco.EditorPack 1.0.0

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

FluentUI Blazor Monaco Editor Pack

<img src="assets/editor-pack-logo.png" alt="Editor Pack logo" width="300">

Monaco Editor integration for Blazor with FluentUI components — includes Markdown and CSS editors with IntelliSense, live preview, and theme integration.

NuGet


Live Demo

Try the interactive demo


Screenshots

Markdown Editor

CSS Editor


Features

  • Markdown Editor — Live preview, CSS class IntelliSense, toolbar, undo/redo
  • CSS Editor — FluentUI design token IntelliSense, color swatches, auto‑completion
  • Theme Integration — Automatic dark/light mode support
  • Monaco lifecycle hooks — Run code before Monaco is created and after the editor instance is available
  • Configurable Markdig pipeline — Toggle common Markdig extensions via MarkdownOptions
  • Unified Monaco configuration — Strongly‑typed MonacoOptions for editor behavior, theme, and front‑matter support

📘 Migration Guide

Fluent UI Blazor v5: This version is built on Microsoft.FluentUI.AspNetCore.Components 5.x. Fluent UI Blazor v5 contains breaking changes, so your application must also be on v5.

➡️ Upgrade Guide: Fluent UI Blazor v4 → v5

If you are upgrading from 0.1.x to 0.2.0‑preview, please read the migration guide:

➡️ Migration Guide


Quick Start

1. Install Package

dotnet add package FluentUI.Blazor.Monaco.EditorPack

2. Register Services

Add to Program.cs:

builder.Services.AddMonacoEditorPack();
builder.Services.AddFluentUIComponents();

3. Add Styles and Scripts

Blazor Server (App.razor):

<head>
    <link href="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.bundle.scp.css" rel="stylesheet" />
    <script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
</head>
<body>
    <Routes @rendermode="new InteractiveServerRenderMode(prerender: true)" />
    <script src="_framework/blazor.web.js"></script>

    
    <script src="_content/FluentUI.Blazor.Monaco.EditorPack/lib/monaco-editor/min/vs/loader.js"></script>
    <script src="_content/FluentUI.Blazor.Monaco.EditorPack/js/monaco-editor-pack.js"></script>
</body>

Blazor WebAssembly (index.html):

<head>
    <link href="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.bundle.scp.css" rel="stylesheet" />
    <script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
</head>
<body>
    <div id="app">...</div>
    <script src="_framework/blazor.webassembly.js"></script>

    
    <script src="_content/FluentUI.Blazor.Monaco.EditorPack/lib/monaco-editor/min/vs/loader.js"></script>
    <script src="_content/FluentUI.Blazor.Monaco.EditorPack/js/monaco-editor-pack.js"></script>
</body>

4. Add FluentProviders

Fluent UI Blazor v5 requires FluentProviders at the end of your main layout (it replaces the v4 provider components and FluentDesignTheme):

@* MainLayout.razor *@
@Body
<FluentProviders />

Using the Components

Markdown Editor

<MonacoMarkdownEditor @ref="editor"
                      Markdown="@content"
                      MarkdownChanged="@OnChanged" />

@code {
    private MonacoMarkdownEditor? editor;
    private string content = "# Hello World";

    private Task OnChanged(string newContent)
    {
        content = newContent;
        return Task.CompletedTask;
    }
}

Configuring Markdig (Markdown Preview)

@using FluentUI.Blazor.Monaco.EditorPack.Markdown

<MonacoMarkdownEditor Markdown="@content"
                      MarkdownChanged="@OnChanged"
                      MarkdownOptions="@options" />

@code {
    private string content = "# Hello World";

    private readonly MarkdownOptions options = new() {
        EnableFrontMatter = true,
        EnableTables = true,
        EnableTaskLists = true,
        EnableGenericAttributes = true,
        EnableAutoIdentifiers = true,
        EnableAutoLinks = true,
        EnableEmphasisExtras = true,
        EnableListExtras = true,
        EnableFencedCodeBlocks = true
    };

    private Task OnChanged(string newContent)
    {
        content = newContent;
        return Task.CompletedTask;
    }
}

Monaco Lifecycle Hooks

MonacoMarkdownEditor exposes two optional lifecycle hooks:

  • BeforeCreated — called before Monaco is created
  • AfterInitialized — called after the editor instance is available
<MonacoMarkdownEditor Markdown="@content"
                      MarkdownChanged="@OnChanged"
                      BeforeCreated="@OnBeforeCreated"
                      AfterInitialized="@OnAfterInitialized" />

@code {
    private string content = "# Hello World";

    private Task OnChanged(string newContent)
    {
        content = newContent;
        return Task.CompletedTask;
    }

    private Task OnBeforeCreated(IJSRuntime js)
    {
        // Configure Monaco before creation (languages, themes, etc.)
        return Task.CompletedTask;
    }

    private Task OnAfterInitialized(IJSObjectReference editor)
    {
        // Editor instance is available
        return Task.CompletedTask;
    }
}

CSS Editor

<MonacoCssEditor @ref="cssEditor"
                 Css="@cssContent"
                 CssChanged="@OnCssChanged" />

@code {
    private MonacoCssEditor? cssEditor;
    private string cssContent = ".my-class { color: var(--accent-fill-rest); }";

    private Task OnCssChanged(string newCss)
    {
        cssContent = newCss;
        return Task.CompletedTask;
    }
}

Detailed Setup


Requirements

  • .NET 9.0 or .NET 10.0
  • Microsoft.FluentUI.AspNetCore.Components 5.0.0+ (Fluent UI Blazor v5)

License

MIT License — see LICENSE

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 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. 
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.0 121 10/13/2026
0.2.2-preview 186 2/8/2026
0.2.1-preview 125 2/8/2026
0.2.0-preview 138 2/7/2026
0.1.12-preview 134 2/5/2026
0.1.11-preview 144 2/4/2026
0.1.10-preview 123 2/4/2026
0.1.9-preview 359 12/7/2025
0.1.8-preview 217 12/5/2025
0.1.7-preview 217 12/5/2025

1.0.0: First stable release. Requires Microsoft.FluentUI.AspNetCore.Components v5. Breaking change from 0.x (Fluent UI v4); see UPGRADE_GUIDE_FLUENTUI_V5.md in the repository.