For Tailwind CSS v3 docs, click here.

视频文字

一个带有视频背景的文本组件。

通过 CLI 安装

npm
pnpm
bun
yarn
npx shadcn-vue@latest add "https://registry.inspira-ui.com/video-text.json"

手动安装

复制并粘贴以下代码:

VideoText.vue

API

Prop 名称类型默认值描述
srcstringRequiredThe video source URL.
classstring""Additional classes 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 | number"120"Font 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.

感谢