# SbMarkdownViewer Renders markdown content as HTML using the Markdig library. Supports advanced markdown extensions including tables, task lists, and code blocks. ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Content | string? | null | The markdown content to render | | Class | string? | null | Additional CSS classes | | Style | string? | null | Inline styles | | AdditionalAttributes | Dictionary? | null | Additional HTML attributes | ## CSS Classes - `sb-markdown-viewer` - Base class applied to the container ## Markdown Features The component uses Markdig with advanced extensions enabled, supporting: - **Standard Markdown**: Headings, paragraphs, lists, links, images, emphasis - **Extended Syntax**: Tables, task lists, strikethrough - **Code Blocks**: Fenced code blocks with language specification - **Auto-links**: Automatic URL linking - **And more**: Abbreviations, footnotes, etc. ## Examples ### Basic Usage ```razor @code { private string markdownContent = """ # Hello World This is **bold** and this is *italic*. - Item 1 - Item 2 - Item 3 """; } ``` ### From External Source ```razor @inject HttpClient Http @code { private string? readmeContent; protected override async Task OnInitializedAsync() { readmeContent = await Http.GetStringAsync("README.md"); } } ``` ### With Code Blocks ```razor @code { private string codeExample = """ ## Code Example Here's how to create a button: ```razor Click Me ``` And the handler: ```csharp private void HandleClick() { Console.WriteLine("Clicked!"); } ``` """; } ``` ### With Tables ```razor @code { private string tableContent = """ ## Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | Name | string | null | The component name | | Size | SbSize | Md | Component size | | Disabled | bool | false | Disables the component | """; } ``` ### With Task Lists ```razor @code { private string taskList = """ ## TODO - [x] Create component - [x] Add parameters - [ ] Write documentation - [ ] Add tests """; } ``` ### Documentation Page ```razor
SbButton Documentation
@code { private string buttonDocs = """ A versatile button component for triggering actions. ## Basic Usage ```razor Click Me ``` ## Variants - **Primary**: Default filled button - **Outlined**: Button with border - **Ghost**: Transparent button ## Props | Prop | Type | Description | |------|------|-------------| | Variant | SbButtonVariant | Visual style | | Size | SbSize | Button size | | Disabled | bool | Disables interaction | """; } ``` ### Styled Container ```razor ``` ### Blog Post ```razor
@post.Title @post.Date.ToLongDateString() ยท @post.ReadTime min read
``` ### Component Demo Page ```razor @* Live component demo *@ Demo Button @code { private string codeSnippet = """ ```razor Demo Button ``` """; private string apiDocs = """ ## Parameters | Parameter | Type | Default | |-----------|------|---------| | Variant | SbButtonVariant | Primary | | Size | SbSize | Md | """; } ```