Skip to main content

Blazor Markdown  Preview 

Use Blazor Bootstrap Markdown component to add formatting, tables, images, and more to your project pages.

Parameters

NameTypeDefaultRequiredDescriptionAdded Version
ChildContentRenderFragmentnull✔️Gets or sets the content to be rendered within the component.3.1.0
TableCssClassstring?tableGets or sets the CSS class for table.3.1.0
BlockquotesCssClassstring?blockquoteGets or sets the CSS class for blockquotes.3.1.0

Live preview

Blazor Markdown Component

See demo here.

Examples

Headers

Use headers to structure your content. Start a line with # for a heading. Add more # characters for subheadings, up to six levels.

Blazor Markdown Component - Headers
<Markdown>
# This is a H1 header
## This is a H2 header
### This is a H3 header
#### This is a H4 header
##### This is a H5 header
###### This is a H6 header
</Markdown>

See demo here.

Paragraphs and line breaks

Break your text into paragraphs or line breaks for easier reading.

Blazor Markdown Component - Paragraphs and line breaks
<Markdown>
Add lines between your text with the **Enter** key.
Your text gets better spaced and makes it easier to read.


Add lines between your text with the **Enter** key.
Your text gets better spaced and makes it easier to read.
</Markdown>

See demo here.

Blockquotes

Quote text with > before it. Use more > characters to nest quotes. For blocks of text, use > at the start of each line.

Blazor Markdown Component - Blockquotes
<Markdown>
> A well-known quote, contained in a blockquote element.
</Markdown>

<Markdown>
> Single line quote
>> Nested quote
>> multiple line
>> quote
</Markdown>

See demo here.

Horizontal rules

Add a horizontal rule with a line of ---.

Blazor Markdown Component - Horizontal rules
<Markdown>
above
---
below
</Markdown>

See demo here.

Emphasis (bold, italics, strikethrough)

Emphasize text with bold, italics, or strikethrough:

  • Italics: *text* or _text_
  • Bold: **text**
  • Strikethrough: ~~text~~
  • Combine for more emphasis.
Blazor Markdown Component - Emphasis (bold, italics, strikethrough)
<Markdown>
Use _emphasis_ in comments to express **strong** opinions and point out ~~corrections~~
**_Bold, italicized text_**
**~~Bold, strike-through text~~**
</Markdown>

See demo here.

Code highlighting

Blazor Markdown Component - Code highlighting

See demo here.

Tables

Tables help organize structured data.

  • Use | to separate cells.
  • Escape | with \| if used within a cell.
  • Use <br /> for new lines within a cell.
  • End each row with a carriage return (CR) or line feed (LF).
Blazor Markdown Component - Tables
<Markdown>
| Heading 1 | Heading 2 | Heading 3 |
|--|--|--|
| Cell A1 | Cell A2 | Cell A3 |
| Cell B1 | Cell B2 | Cell B3<br />second line of text |
</Markdown>
Blazor Markdown Component - Tables with Css class
<Markdown TableCssClass="table table-striped table-hover table-bordered">
| Heading 1 | Heading 2 | Heading 3 |
|--|--|--|
| Cell A1 | Cell A2 | Cell A3 |
| Cell B1 | Cell B2 | Cell B3 |
| Cell C1 | Cell C2 | Cell C3 |
| Cell D1 | Cell D2 | Cell D3 |
| Cell E1 | Cell E2 | Cell E3 |
</Markdown>

See demo here.

Lists

Use lists to organize related items:

  • Ordered lists: start with a number followed by a period.
  • Unordered lists: start with a -.
  • Begin each list item on a new line.
Blazor Markdown Component - Lists

See demo here.

Ordered list

Blazor Markdown Component - Ordered list
<Markdown>
1. First item
1. Second item
1. Third item
</Markdown>

See demo here.

Unordered list

Blazor Markdown Component - Unordered list
<Markdown>
- Item 1
- Item 2
- Item 3
</Markdown>

See demo here.

Nested list

Blazor Markdown Component - Nested list
<Markdown>
1. First item
1. Item 1
1. Item 2
1. Item 3
1. Second item
1. Nested item 1
1. Further nested item 1
1. Further nested item 2
1. Further nested item 3
1. Nested item 2
1. Nested item 3
1. Third item
</Markdown>
Blazor Markdown Component - Nested list
<Markdown>
- First item
- Item 1
- Item 2
- Item 3
- Second item
- Nested item 1
- Further nested item 1
- Further nested item 2
- Further nested item 3
- Nested item 2
- Nested item 3
- Third item
</Markdown>
Blazor Markdown Component - Nested list
<Markdown>
1. First item
- Item 1
- Item 2
- Item 3
1. Second item
- Nested item 1
- Further nested item 1
- Further nested item 2
- Further nested item 3
- Nested item 2
- Nested item 3
1. Third item
</Markdown>

See demo here.

Blazor Markdown Component - Links
<Markdown>
[BlazorBootstrap - Docs](https://docs.blazorbootstrap.com/)
[BlazorBootstrap - Demos](https://demos.blazorbootstrap.com/)
</Markdown>

See demo here.

Images

Blazor Markdown Component - Images
<Markdown>
![BlazorBootstrap](https://demos.blazorbootstrap.com/images/logo/logo-color.svg)
</Markdown>
Blazor Markdown Component - Images
<Markdown>
![BlazorBootstrap](https://demos.blazorbootstrap.com/images/logo/logo-color.svg =200x200)
</Markdown>
Blazor Markdown Component - Images
<Markdown>
![BlazorBootstrap](https://demos.blazorbootstrap.com/images/logo/logo-color.svg =50)
</Markdown>

See demo here.