- Location:
sabo/src/components/ui/animated-beam.tsx
The preview shows a simplified version. The actual component dynamically draws an SVG path between two elements within a container using React refs.
When to use
- Draw attention to relationships or flows between elements.
- Use decoratively; avoid covering critical content.
Usage
sabo/src/components/ui/animated-beam.tsx
Key props
Reference to the container element that holds the beam’s coordinate system.
Reference to the starting element where the beam originates.
Reference to the target element where the beam points.
Controls the curve of the beam path. Higher values create more pronounced curves.
Reverses the gradient direction of the beam animation.
Animation duration in seconds (randomized by default).
Color of the beam’s path line.
Thickness of the beam’s path line in pixels.
Start color of the animated gradient beam.
End color of the animated gradient beam.
Styling tip
- Place inside a relatively positioned, rounded container; keep contrast subtle.
- Mark purely decorative instances with
aria-hidden="true".