Introducing Magic UI Pro - 50+ blocks and templates to build beautiful landing pages in minutes.


Docs
Animated Beam

Animated Beam

An animated beam of light which travels along a path. Useful for showcasing the "integration" features of a website.

Installation

npx shadcn@latest add "https://magicui.design/r/animated-beam"

Examples

Animated Beam Uni-Directional

Animated Beam Bi-Directional

Animated Beam Multiple Inputs

Animated Beam Multiple Outputs

Props

Animated Beam

PropTypeDefaultDescription
classNamestring-The class name for the component.
containerRefref-The container ref.
fromRefref-The ref of the element from which the beam should start.
toRefref-The ref of the element to which the beam should end.
curvaturenumber0The curvature of the beam.
reversebooleanfalseWhether the beam should be reversed.
durationnumber5The duration of the beam.
delaynumber0The delay of the beam.
pathColorstringgrayThe color of the beam.
pathWidthnumber2The width of the beam.
pathOpacitynumber0.2The opacity of the beam.
gradientStartColorstring#ffaa40The start color of the gradient.
gradientStopColorstring#9c40ffThe stop color of the gradient.
startXOffsetnumber0The start x offset of the beam.
startYOffsetnumber0The start y offset of the beam.
endXOffsetnumber0The end x offset of the beam.
endYOffsetnumber0The end y offset of the beam.

Credits

  • Credit to @itsarghyadas for figuring out the foundation of this!