X Enterprises
nuxt-x-marketing

ModalVideo

Video modal supporting YouTube, Vimeo, and direct video URLs with optional thumbnail trigger, autoplay, and captions.

ModalVideo

Opens a video in a modal. Supports YouTube, Vimeo, and direct video URLs — the embed type is detected automatically. Supply a thumbnail prop to show an image with a play button as the trigger, or place a custom trigger in the default slot. On close, direct <video> elements are paused automatically.

Components

<XMarkModalVideo />

<!-- YouTube with thumbnail trigger -->
<XMarkModalVideo
  src="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  thumbnail="/images/video-thumb.jpg"
  title="Product Demo"
  description="See how it works in 3 minutes"
  :autoplay="true"
  size="5xl"
/>

<!-- Button trigger -->
<XMarkModalVideo src="https://vimeo.com/123456789">
  <UButton label="Watch Demo" leading-icon="i-lucide-play" />
</XMarkModalVideo>

Props

PropTypeDefaultDescription
srcstringYouTube example URLVideo URL — YouTube (youtube.com/watch?v=, youtu.be/, embed/), Vimeo (vimeo.com/), or direct .mp4.
thumbnailstring''Thumbnail image URL — renders as a play-button trigger when set.
posterstring''Poster image for direct video files (ignored for YouTube/Vimeo embeds).
titlestring''Title shown in modal footer.
descriptionstring''Description shown in modal footer.
sizestring'4xl'Modal size: 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl', 'full'.
autoplaybooleantrueAutoplay video when modal opens. Forwarded as autoplay=1 param to embeds.
buttonobject{}Default trigger button config { label?, color?, variant?, size?, icon? }. Falls back to a primary "Watch Video" button with i-lucide-play icon.
captionsstring''Captions/subtitles file URL (direct video only).
captionsLangstring'en'Captions language code (srclang attribute).
captionsLabelstring'English'Captions track label.

Emits

EventDescription
openModal opened.
closeModal closed (direct videos are paused before this fires).

AI Context

category: Modal
package: "@xenterprises/nuxt-x-marketing"
components:
  - XMarkModalVideo
use-when: >
  Embedding a video demo or explainer that plays in a modal without
  navigating away from the page. Auto-detects YouTube, Vimeo, and direct
  video URLs. Supports captions for direct video files.
typical-page-section: Triggered from hero section, features section, or any demo CTA button.
Copyright © 2026