Buttons Fancy Stable

GradientButton

.md

Dark button with a beam of light that travels around its border and casts a soft coloured glow inside the face; the glow brightens on hover

Preview

Installation

pnpm add fancy-ui-svelte
import { GradientButton } from 'fancy-ui-svelte'

Usage

svelte
<script lang="ts">
  import { GradientButton } from 'fancy-ui-svelte';
</script>

<GradientButton />

Examples

Basic Usage

Custom Colors

Change the gradient colors.

Border Width & Blur

Adjust thickness and softness.

Animation Speed

Control the rotation speed.

Border Radius

Change the button shape.

Background Color

Set the content area background.

Interactive Playground

Props

PropTypeDefaultDescription
colors string[]["#34d399","#22d3ee","#6366f1","#d946ef","#f43f5e","#f59e0b"]Colours of the beam, spread along its arc
duration number3000Time for the beam to travel once around the button, in milliseconds
borderWidth number1.5Width of the lit border in pixels
borderRadius number12Border radius in pixels
blur number4Softness of the glow the beam casts inside the button, in pixels
bgColor string"#161616"Background color of the button face
sound booleanfalsePlays the press cue on activation, once the user has enabled sound

Slots

SlotDescription
childrenButton content