Installation
Usage
Examples
Basic Video Dialog
From Bottom Animation
Fade Animation
Vimeo Video
Props
The URL of the video to display. Supports YouTube, Vimeo, and other embeddable video sources.
The URL of the thumbnail image to display before the video opens.
Alt text for the thumbnail image for accessibility.
The animation style for the video dialog entrance and exit.Available options:
"from-bottom"- Slides in from bottom"from-center"- Scales from center (default)"from-top"- Slides in from top"from-left"- Slides in from left"from-right"- Slides in from right"fade"- Simple fade effect"top-in-bottom-out"- Slides in from top, exits to bottom"left-in-right-out"- Slides in from left, exits to right
Additional CSS classes to apply to the component wrapper.
Features
- Smooth animated entrance and exit effects
- Multiple animation style options
- Play button overlay on thumbnail
- Hover effects on thumbnail and play button
- Full-screen modal dialog
- Backdrop blur effect
- Close button with keyboard support (Escape, Enter, Space)
- Click outside to close
- Responsive design with mobile support
- Embedded iframe for video playback
Keyboard Shortcuts
Escape- Close the video dialogEnter- Close the video dialogSpace- Close the video dialog
Animation Details
The component uses spring physics for smooth, natural animations:- Damping: 30
- Stiffness: 300
Dependencies
- motion-sv (for animations and
AnimatePresence) - @lucide/svelte (for icons)
Accessibility
- Thumbnail image includes alt text
- Play button has aria-label
- Keyboard navigation support
- Focus management for modal dialog