
Auto-detecting file viewer. Accepts a FileSource (URL / base64 / bytes) and routes to the right renderer by category: image (delegates to ImageViewer), markdown (tabbed Preview / Source), text (highlight.js coloured), embedded (PDF and other browser-renderable types via <iframe>), zip (tree + nested viewer for the selected entry), and unsupported (info message). Detection prefers the source's MIME, otherwise the file extension.
Image kinds delegate to ImageViewer with Framed + Downloadable chrome.

UTF-8 bytes decoded and rendered with Markdig (Blazor) or a markdown parser (React) in a Preview / Source tabbed pane.
The FileViewer picks a renderer per file kind.
ImageViewer.var source = new FileSource.Bytes(bytes) { FileName = "readme.md" };
# Hello FileViewer
The **FileViewer** picks a renderer per file kind.
- Images flow through `ImageViewer`.
- Markdown picks up Markdig.
- Text/code is coloured with highlight.js.
- Zip archives expand to a tree.
```csharp
var source = new FileSource.Bytes(bytes) { FileName = "readme.md" };
```
UTF-8 bytes rendered through highlight.js using the language inferred from the file extension.
{
"name": "ImageViewer",
"features": ["rotate", "zoom", "flip", "crop"],
"version": "1.0"
}Unknown extensions fall through to a friendly info message instead of throwing.
Name | Type | Default | Description |
|---|---|---|---|
Downloadable | bool | True | When Components.ImageViewer instead — same behavior, same icon, just owned by the image viewer's own chrome. |
Fallback | RenderFragment? | Rendered when FileViewer.Source is null. | |
FileName | string? | File name used for category detection (extension), the embedded FileSource.FileName, otherwise to the URL's last path segment, otherwise to | |
MaxHeight | string | 60vh | Maximum height for inline renderers (text, markdown viewport, embedded iframe). Sets the scrollable region. Defaults to |
Source | FileSource? | File data to render. When null, FileViewer.Fallback is rendered instead (or nothing if no fallback is supplied). |
DownloadableComponents.ImageViewer instead — same behavior, same icon, just owned by the image viewer's own chrome.FallbackFileViewer.Source is null.FileNameFileSource.FileName, otherwise to the URL's last path segment, otherwise to MaxHeightSourceFileViewer.Fallback is rendered instead (or nothing if no fallback is supplied).