Preview
File Preview
Lightweight, GitHub-style file preview for any URL — independent of timeline, dtype, and lane systems.
Why a separate system?
The pre-built Views and <TrackerContainer> target time-synchronized robotics data: every track has a clock, a dtype, and a lane. <FilePreview> is the inverse — single-shot, business-agnostic, no clock involvement.
- Business-agnostic — input is just a URL. No tracks, no playlists, no dtype dispatch.
- No time — render once and stop. There is no clock subscription, no
useFrame, norequestAnimationFrame. - Drop-in for any URL — pre-signed S3, public CDN, blob URL, or local dev server.
Together with the timeline system, a typical experiment dashboard uses both: timeline for sensor streams, <FilePreview> for episode artifacts (configs, logs, checkpoints, frame dumps).
Quick Start
import { FilePreview } from '@vuer-ai/vuer-m3u/preview'
import '@vuer-ai/vuer-m3u/styles.css'
<FilePreview url="https://s3.example.com/file.png" />That's it. The preview resolves a kind from the URL extension, lazy-loads the matching previewer chunk, and renders. No config required.
See it in action
One previewer per kind — image, CSV, JSONL, NumPy .npy, and MCAP — all rendered live below.
import { FilePreview } from '@vuer-ai/vuer-m3u/preview'
import '@vuer-ai/vuer-m3u/styles.css'
export function ArtifactGallery() {
return (
<div className="grid gap-4">
<FilePreview url="/path/to/scene.svg" />
<FilePreview url="/path/to/poses.csv" />
<FilePreview url="/path/to/events.jsonl" />
<FilePreview url="/path/to/joints.npy" />
<FilePreview url="/path/to/recording.mcap" />
</div>
)
}Supported file types
| Kind | Extensions | Loading strategy | Lazy | Default limit |
|---|---|---|---|---|
| Image | jpg jpeg png gif webp avif svg | Native <img> | — | 20 MB (hard) |
| Video / Audio | mp4 webm mov mp3 wav ogg flac | Native <video> / <audio> | — | streaming |
| Text / Code | txt py ts tsx js json yaml toml go rs c cpp ... | fetch + highlight.js | yes | 5 MB (soft) |
| Markdown | md mdx | react-markdown + GFM | yes | 5 MB (soft) |
| CSV / TSV | csv tsv | RFC 4180 parser, virtual list | yes | 10 MB (soft) |
| JSONL | jsonl ndjson | Line parser, virtual list | yes | 10 MB (soft) |
| NPY | npy | NumPy parser, two-stage Range | yes | 1024-element preview |
| MCAP | mcap | @mcap/core indexed reader | yes | footer + summary only |
Files with unrecognized extensions render an unsupported placeholder with a download link; failed fetches render an error state.
Where to next
- Design — why this looks the way it does
- API —
<FilePreview>props,PreviewLimits,ResolvedFileMeta - Size Strategy — hard vs soft limits, range requests
- Recipes — auth headers, metadata pass-through, file switcher