AnimationsProNew

Animated Beam

A pulse of light travels along a line between two elements. Great for showing integrations and data flow.

Customize

pathColor
gradientStartColor
gradientStopColor

Based on Animated Beam (MIT license) · Terms of use

Props

19 properties
PropertyTypeDefaultDescription
containerRefRefObject<HTMLElement | null>—Ref to the shared container the beam is drawn in.
fromRefRefObject<HTMLElement | null>—Ref to the element the beam starts from.
toRefRefObject<HTMLElement | null>—Ref to the element the beam ends at.
curvaturenumber0Curve of the line in pixels. Negative bends it up.
durationnumber5Seconds for one pass of light.
delaynumber0Delay before start, in seconds.
reversebooleanfalseRun the light the other way.
pathColorstring"#ffffff"Color of the static line.
pathWidthnumber2Line width in pixels.
pathOpacitynumber0.2Opacity of the static line.
gradientStartColorstring"#ffffff"Color at the head of the moving light.
gradientStopColorstring"#a1a1aa"Color at the tail of the moving light.
repeatnumber"Infinity"How many times to repeat. Infinite by default.
repeatDelaynumber0Pause between repeats, in seconds.
startXOffsetnumber0Horizontal offset of the start, in pixels.
startYOffsetnumber0Vertical offset of the start, in pixels.
endXOffsetnumber0Horizontal offset of the end, in pixels.
endYOffsetnumber0Vertical offset of the end, in pixels.
classNamestring—Classes for the SVG layer.

Dependencies

3 required packages

npm install motion clsx tailwind-merge

Related components

View all