Code, filesand media.
Highlight code in thirteen languages with line numbers and emphasized lines, mask a secret until it is revealed, and open PDFs, images, video, audio, CSV, Markdown and text in a file preview overlay, next to audio and video players with clip and play-limit rules.
dotnet add package Klyroo.Display --prerelease
Players KlyAudioPlayer and KlyVideoPlayer play a clip window of a file, enforce a play quota and a non-seekable timeline, and report each play through callbacks.Code KlyCodeBlock colors 13 languages from its CodeLanguage, with line numbers and emphasized lines.Secrets KlySecretBlock masks all but the last characters, with a Reveal toggle and a copy button.Preview KlyFileList opens its files as a gallery in the overlay of KlyFilePreviewProvider: PDF, images, video, audio, CSV, Markdown and text.
<KlyCodeBlock Label="Orders.sql" Code="@Query"
Language="CodeLanguage.Sql" LineNumbers
HighlightLines="@([2, new CodeLineRange(4, 5)])" />
<KlySecretBlock Label="API key" Value="@ApiKey"
VisibleChars="4" />
<KlyFileList Title="Attachments" Files="_files" />
<KlyFilePreviewProvider />KlyCodeBlock colors the code from its Language and keeps the text plain, so selecting and copying give the code as it is.
SELECT id, totalFROM ordersWHERE status = 'paid' AND total > 100 AND shipped_at IS NULL;colored from Language by the CodeHighlighter of Klyroo.Display.Core, 13 languages line 2 and lines 4 to 5 are emphasized; the numbers are drawn with CSS, so copying gives the code only
- PDFSpecification.pdfVersion 3 · 1.5 MB
- CSVmetrics.csv18 KB
- PDFQ3 summary
eight bullets, then the last four characters; the copy button copies the whole value each row shows a badge, the name, the size and a description a click opens all the files as a gallery in the preview, starting at the clicked one
Everything it does
- Syntax highlighting
KlyCodeBlockcolors C#, JavaScript, TypeScript, JSON, HTML, XML, CSS, SCSS, Less, SQL, Python, Bash and YAML from a typedCodeLanguage, with a label, a copy button, optional line numbers and emphasized lines (HighlightLines), and the file preview does the same from the file extension. The scanner isCodeHighlighterinKlyroo.: dependency-free, trim and AOT safe, it never throws, andDisplay. Core CodeHighlighter.returns escaped markup for pages that Blazor does not render.Highlight (code, language) - Secret values
KlySecretBlockmasks all but the last characters of a value, with a Reveal toggle and a copy button, and never highlights it.- File list and preview overlay
KlyFileListlists files (FileListItem: aFilePreviewFilewith an optional description, meta text, icon and tone) with an extension badge, a size and a date, and a click opens them as a gallery in the overlay.KlyFileshows PDF, images, video, audio, CSV, Markdown and text in a modal, drawer or fullscreen panel, with keyboard navigation, image zoom and rotation, a details panel and downloads.Preview Provider - Headless file helpers
Klyroo.detects a file kind from its MIME type or extension, parses CSV and TSV (RFC 4180 quoting, delimiter detection) and formats sizes, and it is NativeAOT compatible.Display. Core - Audio and video players with clip and play-limit rules
KlyAudioPlayerandKlyVideoPlayerplay a clip window of a file, enforce a play quota and a non-seekable timeline, and report progress and the end of each play through callbacks. Their control bar has volume, speed, captions, picture-in-picture and fullscreen controls, and a compact size.- Themeable like Klyroo.UI
- Each block has slots with default classes (
Klyroo,Display Options. CodeBlock SecretBlockandFileList) that you extend inAddKlyrooDisplay, and a typedUiparameter (CodeBlockUi,SecretBlockUi,FileListUi) for one instance. - Translated texts
- The built-in labels follow the Klyroo.UI locale, with a
DisplayTextsset for each of its twelve languages (English and French reviewed), andAddKlyrooDisplaychanges any of them.(d => d. Texts ("fr", t => t with { ... }))
Packages
Klyroo.CoreDisplay. Core CodeHighlighterandCodeLanguage,File, file kind detection, CSV parser and the file and media models. No UI dependency.Preview Service Klyroo.BlazorDisplay KlyCodeBlock,KlySecretBlock,KlyFileList,KlyAudioPlayer,KlyVideoPlayerandKlyFilefor Blazor. Builds on Klyroo.UI and includes the Core package.Preview Provider
Install it, then open the first page.
Change here for the other lines
- Klyroo.UI Accessible Blazor components for the web and .NET MAUI Blazor Hybrid, styled with Tailwind CSS v4
- Klyroo.Query Typed query model, URL state sync, and IQueryable / EF Core execution
- Klyroo.Table Data lists with table and card-grid layouts, filters, selection and actions
- Klyroo.Form Schema-driven forms, validation and wizards
- Klyroo.Dashboard Dashboard controller, filters and Blazor blocks: stats, gauges, charts, tables and feeds
- Klyroo.Display Code highlighting, file preview and audio and video players
- Klyroo.Spreadsheet Import wizard for CSV, TSV and pasted data, with column and value mapping
- Klyroo.Agent Bridge that lets AI agents read and act on Klyroo forms, dashboards and imports
- Klyroo.Hotkey Server-side .NET client for Hotkey cloud browsers, human handoffs and signed webhooks
- Klyroo.Stack
Meta-package, MCP documentation server and
dotnet newtemplates