WebberUI

Video Text

Text whose glyphs are filled with a playing background video, falling back to a self-contained animated gradient when no video is given.

Uses an SVG text mask to clip a video (or the built-in flowing gradient) into the glyph shapes. The larger and heavier the type, the more image area shows through and the stronger the effect.

Loading preview…
npx shadcn@latest add https://webberui.com/r/video-text.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

120
900
<VideoText />

Installation

npx shadcn@latest add https://webberui.com/r/video-text.json

Or, once registries are configured in components.json, install it as @webberui/video-text.

Usage

Put the component inside a bounded container with an explicit height; without a src it fills the text with the built-in animated gradient.

import { VideoText } from "@/components/ui/video-text";

<div className="relative h-[220px] w-full overflow-hidden rounded-xl bg-neutral-950">
  <VideoText text="WEBBER" className="h-full w-full" />
</div>

To fill it with a real video, pass src (a short muted, looping clip is recommended):

<VideoText
  text="OCEAN"
  src="/videos/waves.mp4"
  poster="/videos/waves.jpg"
  className="h-full w-full"
/>

Props

PropTypeDefaultDescription
textstringThe text to fill; short, bold words work best
srcstringundefinedVideo source; the built-in animated gradient is used when omitted
posterstringundefinedStatic frame image, shown under reduced motion or before loading
fontSizenumber0.78 × container heightFont size (px); scales automatically when unspecified
fontWeightnumber | string900Font weight
fontFamilystringsystem fontThe mask font; a system font is recommended to avoid missing glyphs
colorsstring[]pink / indigo / tealColors of the built-in gradient fill (used when there is no src)

Accessibility

  • The complete text is exposed sr-only for assistive technology to announce, and everything inside the mask is aria-hidden
  • When the user has "reduce motion" enabled, the video pauses on its first frame and the built-in gradient draws a single static frame
  • The mask SVG is generated from the container's actual pixel size, so glyphs and imagery align 1:1 and do not distort when scaled

On this page