Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Animated Beam

Pro

Draws a curved line between two elements and sends a pulse of light along it.

Installation

pnpm dlx shadcn@latest add @viewport/animated-beam

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
containerRef*React.RefObject<HTMLElement | null>

The `relative` element both nodes live in.

—
fromRef*React.RefObject<HTMLElement | null>—
toRef*React.RefObject<HTMLElement | null>—
curvaturenumber

Bend of the curve in pixels. Negative bends the other way.

0
reversebooleanfalse
durationnumber3.2
delaynumber0
colorFromstring"var(--brand)"
colorTostring"var(--brand-3)"
classNamestring—

Accessibility

  • Decorative SVG is aria-hidden.
  • Recomputes on resize, so it stays attached at every breakpoint.
  • Shows the static path under reduced motion.