GuideGetting Started
Shadcn Installation Guide
Use the Video.js Shadcn registry to add editable React or HTML custom-element skin source to your project
Use Shadcn to add a Video.js skin's components, layout, styles, and interactions as React or HTML custom-element source. The CLI copies the files into your app so you can review and change them like any other source code.
AI Quickstart
Paste this prompt into your coding agent:
Install the Video.js skill using one method. In Codex, run `codex plugin marketplace add videojs/skills`, then `codex plugin add videojs@videojs`, and start a new session. In Claude Code, run `claude plugin marketplace add videojs/skills`, then `claude plugin install videojs@videojs`, and start a new session or run `/reload-plugins`. In VS Code or Cursor, install `https://github.com/videojs/skills` as a plugin from source. For another agent, run `npx skills add https://github.com/videojs/skills --skill videojs` and select the agent. Then use the Video.js skill when working on this project.Choose your JS framework
Your framework determines which installation methods are available below.
- React: Components and hooks for React 19. Available methods: Packaged, Shadcn.
- HTML: Custom elements for any stack. Available methods: Packaged, Shadcn, CDN.
- Vue: Vue 3 and Nuxt using the HTML custom elements. Available methods: Packaged, Shadcn.
- Svelte: Svelte 5 and SvelteKit using the HTML custom elements. Available methods: Packaged, Shadcn.
The Shadcn registry generates React or HTML source. Vue and Svelte can use the HTML custom-element source.
- React (
react)- Project templates: Next.js (
next), Vite (vite), TanStack Start (start), Laravel (laravel), React Router (react-router), Astro (astro) - Styling: Tailwind CSS (
tailwind), Vanilla CSS (css)
- Project templates: Next.js (
- HTML (
html)- Project templates: Vite (
vite), Astro (astro), Laravel (laravel) - Styling: Vanilla CSS (
css)
- Project templates: Vite (
Choose your use case
- Video (
video): On-demand video with full controls. - Audio (
audio): Podcasts, music, and audio-only playback. - Live Video (
live-video): Streams with a Live button, no duration. - Live Audio (
live-audio): Live radio and audio streams.
The live presets suit streams: they drop the duration and current-time displays that on-demand playback relies on, and they offer only media that exposes live-edge state.
Choose your skin
- Default (
default): the complete control set with a modern, frosted look. - Minimal (
minimal): the same control set with clean, solid surfaces.
Shadcn copies either the Default or Minimal skin source into the project. It does not currently provide the background video skin or a no-skin option.
Choose your media source
Available media sources depend on the use case:
| Media source | Use cases | React component | HTML element | Adapter package |
|---|---|---|---|---|
HTML5 Video (html5-video) | Video | Video | <video> | None |
HLS (hls) | Video, Live Video | HlsJsVideo | <hlsjs-video> | @videojs/hlsjs-video |
DASH (dash) | Video | DashVideo | <dash-video> | @videojs/dash-video |
Mux (mux-video) | Video, Live Video | MuxVideo | <mux-video> | @videojs/mux-video |
Vimeo (vimeo) | Video | VimeoVideo | <vimeo-video> | @videojs/vimeo-video |
YouTube (youtube) | Video | YouTubeVideo | <youtube-video> | @videojs/youtube-video |
Cloudflare Stream (cloudflare) | Video | CloudflareVideo | <cloudflare-video> | @videojs/cloudflare-video |
TikTok (tiktok) | Video | TikTokVideo | <tiktok-video> | @videojs/tiktok-video |
Twitch (twitch) | Video | TwitchVideo | <twitch-video> | @videojs/twitch-video |
HTML5 Audio (html5-audio) | Audio | Audio | <audio> | None |
Mux (mux-audio) | Audio, Live Audio | MuxAudio | <mux-audio> | @videojs/mux-audio |
Spotify (spotify) | Audio | SpotifyAudio | <spotify-audio> | @videojs/spotify-audio |
HLS uses HlsJsVideo or <hlsjs-video> for broad compatibility. To reduce your bundle size, try our lightweight HLS engine, HlsVideo or <hls-video>.
The keys in parentheses are the values the docs CLI (npx @videojs/cli docs guides/installation/shadcn) accepts for its --framework, --template, --styling, --preset, --theme, and --media flags. Run noninteractively, it also needs --source-url (pass '' for demo media) and --package-manager (npm, pnpm, yarn, or bun).
Choose how to install
Pick one starting path. These are alternatives, not steps to run in sequence. Shadcn does not provide source for background video or a no-skin player. CDN availability also depends on the selected media source.
- Packaged (React or HTML): Install packages and use a ready-made skin.
- Shadcn: Add editable React or HTML skin source to your project.
- CDN: Load the HTML player from jsDelivr without a package manager or build step.
The steps below use the default Video, Default skin, and HTML5 Video choices with demo media. Each step notes what changes for other choices. Swap in the media component from its reference page linked above, and replace the demo URL with your own.
Choose your JS framework
Choose the JavaScript framework for your project.
Choose your use case
Choose the ready-made player that is closest to what you are building. The Shadcn registry does not currently provide the background video skin as source.
Choose your skin
Choose the skin source the CLI will add to your project. You can edit its components, layout, styles, and interactions.
Choose your media source
Choose what the player will play. If that source needs a playback adapter, the installation steps include it.
Optional. The URL also ends up in your generated code.
Choose how to install
Choose from the installation options available for your selections.
Initialize Shadcn
Run the commands from the app directory that contains components.json, or where you want the CLI to create it. In a monorepo, run them from the app workspace or pass --cwd <path>.
React
Project template
These commands initialize Shadcn with the Next.js template. For another project template, replace next with vite (Vite), start (TanStack Start), laravel (Laravel), react-router (React Router), or astro (Astro).
HTML
Project template
These commands initialize Shadcn with the Vite template. For another project template, replace vite with astro (Astro) or laravel (Laravel).
If the app already has components.json, skip this section.
Add the skin source
React skins can use Tailwind CSS 4 or Vanilla CSS. HTML skins use Vanilla CSS. Choose the styling that matches your app, then connect the Video.js registry and add the skin selected above.
React
Styling
These commands add the Default Video skin with Tailwind CSS. For another skin or styling, pass the matching catalog URL to registry add:
| Styling | Default skin (default) | Minimal skin (minimal) |
|---|---|---|
Tailwind CSS (tailwind) | https://shadcn.videojs.org/r/react/{name}.json | https://shadcn.videojs.org/r/react/minimal/{name}.json |
Vanilla CSS (css) | https://shadcn.videojs.org/r/react/css/{name}.json | https://shadcn.videojs.org/r/react/css/minimal/{name}.json |
Then add the item for your use case: @videojs/video, @videojs/audio, @videojs/live-video, or @videojs/live-audio.
The files are added under components/videojs/<preset>. The registry item also installs @videojs/react.
HTML
Styling
These commands add the Default Video skin with Vanilla CSS. For another skin or styling, pass the matching catalog URL to registry add:
| Styling | Default skin (default) | Minimal skin (minimal) |
|---|---|---|
Vanilla CSS (css) | https://shadcn.videojs.org/r/html/{name}.json | https://shadcn.videojs.org/r/html/minimal/{name}.json |
Then add the item for your use case: @videojs/video, @videojs/audio, @videojs/live-video, or @videojs/live-audio.
The files are added under components/videojs/<preset>. The registry item also installs @videojs/html.
Add your player
React
Add the player directly to app/page.tsx. It imports the player and media from the package, then imports the selected skin from your project.
HTML
The HTML source also works in Vue and Svelte. Follow the custom-element setup in the Vue guide or Svelte guide. In your component, import the installed skin.ts instead of a packaged skin, and place the updated skin.html markup inside the player. In Vue, include the tags from that markup in isCustomElement. The steps below show the plain HTML entry point.
Add the media element
In
components/videojs/video/skin.html, replace the “Add a compatible media element here” comment with:Register the custom elements
Create
src/player.tsand import the player, media, and installed skin:Add the player to your page
Paste the updated skin markup inside the player, then load the entry module:
That’s it! You now have a working Video.js player whose skin source lives in your project.
Change the skin source
React
Start in components/videojs/<preset>/skin.tsx. Follow the Customize skins guide for the files that control layout, colors, controls, and interactions.
HTML
Start in components/videojs/<preset>/skin.html. Follow the Customize skins guide for the files that control layout, colors, controls, and interactions.
