Gradient Button

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

API

Prop NameTypeDefaultDescription
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.

Component Code

You can copy and paste the following code to create this component:

GradientButton.vue

Features

  • 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.