Video Text

A text component with a video background.

runed
OCEAN

Installation

pnpm dlx shadcn-svelte@latest add https://sv-animations.vercel.app/r/video-text.json

Usage

<script lang="ts">	import { VideoText } from "#lib/components/magic/video-text/index.js";</script>
<div class="h-48 overflow-hidden">	<VideoText src="https://cdn.magicui.design/ocean-small.webm" content="OCEAN" /></div>

Props

Video Text

A component for Video Text.

NameTypeDefaultDescription
classClassValue""Additional CSS classes to apply
srcstringSource URL of the video
contentstringText content to display
autoPlaybooleantrueWhether to autoplay the video
mutedbooleantrueWhether to mute the video
loopbooleantrueWhether to loop the video
preload"auto" | "metadata" | "none""auto"Preload behavior of the video
fontSizestring | number20Font size of the text
fontWeightstring | number"bold"Font weight of the text
textAnchorstring"middle"Text anchor alignment
dominantBaselinestring"middle"Dominant baseline alignment
fontFamilystring"sans-serif"Font family of the text