Uno.Monaco.Editor
6.5.0-dev.337
Prefix Reserved
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
<PackageReference Include="Uno.Monaco.Editor" Version="6.5.0-dev.337" />
<PackageVersion Include="Uno.Monaco.Editor" Version="6.5.0-dev.337" />
<PackageReference Include="Uno.Monaco.Editor" />
paket add Uno.Monaco.Editor --version 6.5.0-dev.337
#r "nuget: Uno.Monaco.Editor, 6.5.0-dev.337"
#:package Uno.Monaco.Editor@6.5.0-dev.337
#addin nuget:?package=Uno.Monaco.Editor&version=6.5.0-dev.337&prerelease
#tool nuget:?package=Uno.Monaco.Editor&version=6.5.0-dev.337&prerelease
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).
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
StandaloneEditorConstructionOptionssupport throughCodeEditor.Options - Two-way text binding -- bind editor content to C# properties with change notifications
- Dual-platform support -- single codebase runs on both
net10.0-browserwasmandnet10.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
- .NET 10 SDK with the
wasm-toolsworkload (for WASM targets) - Uno Platform project targeting
net10.0-browserwasmand/ornet10.0-desktop
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
Asyncsuffix. - Language APIs are accessed through the editor instance:
editor.Languages.RegisterCompletionItemProviderAsync(...)(there is no globalmonaco.languagesequivalent because each editor instance hosts its own WebView context). CommandHandlerdelegates receiveSystem.Text.Json.JsonElement(not NewtonsoftJObject).
Build from Source
Prerequisites
- .NET 10 SDK with the
wasm-toolsworkload - 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:
- ts-morph extractor (
tools/monaco-type-extractor/): Parsesmonaco.d.tsinto a versioned intermediate JSON model. - .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 | Versions 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. |
-
net10.0
- Nito.AsyncEx (>= 5.1.2)
- StreamJsonRpc (>= 2.25.28)
- Uno.CommunityToolkit.WinUI (>= 7.1.204)
- Uno.Core.Extensions.Logging (>= 4.1.1)
- Uno.Core.Extensions.Logging.Singleton (>= 4.1.1)
- Uno.WinUI (>= 6.5.153)
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 |