百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MudBlazor.Markdown

> 开发工具
开源

基于 MudBlazor 环境的 Markdown 组件

199 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

基于 MudBlazor 环境的 Markdown 组件

Markdown component for MudBlazor

This README covers configuration steps for Blazor Server and Blazor WebAssembly. For images of how the markup component looks like in the browser go to the README of samples.

Documentation

  • MudBlazor.Markdown - Wiki page
  • ⚡ Try.MudBlazor.com - Interactive playground

Getting started

NB! MudBlazor does not work well with the static SSR format because some code is executed in OnAfterRender or OnAfterRenderAsync that is not invoked by default.
Specify @rendermode="InteractiveServer" on the markdown component to make it work (e.g. ``)

Install the NuGet package.

dotnet add package MudBlazor.Markdown

Add the following using statement in _Imports.razor.

razor
@using MudBlazor

Add the following nodes in either App.razor or MainLayout.razor.

razor

Add the following nodes in Pages/_Host.cstml (Server) or wwwroot/index.html (WebAssembly).
In the `` node add these CSS stylesheets.

xml

At the bottom of the `` node add this JS source.

xml

Register MudBlazor services in the DI container.
For the Blazor Server in the Startup.cs add this method.

cs
public void ConfigureServices(IServiceCollection services)
{
    services.AddMudServices();
    services.AddMudMarkdownServices();
    // Optionally if the default clipboard functionality fails it is possible to add a custom service
    // NB! MauiClipboardService is just an example
    services.AddMudMarkdownClipboardService();
}

For the Blazor WebAssembly in the Program.cs add this method.

cs
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddMudServices();
builder.Services.AddMudMarkdownServices();
// Optionally if the default clipboard functionality fails it is possible to add a custom service
// NB! MauiClipboardService is just an example
builder.Services.AddMudMarkdownClipboardService();

Example Usage

razor
My markdown

@code
{
    private string Value { get; } = "text *italics* and **bold**";
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#blazorblazor-clientblazor-componentsblazor-server

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具