Text Video Mask
Large typography where a playing video is visible only inside the glyphs. The type is a true mask cutout — counters and holes included — over one continuous footage surface that keeps playing while the letters stay still.
Installation#
pnpm dlx shadcn@latest add @davinciui/text-video-maskUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
textText revealed as cutouts in the video. Supports multiline via \n. | string | "DAVINCI." |
srcVideo source — uploaded asset URL or remote .mp4/.webm URL. | string | "" |
fontFamilyFont family baked into the mask texture. | string | "Anton" |
fontSizeBase type size in px. Exact in fixed mode, maximum in fit mode. | number | 200 |
fontWeightFont weight baked into the mask texture. | number | string | 800 |
fontStyleFont style baked into the mask texture. | "normal" | "italic" | "normal" |
lineHeightLine-height multiplier for multiline text. | number | 1 |
letterSpacingTracking in px between characters. | number | 0 |
textAlignHorizontal alignment of the text block. | "left" | "center" | "right" | "center" |
verticalAlignVertical alignment of the text block. | "top" | "center" | "bottom" | "center" |
textSizingFixed uses fontSize; fit scales down to fit the padded width. | "fixed" | "fit" | "fit" |
horizontalPaddingHorizontal inset in px, respected by alignment and fit mode. | number | 24 |
verticalPaddingVertical inset in px, respected by vertical alignment. | number | 24 |
autoplayStart playback automatically. Falls back to muted on policy blocks. | boolean | true |
loopLoop the footage. | boolean | true |
mutedMute the footage (required for autoplay in most browsers). | boolean | true |
playsInlineAllow inline playback on iOS Safari. | boolean | true |
controlsShow native browser video controls. | boolean | false |
videoFitHow the footage fills the component (object-fit). | "cover" | "contain" | "fill" | "cover" |
positionXFootage focal point, 0–100 (object-position X). | number | 50 |
positionYFootage focal point, 0–100 (object-position Y). | number | 50 |
preloadVideo preload hint. | "none" | "metadata" | "auto" | "metadata" |
backgroundColorFills the component; video never appears outside the glyphs. | string | "#000000" |
fallbackColorSolid glyph color when video is unavailable or reduced-motion. | string | "#ffffff" |
reducedMotionFallback renders solid type; paused shows the video paused. | "fallback" | "paused" | "fallback" |
classNameAdditional classes for the outer container. | string | — |
styleAdditional inline styles for the outer container. | React.CSSProperties | — |
Accessibility#
The root exposes role=img with aria-label equal to the text, and the video and mask layers are aria-hidden. With controls enabled those native controls remain hidden from assistive tech and keyboard users.
Motion#
Video playback animates, not CSS; autoplay, loop, muted, and preload props control it, with no timing or easing props. It listens to prefers-reduced-motion and either shows the solid fallback or pauses, per reducedMotion.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

