ui · 6 variants · 1 categories
Video Player
Video wrapper — standard, live, vertical portrait, recording, editorial poster, accent.
npx "@rueda.dev/gems-diamond" add video-player Display
6 variants0:00
standardLIVE
2.4k watching
liveportraitREC0:004K · 60FPS
recEP 03 · 12 MIN
The quiet discipline of shipping
editorialaccentUsage Guide
How to wire up this component in your app — props, callbacks, customization, and the conventions Diamond shares across the library.
Playback API
Mirrors the audio player. Pass src for autonomous mode, or feed playing/progress/currentTime/duration + callbacks for controlled mode.
| Prop | Type | Description |
|---|---|---|
src | string | Video URL. Drives a real <video>. |
poster | string | ReactNode | Fallback shown only when no `src` is provided. |
controls | boolean | Show Diamond's built-in chrome (overlay play + bottom bar). Default true. |
objectFit | "cover" | "contain" | Default 'cover'. |
playsInline | boolean | Inline playback on iOS Safari. Default true. |
muted / volume / loop / autoPlay / preload | — | All mapped onto the native element. |
Variant-specific props
- live —
liveCountshows e.g. "2.4k watching" in the corner. - rec —
recordingtoggles the REC pulse,tagrenders top-right metadata (e.g. "4K · 60FPS"). - editorial — pair
title+subtitleover a gradient mask. - portrait — pass
sideActions({ id, icon, onClick?, label? }[]) for vertical react / comment / share buttons. - accent —
speedsdrives the speed switcher; each entry can have arate(multiplier applied toplaybackRate). UsedefaultSpeedIdoractiveSpeedId+onSpeedChange.
Fullscreen
Clicking the corner expander uses document.requestFullscreen on the carousel root — you don't need to wire anything. Works on desktop browsers; iOS Safari falls back to native video chrome.
Universal patterns
Every Diamond component shares the same prop conventions, so once you learn one you can predict the others.
variant— discriminated union of every visual option. Categories shown above are docs-only metadata; the prop is a flat string union.accent— any CSS color string. Overrides--diamond-accentjust for that instance via inlinestyle. Cascades into hover, ring, and selection states.asChild(when present) — renders the underlying primitive via@radix-ui/react-slot, letting you compose with<Link>,motion.button, etc.className— merged with internal Tailwind classes viacn(). Use it to override layout, spacing, or colors.- Native HTML attributes (
onClick,aria-*,data-*,ref, etc.) flow through to the root element without any whitelist. - Diamond is the skin: zero domain state, zero fetch, zero providers. You wire data and reactions in your app code; the components just render and emit events.