CodeBlock
FreeShows source code with light syntax coloring (C#, JavaScript, TypeScript, JSON, HTML, SCSS, SQL and shell), optional line numbers and a copy button. Colors come from theme tokens, so contrast holds in both themes.
Example

Parameters
| Parameter | Type | Description |
|---|---|---|
Class | string | Extra CSS classes added to the root element. |
Code | string | The source text. |
Language | string | csharp, javascript, typescript, json, html, scss, sql or bash; anything else is shown uncolored. |
ShowCopy | bool | Shows the copy button (default true). |
ShowLineNumbers | bool | Shows a number before each line. |
Style | string | Inline style added to the root element. |
Title | string | Text in the header; defaults to the language. |
Package
CodeBlock is part of RayCraft Free. Package: RayCraft.Blazor. It comes from nuget.org. See Getting started.
Send feedbackVersion 1.0.3