Border Beam
A highly performant, zero-dependency React component that adds a sleek, animated glowing beam to the border of any container. Built using a native CSS conic-gradient and mask-composite for 60fps hardware-accelerated rendering without Framer Motion or Tailwind.
Preview
Bare UI
Installation
1. Copy the component
2. Add the CSS
Add this to your global CSS file. It uses native CSS masking and animations.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| size | number | 200 | The size of the beam in pixels. |
| duration | number | 4 | The duration of one full rotation in seconds. |
| borderWidth | number | 2 | The thickness of the border in pixels. |
| colorFrom | string | "var(--accent)" | The starting color of the beam gradient. |
| colorTo | string | "transparent" | The ending color of the beam gradient. |