Skip to content
Document DB 13 - MCP Server, REST API, Field Level Encryption, Transactional Outbox, & More!SHOW ME!!

Markdown

Render and edit markdown content using native controls — no WebView required on MAUI. Includes a read-only MarkdownView renderer and a full MarkdownEditor with formatting toolbar and live preview. Uses Markdig for parsing with support for tables, task lists, and more.

  • NuGet downloads for Shiny.Maui.Controls.Markdown
  • NuGet downloads for Shiny.Blazor.Controls.Markdown
Frameworks
.NET MAUI
Blazor
Viewer Editor
MarkdownView MarkdownEditor

Add the XAML namespace:

xmlns:md="http://shiny.net/maui/markdown"

A read-only markdown renderer that converts markdown text to native MAUI controls.

<md:MarkdownView Markdown="{Binding DocumentContent}" Padding="16" />
Property Type Default Description
Markdown string "" Markdown content to render
Theme MarkdownTheme? null Rendering theme (auto Light/Dark if null)
IsScrollEnabled bool true Enable/disable scrolling
Event EventArgs Description
LinkTapped LinkTappedEventArgs Fired when a link is tapped

Handle links in code-behind:

markdownView.LinkTapped += (sender, args) =>
{
if (args.Url.StartsWith("internal://"))
{
// Handle internal navigation
args.Handled = true; // Prevents default browser launch
}
};

A full editor with formatting toolbar, live preview toggle, and customizable toolbar items.

<md:MarkdownEditor Markdown="{Binding NoteContent, Mode=TwoWay}"
Placeholder="Start writing markdown..."
Padding="8" />
Property Type Default Description
Markdown string "" Markdown content (TwoWay)
Theme MarkdownTheme? null Preview theme (auto Light/Dark if null)
Placeholder string "Write markdown here..." Placeholder text
ToolbarItems IReadOnlyList<MarkdownToolbarItem>? Default set Formatting toolbar buttons
IsPreviewVisible bool false Toggle preview pane (TwoWay)
ToolbarBackgroundColor Color? null Toolbar background
EditorBackgroundColor Color? null Editor background
Event EventArgs Description
LinkTapped LinkTappedEventArgs Forwarded from preview link taps
TextChanged TextChangedEventArgs Fired when editor text changes

The default toolbar includes: Bold, Italic, Inline Code, H1-H3, Bullet/Numbered/Task Lists, Link, Quote, and Code Block. Use MarkdownToolbarItems.All for all 15 items, or build a custom set:

editor.ToolbarItems = new[]
{
MarkdownToolbarItems.Bold,
MarkdownToolbarItems.Italic,
MarkdownToolbarItems.Link,
MarkdownToolbarItems.CodeBlock
};

Comprehensive theming for rendered markdown. Auto-resolves Light/Dark based on Application.Current?.RequestedTheme when null.

// Use built-in themes
markdownView.Theme = MarkdownTheme.Light;
markdownView.Theme = MarkdownTheme.Dark;
// Or customize
markdownView.Theme = new MarkdownTheme
{
TextColor = Colors.Navy,
LinkColor = Colors.Green,
H1FontSize = 36,
BlockSpacing = 16
};
Category Properties
Colors TextColor, MutedTextColor, LinkColor, CodeBackgroundColor, CodeTextColor, CodeBlockBackgroundColor, CodeBlockTextColor, BlockquoteBorderColor, BlockquoteBackgroundColor, HorizontalRuleColor, TableBorderColor, TableHeaderBackgroundColor
Font Sizes BaseFontSize (16), H1FontSize (32), H2FontSize (24), H3FontSize (20), H4FontSize (18), H5FontSize (16), H6FontSize (14), CodeFontSize (14)
Spacing BlockSpacing (12), ListIndent (24), CodeFontFamily

Bold, italic, strikethrough, H1-H6 headings, unordered/ordered/task lists, inline code, fenced code blocks, links (with LinkTapped event), images, blockquotes, tables, horizontal rules, and line breaks.

Install the NuGet package:

Terminal window
dotnet add package Shiny.Blazor.Controls.Markdown

Add the @using directive — typically in _Imports.razor:

@using Shiny.Blazor.Controls.Markdown
<MarkdownView Markdown="@content" />
@code {
string content = """
# Hello World
This is **bold** and *italic* text.
- Item 1
- Item 2
""";
}
<MarkdownEditor Markdown="@noteContent"
MarkdownChanged="v => noteContent = v"
Placeholder="Start writing markdown..."
IsPreviewVisible="@showPreview"
IsPreviewVisibleChanged="v => showPreview = v" />
<button @onclick="() => showPreview = !showPreview">
Toggle Preview
</button>
@code {
string noteContent = "";
bool showPreview;
}
claude plugin marketplace add shinyorg/skills
claude plugin install controls@shiny
copilot plugin marketplace add https://github.com/shinyorg/skills
copilot plugin install controls@shiny
View controls Plugin