For Tailwind CSS v3 docs, click here.

Text Hover Effect

A text hover effect that animates and outlines gradient on hover, as seen on x.ai

通过 CLI 安装

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

手动安装

复制并粘贴以下代码:

TextHoverEffect.vue

API

Prop 名称类型默认值描述
textstringRequiredThe text to be displayed with the hover effect.
durationnumber200The duration of the mask transition animation in seconds.
strokeWidthnumber0.75The width of the text stroke.
opacitynumbernullThe opacity of the text.