Skip to content

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

Choose the JavaScript framework for your project.

ReactComponents and hooks for React 19HTMLCustom elements for any stackVueVue 3 and Nuxt, using the custom elementsSvelteSvelte 5 and SvelteKit, using the custom elements

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.

VideoOn-demand video with full controlsAudioPodcasts, music, and audio-only playbackLive VideoStreams with a Live button, no durationLive AudioLive radio and audio streams

Choose your skin

Choose the skin source the CLI will add to your project. You can edit its components, layout, styles, and interactions.

DefaultComplete controls with a modern, frosted lookMinimalThe same controls with clean, solid surfaces
0:00
Video preset with the default skin, playing our demo media.

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.

HTML5 VideoMP4, WebM, and other file URLsHLSAdaptive .m3u8 streams via hls.jsDASHAdaptive .mpd streams via dash.jsMuxPlayback IDs with Mux Data built inVimeoVimeo videos and private linksYouTubeYouTube videos and shortsCloudflare StreamCloudflare Stream videosTikTokTikTok videosTwitchTwitch channels, videos, and clips
Drop a video to host it for free on MuxWe transcode it into an HLS stream and set it as your source above.orPowered by

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>.

Project template

npx shadcn@latest init --template next

Project template

npx shadcn@latest init --template vite

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.

Styling

npx shadcn@latest registry add @videojs=https://shadcn.videojs.org/r/react/{name}.json
npx shadcn@latest add @videojs/video

The files are added under components/videojs/<preset>. The registry item also installs @videojs/react.

Styling

npx shadcn@latest registry add @videojs=https://shadcn.videojs.org/r/html/{name}.json
npx shadcn@latest add @videojs/video

The files are added under components/videojs/<preset>. The registry item also installs @videojs/html.

Add your player

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.

import { VideoPlayer, Video } from '@videojs/react/video';
import { VideoSkin } from '@/components/videojs/video/skin';

export default function Page() {
  return (
    <VideoPlayer>
      <VideoSkin>
        <Video src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4" playsInline />
      </VideoSkin>
    </VideoPlayer>
  );
}

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.

  1. Add the media element

    In components/videojs/video/skin.html, replace the “Add a compatible media element here” comment with:

    <video src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4" playsinline></video>
  2. Register the custom elements

    Create src/player.ts and import the player, media, and installed skin:

    import '@videojs/html/video/player';
    import '@/components/videojs/video/skin';
  3. Add the player to your page

    Paste the updated skin markup inside the player, then load the entry module:

    <video-player>
      <!-- Paste the contents of components/videojs/video/skin.html here. -->
    </video-player>
    
    <script type="module" src="/src/player.ts"></script>

That’s it! You now have a working Video.js player whose skin source lives in your project.

Change the skin source

Start in components/videojs/<preset>/skin.tsx. Follow the Customize skins guide for the files that control layout, colors, controls, and interactions.

Start in components/videojs/<preset>/skin.html. Follow the Customize skins guide for the files that control layout, colors, controls, and interactions.

Choose what to do next