For Tailwind CSS v3 docs, click here.

波浪背景

一个酷炫的波浪背景效果。

通过 CLI 安装

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

手动安装

Install the dependencies

npm
pnpm
bun
yarn
npm install simplex-noise

复制并粘贴以下代码:

WavyBackground.vue

API

Prop 名称类型默认值描述
classstring-The content to be displayed on top of the wavy background.
containerClassstring-The CSS class to apply to the content container.
colorsstring[]["#38bdf8", "#818cf8", "#c084fc", "#e879f9", "#22d3ee"]The colors of the waves.
waveWidthnumber50The width of the waves.
backgroundFillstring"black"The background color.
blurnumber10The blur effect applied to the waves.
speed"slow" | "fast""fast"Range of speed variation for particles.
waveOpacitynumber0.5Base radius of particles.
[key: string]any-Range of radius variation for particles.

功能特性

  • Slot Support: Easily add any content inside the component using the default slot.

感谢