Skip to main content
ParticleUI

Animated Beam

Pro

SVG curved beam that animates between two ref'd elements. Used to visualise data flow in hero sections. Configurable curvature, speed, gradient colors, and direction.

Pro component — requires an active license. Get access →

🤖
💡

Installation

1

Add your token to .env

Get a token from your dashboard, then add it to .env:

bash
PARTICLEUI_TOKEN=your-token-here
2

Add the registry to components.json

Wire up the authenticated registry so the CLI can resolve Pro components:

bash
"registries": {
  "@particleui": {
    "url": "https://particleui.dev/r/react/{name}.json",
    "headers": { "Authorization": "Bearer ${PARTICLEUI_TOKEN}" }
  }
}
3

Run the CLI

bash
npx particleui-cli add animated-beam

Usage

TSX
"use client"
import { useRef } from "react"
import { AnimatedBeam } from "@/components/ui/animated-beam"

export default function Example() {
  const containerRef = useRef<HTMLDivElement>(null)
  const fromRef = useRef<HTMLDivElement>(null)
  const toRef = useRef<HTMLDivElement>(null)

  return (
    <div ref={containerRef} className="relative flex items-center justify-between px-12 py-8">
      <div ref={fromRef} className="h-12 w-12 rounded-full border bg-card flex items-center justify-center">
        🤖
      </div>
      <div ref={toRef} className="h-12 w-12 rounded-full border bg-card flex items-center justify-center">
        💡
      </div>
      <AnimatedBeam containerRef={containerRef} fromRef={fromRef} toRef={toRef} />
    </div>
  )
}

Props

PropTypeDefaultRequired
containerRefReact.RefObject<HTMLElement | null>yes
fromRefReact.RefObject<HTMLElement | null>yes
toRefReact.RefObject<HTMLElement | null>yes
colorstring"oklch(78% 0.17 200)"no
durationnumber3no
delaynumber0no
curvaturenumber0no
reversebooleanfalseno
pathWidthnumber2no
pathOpacitynumber0.2no
gradientStartColorstring"oklch(78% 0.17 200)"no
gradientStopColorstring"oklch(78% 0.17 280)"no
classNamestringno
startXOffsetnumber0no
startYOffsetnumber0no
endXOffsetnumber0no
endYOffsetnumber0no

Details

Source filecomponents/ui/animated-beam.tsx
Typeui
Categoriesanimations
npm dependencies
Registry deps
Claude skill