Border Beam
A beam of light that travels around a card border. Great for AI and SaaS surfaces.
utils
Pro planEverything in one place
Installation
$ pnpm dlx shadcn@latest add @soultel/border-beamNo namespace set up? npx shadcn@latest add https://asafefe.dev/r/border-beam.json works too.
Manual installation
- 1. Copy the source from the Code tab into components/border-beam.tsx.
- 2. Add the keyframes it uses (beam-spin) to your global CSS. The CLI does this for you.
Usage
import { BorderBeam } from "@/components/border-beam"
export function Example() {
return (
<BorderBeam className="w-64">
<div className="p-6">Your content</div>
</BorderBeam>
)
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| duration | number | 5 | Seconds per lap. |
| colorFrom | string | "var(--primary)" | Beam tail color. |
| colorTo | string | "#f59e0b" | Beam head color. |
| borderRadius | number | 12 | Corner radius in px. |
Notes
The beam is a rotating conic gradient sitting one pixel behind the content, so only the ring shows. It pairs well with pricing cards, AI feature callouts, and anything you want to draw the eye toward.
Props
| Prop | Type | Default |
|---|---|---|
duration | number | 5 |
colorFrom | string | var(--primary) |
colorTo | string | #3b82f6 |
borderRadius | number | 14 |
Slow it down with a larger
duration, or match your brand by passing colorFrom and colorTo. The inner surface uses bg-card, so it settles into any dark or light theme.