import { Video } from "@elabs-ai/components-ui";npm install @elabs-ai/components-tokens @elabs-ai/components-uiPaste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui Video component (from @elabs-ai/components-ui) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look Video up before writing code: `npx -y @elabs-ai/components-cli docs Video` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-ui is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Avoid
- `autoPlay` with sound — autoplay only `muted` (hero loops).
- A black letterbox literal — the ground is `bg-muted`.
- Captionless video — pass a `tracks` captions entry; thumbnails are `aria-hidden`.
Works with
Examples
Basic
Recipe: play and the clock — nothing else.
Full Bar
Recipe: the full bar — seek, duration, mute and volume (the default composition).
Muted Autoplay Loop
Recipe: a hero embed — muted, autoplaying, looping, no controls, not focusable.
Poster Fullscreen
Recipe: poster frame plus a full-screen button.
Playback Rate
Recipe: a playback-speed menu.
Poster
Recipe: a poster frame before playback, no aspect ratio — the video sizes the box.
Seek Controls
Recipe: seek backward / forward buttons around play.
Volume Range
Recipe: mute plus a volume slider.
Overlay
Controls float over the video and fade out while it plays and the pointer rests.
Thumbnail
A decorative thumbnail (attachments): no controls, muted, cropped, hidden from AT.
Keyboard
Error
A source the browser cannot decode: the error panel covers the viewport.
API
MediaPlayer
| Prop | Type | Description |
|---|---|---|
kindrequired | MediaKind | Which element `MediaPlayerElement` renders. |
label | string | The region's accessible name. Default "Audio player" / "Video player". |
keyboardShortcuts | boolean | Handle the player keyboard map (Space/k, ←/→, j/l, ↑/↓, m, f, 0–9). Default `true`. |
MediaPlayerViewport
| Prop | Type | Description |
|---|---|---|
aspectRatio | number | Width ÷ height. Omit to size by the video's intrinsic dimensions. |
MediaPlayerControls
Theming
The tokens each state resolves to. Change the token and every theme follows.
| State | Token |
|---|---|
| surface | rounded-lg border bg-card shadow-xs (resting surface); bg-muted letterbox |
| controls | docked: bg-background row · overlay: bg-background/80 backdrop-blur, hides via data-controls |
| loading | Skeleton before metadata (no poster); spinner disc while buffering |