For Tailwind CSS v3 docs, click here.

光线边框

A stylish animated border beam effect with customizable size, duration, colors, and delay.

通过 CLI 安装

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

手动安装

复制并粘贴以下代码:

BorderBeam.vue

API

Prop 名称类型默认值描述
classstring""Additional CSS classes for custom styling.
sizenumber200Size of the animated border beam effect.
durationnumber15Duration of the animation in seconds.
borderWidthnumber1.5Width of the border around the beam effect.
anchornumber90Anchor point for the beam, determining its position along the border.
colorFromstring"#ffaa40"Starting color for the gradient of the beam.
colorTostring"#9c40ff"Ending color for the gradient of the beam.
delaynumber0Delay before the animation starts, in seconds.

功能特性

  • Animated Border Beam: Adds a dynamic border beam effect that animates around the border.
  • Customizable Gradient Colors: Adjust the colorFrom and colorTo props to create a gradient effect that suits your design.
  • Flexible Animation Settings: Control the size, duration, and delay of the animation to fine-tune the visual experience.
  • Anchor Positioning: Use the anchor prop to set the starting position of the beam along the border.

感谢