Introducing Magic UI Pro - 50+ blocks and templates to build beautiful landing pages in minutes.

Command Palette

Search for a command to run...

Docs
Video Text

Video Text

A text component with a video background.

OCEAN

Installation

Usage

import { VideoText } from "@/registry/magicui/video-text";
<div className="relative h-[500px] w-full overflow-hidden">
  <VideoText src="https://cdn.magicui.design/ocean-small.webm">OCEAN</VideoText>
</div>

Props

PropTypeDefaultDescription
srcstringRequiredThe video source URL
asElementType"div"The element type to render for the text
childrenReactNodeRequiredThe content to display (will have the video "inside" it)
classNamestring""Additional className for the container
autoPlaybooleantrueWhether to autoplay the video
mutedbooleantrueWhether to mute the video
loopbooleantrueWhether to loop the video
preload"auto" | "metadata" | "none""auto"Whether to preload the video
fontSizestring | number"120"Font size for the text mask
fontWeightstring | number"bold"Font weight for the text mask
textAnchorstring"middle"Text anchor for the text mask
dominantBaselinestring"middle"Dominant baseline for the text mask
fontFamilystring"sans-serif"Font family for the text mask