Skip to main content

Installation

    Examples

    Animated Beam Uni-Directional

    Animated Beam Bi-Directional

    Animated Beam Multiple Inputs

    Animated Beam Multiple Outputs

    Usage

    showLineNumbers
    import { AnimatedBeam } from "@/components/ui/animated-beam"
    
    showLineNumbers
    <AnimatedBeam containerRef={containerRef} fromRef={fromRef} toRef={toRef} />
    

    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!

    Build docs developers (and LLMs) love