X Enterprises
nuxt-x-marketing

Modal

Modal components for video playback, image lightboxes, full-screen feature showcases, and floating chat prompts.

Modal

The modal suite covers four distinct use cases. XMarkModal is the low-level base component. XMarkModalVideo wraps it for media playback. XMarkModalImage provides a keyboard-navigable lightbox. XMarkModalChat is a floating chat prompt overlay. XMarkModalFeature presents an immersive full-screen feature story.

Components

<XMarkModal />

The base modal. Place your trigger in the default slot (a button or any element); the modal opens on click. Use the content slot for the modal body and the footer slot for a bottom bar. Exposes open and close events and a close function via the content slot.

<XMarkModal
  title="Custom Modal"
  description="Subtitle shown in the footer bar"
  size="2xl"
  :dark="true"
>
  <!-- Trigger -->
  <UButton label="Open Modal" />

  <!-- Content -->
  <template #content="{ close }">
    <div class="p-8">
      <p>Your modal content here.</p>
      <UButton @click="close">Close</UButton>
    </div>
  </template>
</XMarkModal>

Props

PropTypeDefaultDescription
titleString''Title shown in the modal footer bar
descriptionString''Description shown in the modal footer bar
sizeString'4xl'Modal width: 'sm' through '7xl', 'full'
fullscreenBooleanfalseUse fullscreen modal
darkBooleantrueDark mode for the modal chrome (affects close button)
paddingString'p-0'Body padding class

Slots

SlotDescription
defaultTrigger element
contentModal body — receives { close }
footerOverride the footer bar

Events

EventDescription
openModal opened
closeModal closed

<XMarkModalVideo />

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.

<!-- 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 exampleVideo URL (YouTube, Vimeo, or direct .mp4)
thumbnailString''Thumbnail image URL — renders as play-button trigger
posterString''Poster image for direct video files
titleString''Title shown in modal footer
descriptionString''Description shown in modal footer
sizeString'4xl'Modal size
autoplayBooleantrueAutoplay video when modal opens
buttonObject{}Default trigger button config { label, color?, variant?, icon?, size? }

<XMarkModalImage />

A full-screen image lightbox (rendered via Teleport to body). Navigate a gallery with arrow buttons or keyboard. Shows an image counter and optional thumbnail navigation strip.

<template>
  <button @click="lightboxOpen = true">
    <img src="/gallery/photo-1.jpg" class="cursor-zoom-in" />
  </button>

  <XMarkModalImage
    v-model="lightboxOpen"
    :images="[
      { src: '/gallery/photo-1.jpg', alt: 'Interior view', caption: 'Open-plan living area' },
      { src: '/gallery/photo-2.jpg', alt: 'Kitchen', caption: 'Modern kitchen' },
      { src: '/gallery/photo-3.jpg', alt: 'Bedroom' },
    ]"
    :start-index="0"
    :has-counter="true"
    :has-thumbnails="true"
  />
</template>

Props

PropTypeDefaultDescription
modelValueBooleanfalseLightbox open state (v-model)
imagesArray[]Image list [{ src, alt, caption? }]
startIndexNumber0Index of the first image to show
hasCounterBooleantrueShow "1 / N" counter
hasThumbnailsBooleanfalseShow thumbnail strip at bottom

<XMarkModalChat />

A floating chat-prompt widget fixed to the bottom-right of the screen. Appears after delay milliseconds and auto-dismisses after autoDismiss ms (0 = never). Toggle visibility with v-model. Emits action when the CTA button is clicked.

<XMarkModalChat
  v-model="chatOpen"
  name="Alex from Support"
  message="Hi there! 👋 Have questions about our pricing? I'm here to help."
  avatar="/avatars/alex.jpg"
  :online="true"
  action-text="Start a conversation"
  :delay="4000"
  :auto-dismiss="0"
  @action="openIntercom"
  @dismiss="chatOpen = false"
/>

Props

PropTypeDefaultDescription
modelValueBooleanfalseVisibility (v-model)
avatarString''Avatar image URL
nameString'Support'Agent or bot name
messageStringDefault greetingChat message text
onlineBooleantrueShow green online indicator
actionTextString''CTA button label (hidden when empty)
autoDismissNumber0Auto-dismiss after N ms (0 = never)
delayNumber3000Delay before showing (ms)

Events

EventDescription
update:modelValuev-model sync
actionCTA button clicked
dismissWidget dismissed

<XMarkModalFeature />

A full-screen immersive modal for long-form feature storytelling. Accepts a hero section, an array of scrollable blocks (type image, text, or split), and a closing cta section. Triggered by a slot element or a default button.

<XMarkModalFeature
  :hero="{
    image: '/features/hero.jpg',
    title: 'Introducing Spaces',
    subtitle: 'A new way to organize your work',
  }"
  :blocks="[
    { type: 'text', title: 'Focus on what matters', body: 'Spaces help teams...' },
    { type: 'split', image: '/features/split.jpg', title: 'Side by side', body: 'Work together...', features: ['Real-time sync', 'Version history'] },
    { type: 'image', image: '/features/full.jpg', alt: 'Full product view' },
  ]"
  :cta="{
    title: 'Ready to try Spaces?',
    subtitle: 'Available on all plans.',
    button: { label: 'Get Started', color: 'primary' },
  }"
  :button="{ label: 'Learn More', icon: 'i-lucide-arrow-right' }"
/>

Props

PropTypeDefaultDescription
heroObjectnullHero config { image, title, subtitle? }
blocksArray[]Content blocks [{ type: 'image'|'text'|'split', ... }]
ctaObjectnullClosing CTA { title, subtitle?, button?: { label, color? } }
buttonObject{}Default trigger button config

AI Context

category: Modal
package: "@xenterprises/nuxt-x-marketing"
components:
  - XMarkModal
  - XMarkModalVideo
  - XMarkModalImage
  - XMarkModalChat
  - XMarkModalFeature
use-when: >
  Presenting media or content without navigating away from the current page.
  Use Video for demo/explainer videos, Image for galleries, Chat for
  support prompts, Feature for detailed product storytelling, and the base
  Modal for any custom dialog.
typical-page-section: >
  Video/Feature: triggered from hero or features section.
  Image: triggered from gallery or media sections.
  Chat: persistent overlay on key conversion pages.
  Modal: anywhere a dialog is needed.
Copyright © 2026