Components/Effects
A beam of light that travels around any element's border.
Build #2841
main · 4f2a91cCompiling 214 modules
Started 38s ago by @aadi
Installation#
npx shadcn@latest add https://get-neonkit.vercel.app/r/border-beam.jsonUsage#
import { BorderBeam } from "@/components/ui/border-beam"
<BorderBeam colorTo="magenta" className="rounded-2xl border border-white/10 p-6">
Anything
</BorderBeam>Examples#
Around a button
The beam takes its radius from the wrapper, so round it to match.
Speed, length, direction
Slow
duration 8 · size 90
Fast, reversed
duration 2.5 · size 160 · 2px
API reference#
BorderBeam
A div wrapper. Give it the same rounding as your content.
| Prop | Type | Default |
|---|---|---|
color | NeonColorHead of the beam. | inherited |
colorTo | NeonColorTail of the beam. | color |
duration | numberSeconds per lap. | 6 |
size | numberBeam length in degrees. | 90 |
borderWidth | numberThickness in pixels. | 1 |
reverse | booleanRun counter-clockwise. | false |
Accessibility#
- The beam is decorative and hidden from assistive tech.
- Uses CSS @property, supported in every current browser. With reduced motion the beam holds still.