RemotionUI

Text Mask Video

Play video, a still, or a gradient inside letterforms, with a wipe reveal. Install with npx remotion-ui@latest add text-mask-video.

PrimitivePrimitivesAdvanced

text-mask-video30fps · 960×540
Install
$ npx remotion-ui@latest add text-mask-video

Media seen through a word.

import { staticFile } from "remotion";
import { TextMaskVideo } from "@/remotion/primitives/text-mask-video";

<TextMaskVideo
  text={"IN\nMOTION"}
  src={staticFile("clips/skyline.mp4")}
  fontSize={172}
  fontWeight={900}
  reveal="left"
/>

Why a clip path, not background-clip

background-clip: text only takes a paint, so it can carry a gradient and it can carry an image, but it can never carry a video. Clipping a real element with an SVG clipPath of <text> means one code path covers all three: the media underneath is a normal <OffthreadVideo> that seeks and trims like any other.

Set media explicitly to force a mode. It defaults to video when src is set and gradient when it is not.

The reveal is a second clip

One element gets one clip-path, so the wipe lives on a child of the letter-clipped layer. reveal takes left, right, up, down or none, runs on the entrance and unwinds on the exit.

Sizing

width and height are the clip's coordinate space and the type is positioned inside it arithmetically. Nothing is measured: a measured layout renders one thing on frame 0 of a headless render and another on frame 1. Both default to multiples of fontSize; set them when the copy is long.

Footage almost always needs lifting

A clip that reads fine full-frame is usually too dark once it is only visible inside letterforms. mediaFilter takes any CSS filter — brightness(2.2) saturate(1.5) is a reasonable starting point for night footage.

An SVG clipPath on a real element, not `background-clip: text` — that only takes a paint, so it can never carry a video.

Agent notes

Install first, then import the copied source component locally. AI guide →

Import
@/remotion/primitives/text-mask-video
  • Use when: frame-level motion primitives and reusable animation wrappers.
  • Customize: text, src, media, gradient, plus copied source for timing, layout, colors, and typography.
  • Rule: do not import this component from the remotion-ui npm package; it is copied into your project.

Usage

Example
import { staticFile } from "remotion"; import { TextMaskVideo } from "@/remotion/primitives/text-mask-video"; <TextMaskVideo text={"IN\nMOTION"} src={staticFile("clips/skyline.mp4")} fontSize={172} fontWeight={900} />

API Reference

PropTypeDescription
textstringThe letterforms the media is seen through. `\n` breaks a line.
srcstringVideo or image source. Wrap local files in `staticFile()`.
media"video" | "image" | "gradient"Which layer is drawn behind the letters.
gradientstringAny CSS background, used by `media="gradient"`.
mediaFilterstringCSS filter on the media. Footage is usually too dark inside letterforms.
reveal"left" | "right" | "up" | "down" | "none"Which way the letters are uncovered.
widthnumberClip coordinate space. Defaults to a multiple of `fontSize`.
heightnumberClip coordinate space. Defaults from the line count.
driftnumberPeak sideways travel of the media, in px.
zoomnumberExtra scale the media breathes through. 0 holds it still.
startFromnumberFrame offset into the video.
durationInFramesnumberLength of the reveal.
delayInFramesnumberFrames before the reveal starts.
exitAtInFramesnumberFrame the reveal starts unwinding on.

Related

On this page