Velora UI

Animated Beam

Draws an animated connection between any two elements.

  • 1.5 KB gzipped
  • Deps: motion/react
  • Reduced-motion safe
  • Base UI & Radix compatible
Open in v0

Preview

Installation

pnpm dlx shadcn@latest add https://velora.colorlib.com/r/animated-beam.json

Adds components/velora/animated-beam.tsx, installs motion.

Props

PropTypeDefault
containerRef*RefObject<HTMLElement | null>—
fromRef*RefObject<HTMLElement | null>—
toRef*RefObject<HTMLElement | null>—
curvature

Vertical bend of the beam in px (positive bends up)

number0
reversebooleanfalse
durationnumber5
delaynumber0
pathWidthnumber2
pathOpacitynumber0.15
gradientStartColorstring"#8b5cf6"
gradientStopColorstring"#22d3ee"
classNamestring—

Accessibility

Reduced motion
The pulse stops; each connection shows a still gradient stroke along the full path.
Keyboard
Decorative — nothing to operate.
Screen readers
Decorative; the svg is aria-hidden.