Skip to main content

Installation

    Usage

    showLineNumbers
    import { VideoText } from "@/registry/magicui/video-text"
    
    showLineNumbers
    <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 | number20Font 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

    Build docs developers (and LLMs) love