For Tailwind CSS v3 docs, click here.

Gradient Button

A stylish animated button with a rotating conic gradient border and customizable properties for a vibrant look.

通过 CLI 安装

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

手动安装

复制并粘贴以下代码:

GradientButton.vue

API

Prop 名称类型默认值描述
borderWidthnumber2Width of the gradient border in pixels.
colorsstring[]Rainbow Colors ArrayArray of colors used in the conic gradient border.
durationnumber2500Duration of the gradient rotation animation in milliseconds.
borderRadiusnumber8Border radius for rounded corners in pixels.
blurnumber4Blur intensity of the gradient border effect in pixels.
classstring""Additional CSS classes for custom styling.
bgColorstring"#000"Background color of the button content.

功能特性

  • Rotating Conic Gradient Border: A dynamic, rotating conic gradient border creates a visually engaging effect.
  • Customizable Color Palette: Customize the gradient colors by providing an array of color values.
  • Flexible Styling Options: Adjust border width, border radius, and blur effect for a tailored look.
  • Slot-Based Content: Supports a default slot to easily add button content or icons.
  • Smooth Animation Control: Control the speed of the rotation using the duration prop.