Playzor.Blazor.Editor 1.0.1

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

Playzor

Playzor.Blazor.Editor

The Playzor playground as a Blazor component: monaco editors for any number of files, roslyn compiling in the browser, dockable panels for file tree, preview, errors and console, and a tool bar whose built in buttons can be picked and extended.

Looking for the small iframe embed of the hosted playground instead? That is Playzor.Blazor.

@using Playzor.Blazor.Editor.Components

<PlayzorEditor Height="100%" DefaultSnippet="@("<h3>Hi</h3>")" />

Setup

// Program.cs
builder.Services.AddScoped(_ => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddPlayzor();   // pass a MudEx configuration to let it add MudBlazor too

<link href="_content/Playzor.Blazor.Editor/css/playzor-editor.css" rel="stylesheet" />
<script src="_content/Playzor.Blazor.Editor/lib/monaco-editor/min/vs/loader.js"></script>
<script src="_content/Playzor.Blazor.Editor/js/playzor-editor.js"></script>


<script src="_content/MudBlazor.Extensions/js/mudExPopoutEvents.js"></script>

Panels can be dragged into their own browser window. Blazor delivers dom events through the document of the page it started in, so a panel over there would be dead without that last script: it records the listeners and replays them into the popout window.

Two more things are needed, and the editor tells you when one is missing:

  • A package proxy. nuget.org answers without CORS headers, so a .nupkg cannot be fetched from the browser. Add Playzor.Server and app.MapPlayzorApi(), or point the editor at a public playground: AddPlayzor(o => o.BaseAddress = PlayzorApiOptions.PlayzorNet).
  • A preview page. The compiled component runs in a second WebAssembly instance. Reference Playzor.UserComponents, follow its readme, then point CompiledPreviewUrl at that route.

Content

Parameter Default Description
Files Files to edit. A new collection replaces the whole session
FilesChanged Raised after edits, with the editor content pulled in
DefaultSnippet MudEx sample Content of the main file for a fresh session
DefaultPackages MudBlazor + MudEx Packages a fresh session starts with
PersistState true Keeps files, tabs and layout in local storage
StateKey Storage prefix, so two editors do not share a session
SnippetStore from DI IPlayzorSnippetStore used by save and samples
SnippetId / SnippetIdChanged Id of the loaded snippet, set after saving

Tool bar and panels

Parameter Default Description
ToolButtons All Flags: Run, Save, Embed, Download, Upload, Samples, Packages, Panels, Layout, Theme, plus Standalone and None
Panels All Flags: Files, Preview, Errors, Console, Packages
PackagesInDialog false Nuget buttons open the dialog instead of the packages panel
ShowStatusBar true Error counts, packages, preview reload
ToolBarStartContent Before the first built in button
ToolBarContent Between the built in buttons and the spacer
HeaderContent Right hand side of the tool bar, after the menus
StatusBarContent Right hand side of the status bar
ChildContent Additional MudExDockItem panels, dockable like the built in ones

Save, Embed, Samples and Theme need someone to answer: their button appears once the matching event (OnSaveRequested, OnEmbedRequested, OnSampleSelected + Samples, DarkModeChanged) is wired — or, for save and samples, once an IPlayzorSnippetStore is registered. ToolButtons="PlayzorToolButtons.Standalone" gives you everything that works alone.

<PlayzorEditor ToolButtons="PlayzorToolButtons.Standalone | PlayzorToolButtons.Theme"
               DarkMode="@_dark" DarkModeChanged="@(d => _dark = d)">
    <ToolBarContent>
        <MudIconButton Icon="@Icons.Material.Outlined.Share" OnClick="@ShareAsync" />
    </ToolBarContent>
    <HeaderContent>
        <MudText Typo="Typo.h6" Class="ml-2">My playground</MudText>
    </HeaderContent>
    <ChildContent>
        <MudExDockItem Id="docs" Title="Docs" Direction="DockDirection.Right">
            <MyDocsPanel />
        </MudExDockItem>
    </ChildContent>
</PlayzorEditor>

Preview, theme and layout

Parameter Default Description
PreviewUrl /user-page Page shown before anything was compiled
CompiledPreviewUrl /__main Route of the compiled component
PopoutUrl package page Host page for popped out panels
AutoRun false Compiles once as soon as the editor is up
DarkMode / DarkModeChanged true Monaco theme; the app owns its own theme
Culture ui culture Two letter culture of the editor ui (en, de)
InitialLayoutJson built in dockview layout to start with
Height / ToolBarHeight / StatusBarHeight 100% / 48px / 26px Sizes
OnCompiled Raised after every compilation with the result

Methods: TriggerCompileAsync(), GetFiles(), SetFilesAsync(files), OpenFileAsync(path), ResetLayoutAsync(), ReloadPreview().

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

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 158 8/17/2026
1.0.0 112 8/8/2026