Effects Fancy Stable

AnimatedBeam

Animated SVG beams connecting elements with smooth gradients

Preview

Installation

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

Usage

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

<AnimatedBeam />

Examples

Basic Usage

Props

PropTypeDefaultDescription
containerRef *HTMLElement-Reference to the container element that holds both endpoints
fromRef *HTMLElement-Reference to the source element
toRef *HTMLElement-Reference to the destination element
curvature number0Vertical curvature of the beam path
reverse booleanfalseReverse the animation direction
pathColor string"gray"Color of the static background path
pathWidth number2Stroke width of the path
pathOpacity number0.2Opacity of the background path
gradientStartColor string"#FFAA40"Start color of the animated gradient
gradientStopColor string"#9C40FF"End color of the animated gradient
delay number0Animation delay in seconds
duration numberrandom 4-7Animation duration in seconds
startXOffset number0Horizontal offset for the start point
startYOffset number0Vertical offset for the start point
endXOffset number0Horizontal offset for the end point
endYOffset number0Vertical offset for the end point