Uno.Monaco.Editor 6.5.0-dev.337

Prefix Reserved
This is a prerelease version of Uno.Monaco.Editor.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Uno.Monaco.Editor --version 6.5.0-dev.337
                    
NuGet\Install-Package Uno.Monaco.Editor -Version 6.5.0-dev.337
                    
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="Uno.Monaco.Editor" Version="6.5.0-dev.337" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Uno.Monaco.Editor" Version="6.5.0-dev.337" />
                    
Directory.Packages.props
<PackageReference Include="Uno.Monaco.Editor" />
                    
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 Uno.Monaco.Editor --version 6.5.0-dev.337
                    
#r "nuget: Uno.Monaco.Editor, 6.5.0-dev.337"
                    
#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 Uno.Monaco.Editor@6.5.0-dev.337
                    
#: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=Uno.Monaco.Editor&version=6.5.0-dev.337&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Uno.Monaco.Editor&version=6.5.0-dev.337&prerelease
                    
Install as a Cake Tool

Uno.Monaco.Editor

A cross-platform Uno Platform wrapper around the Monaco Editor, bringing the same code editor that powers VS Code to .NET applications targeting WebAssembly and Desktop (Skia).

NuGet License: MIT CI

This project is not affiliated with the Monaco team and is provided for convenience. Please direct issues related to this control wrapper to this repository.

Key Features

  • IntelliSense and completions -- register custom completion providers with snippet support
  • Syntax highlighting -- set the code language to get full Monaco syntax highlighting
  • Themes -- automatic light/dark/high-contrast theme switching based on system settings
  • Decorations and markers -- strongly-typed C# abstractions for line decorations and diagnostic markers
  • Language providers -- CodeAction, CodeLens, Color, Completion, and Hover provider bridges
  • Actions and commands -- register custom editor actions and keybinding commands
  • Editor options -- full StandaloneEditorConstructionOptions support through CodeEditor.Options
  • Two-way text binding -- bind editor content to C# properties with change notifications
  • Dual-platform support -- single codebase runs on both net10.0-browserwasm and net10.0-desktop

Platform Support

Feature WASM (browserwasm) Desktop (Windows/macOS/Linux)
Text editing and syntax highlighting Supported Supported
Editor options and themes Supported Supported
Decorations and markers Supported Supported
Language providers (Completion, Hover, etc.) Supported Supported
AddActionAsync / AddCommandAsync Supported Supported
PostWebMessage Not supported Supported
Interop mechanism JSImport / JSExport JSON-RPC over WebView2

AddActionAsync and AddCommandAsync work on both WASM and desktop platforms. On WASM they use JSExport callbacks; on desktop they use JSON-RPC bridge routing. See architecture docs for details.

Getting Started

Prerequisites

Install

Add the NuGet package to your project:

dotnet add package Uno.Monaco.Editor

Minimal Example

XAML:

<Page x:Class="MyApp.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:monaco="using:Monaco">

    <monaco:CodeEditor x:Name="Editor"
                       CodeLanguage="csharp"
                       VerticalAlignment="Stretch"
                       HorizontalAlignment="Stretch" />
</Page>

C# code-behind:

using Monaco;

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();
        Editor.EditorLoaded += Editor_Loaded;
    }

    private void Editor_Loaded(object sender, RoutedEventArgs e)
    {
        // Set initial content
        Editor.Text = "Console.WriteLine(\"Hello, Monaco!\");";

        // Configure editor options
        Editor.Options.FontSize = 14;
        Editor.Options.Minimap = new EditorMinimapOptions { Enabled = false };
    }
}

Usage Overview

  • Architecture -- internal design, dual-platform interop, lifecycle state machine, and serialization layer
  • Changelog -- release history, breaking changes, and migration guide
  • Getting Started Guide -- step-by-step tutorials for WASM and Desktop targets
  • API Cookbook -- common scenarios: set text/language, listen to changes, register providers, add decorations

The MonacoEditorTestApp project in this repository provides a working playground with examples of text binding, language providers, decorations, markers, and theme switching.

Monaco API Conventions

The C# API follows Monaco/TypeScript naming as closely as possible while using idiomatic C#/WinRT types:

  • All interop methods are asynchronous and end with the Async suffix.
  • Language APIs are accessed through the editor instance: editor.Languages.RegisterCompletionItemProviderAsync(...) (there is no global monaco.languages equivalent because each editor instance hosts its own WebView context).
  • CommandHandler delegates receive System.Text.Json.JsonElement (not Newtonsoft JObject).

Build from Source

Prerequisites

  • .NET 10 SDK with the wasm-tools workload
  • Node.js (for TypeScript compilation and Monaco dependencies)
  • PowerShell (for install-dependencies.ps1)

Steps

# 1. Install Monaco and build TypeScript bundles
pwsh ./install-dependencies.ps1

# 2. Restore and build the solution
dotnet restore MonacoEditorComponent.slnx
dotnet build MonacoEditorComponent.slnx --no-restore

# 3. Build the test app for specific targets
dotnet build MonacoEditorTestApp/MonacoEditorTestApp.csproj -f net10.0-browserwasm
dotnet build MonacoEditorTestApp/MonacoEditorTestApp.csproj -f net10.0-desktop

Type Generation Pipeline

The C# API surface in MonacoEditorComponent/Monaco/ is generated from Monaco's TypeScript definitions using a two-stage pipeline:

  1. ts-morph extractor (tools/monaco-type-extractor/): Parses monaco.d.ts into a versioned intermediate JSON model.
  2. .NET CLI emitter (tools/MonacoTypeEmitter/): Emits C# classes with System.Text.Json attributes from the intermediate model.

To regenerate after updating the Monaco version:

npx tsx tools/monaco-type-extractor/src/index.ts -- node_modules/monaco-editor/monaco.d.ts \
    -o tools/monaco-type-extractor/output/model.json
dotnet run --project tools/MonacoTypeEmitter -- \
    --input tools/monaco-type-extractor/output/model.json \
    --output MonacoEditorComponent/Monaco/

Monaco Version

This package bundles Monaco Editor 0.52.2 (declared as ^0.52.2 in package.json).

Breaking Changes

See the Changelog for the full list of breaking changes and a step-by-step migration guide from Monaco.Editor 2.0.0-dev.60 to Uno.Monaco.Editor.

Contributing

See AGENTS.md for development workflow, code conventions, and commit guidelines.

License

This project is licensed under the MIT License.

Product 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. 
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 (4)

Showing the top 4 popular GitHub repositories that depend on Uno.Monaco.Editor:

Repository Stars
unoplatform/uno
Open-source platform for building cross-platform native Mobile, Web, Desktop, and Embedded apps from a single C#/XAML codebase. Work from any IDE/CLI with Hot Reload, Visual Designer, MCPs, and Skills built for modern .NET workflows. 200M+ NuGet downloads.
mono/SkiaSharp
SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
NuGetPackageExplorer/NuGetPackageExplorer
Create, update and deploy Nuget Packages with a GUI
unoplatform/Uno.Playground
Source code for the Uno Gallery apps and Uno Playground (made in Wasm)
Version Downloads Last Updated
6.5.0-dev.390 76 9/3/2026
6.5.0-dev.370 74 8/28/2026
6.5.0-dev.350 59 8/27/2026
6.5.0-dev.348 693 8/27/2026
6.5.0-dev.345 369 8/18/2026
6.5.0-dev.341 65 8/18/2026
6.5.0-dev.337 104 7/27/2026
6.5.0-dev.335.gc6f90eed90 62 7/24/2026
6.4.0-dev.41.gfc42320b13 1,579 12/2/2025
2.0.0-dev.60 3,908 7/19/2024
2.0.0-dev.58 173 7/12/2024
2.0.0-dev.56 191 7/8/2024
2.0.0-dev.54 334 5/16/2024
2.0.0-dev.50 20,435 6/27/2023
1.2.0-dev.25 8,262 6/27/2023
1.2.0-dev.23 449 5/17/2023
1.1.1-uno.16 287 5/17/2023
1.1.1-uno.2 618 8/10/2022
1.1.0 14,181 2/1/2022
1.1.0-uno.16 1,439 11/17/2021
Loading failed