ToastUIEditorandToastUIEditorViewer: thin Blazor wrappers around the native TOAST UI JavaScript editor and viewer. They depend on Blazor and the bundled TOAST UI assets only.WrappedToast: a higher-level MudBlazor component built on top of those thin wrappers.
TOAST UI Editor assets are bundled and automatically loaded by components.
src/WrappedToast— reusable Razor class librarysamples/WrappedToast.SampleHost— MudBlazor sample application demonstrating all three components in various scenariossamples/ToastUIEditorAndViewerSamples— plain Blazor sample forToastUIEditorandToastUIEditorViewer. No dependencies except ASP.NET Blazor
WrappedToast component in light theme with toolbar and front-matter table.
ToastUIEditor and ToastUIEditorViewer in dark theme.
Full-height editor layout in dark theme.
- TOAST UI Editor 3.2.2 assets are included in this package. vendored under
wwwroot/lib/toastui-editor/and served at/_content/WrappedToast/lib/toastui-editor/...— no CDN dependency - Components self-register their CSS/JS via the bundled loader. No
<script>or<link>tags needed in the host app. - WrappedToast and its sample application uses MudBlazor components
- Thin wrappers around the native TOAST UI Editor and Viewer.
- Constructor options are forwarded through
Options. - Straightforward native methods are exposed as Blazor methods. JS callback and DOM-node APIs are intentionally not wrapped as direct C# methods.
- See ToastUIEditor API Reference and ToastUIEditorViewer API Reference for the full method list.
- Optional YAML-style
---front-matter parsed, displayed, and edited inline ToolbarExtrasRenderFragmentto inject host-specific buttons without coupling the package to host navigation- Copy-as-markdown and copy-as-HTML toolbar actions, with clipboard failures surfaced through a
MudBlazor.ISnackbar - Programmatic API on WrappedToast: insert, replace, find-and-replace, cursor movement
- Light and dark theme support
Toast UI Editor component API reference Toast UI Editor Viewer component API reference WrappedToast component API Reference
@using WrappedToast
<ToastUIEditor InitialStyle="width:100%;height:400px;"
Options="@(new Dictionary<string,string> { ["initialEditType"] = "wysiwyg" })" />@using WrappedToast
<ToastUIEditorViewer InitialStyle="width:100%;height:auto;"
Options="@(new Dictionary<string,string> { ["height"] = "auto" })" />WrappedToast is a MudBlazor component. Register MudBlazor in the host app:
builder.Services.AddMudServices();Include MudBlazor providers in the host layout:
<MudThemeProvider />
<MudPopoverProvider />
<MudDialogProvider />
<MudSnackbarProvider />@using WrappedToast
<WrappedToast Title="@FilePath"
Content="@FileContent"
OnSave="HandleSaveAsync">
<ToolbarExtras>
<MudButton Variant="Variant.Outlined"
StartIcon="@Icons.Material.Filled.Print"
OnClick="OpenPrintViewAsync">
Print
</MudButton>
</ToolbarExtras>
</WrappedToast>WrappedToast parses optional --- YAML-style front matter from Content and displays it as a table above the editor. The full markdown (front matter + body) is delivered back through OnSave.
private Task HandleSaveAsync(string markdown)
{
// persist the full markdown (including front matter) here
return Task.CompletedTask;
}Run the MudBlazor sample host from the repository root:
dotnet run --project samples/WrappedToast.SampleHostThen open the URL printed to the console (typically https://localhost:5001/).
This sample demonstrates all three components, including WrappedToast front-matter round-trip, ToolbarExtras, and light/dark theme toggling.
Run the ToastUIEditorAndViewerSamples sample host from the repository root:
dotnet run --project samples/ToastUIEditorAndViewerSamplesThis sample demonstrates the thin ToastUIEditor and ToastUIEditorViewer wrappers only.
This package is MIT licensed. It bundles a copy of the TOAST UI Editor (@toast-ui/editor), which is also MIT licensed and copyright NHN Cloud Corp. See THIRD-PARTY-NOTICES.md for the full attribution and license text.