- All Components
- Animated Arrow
- Animated Counter
- Animated Save Button
- Animated Tabs
- Animated List/Grid View
- Bento Grid
- Border Beam
- Button
- Animated Copy Button
- Dock
- Animated 3D Folder
- Cursor-Tracking Glow Card
- Inline Edit Animation
- Animated OTP Input
- Infinite Marquee
- Animated Password Input
- Interactive Pie Chart
- Reveal on Scroll
- Tweet Card
- Typewriter
- Interactive World Map
Default beam
A thin animated stroke that traces the container's border radius.
Two beams
Stack multiple beams with different colors and a phase offset.
Installation
npx shadcn@latest add https://tentui.com/r/border-beam.json
Usage
BorderBeam is an absolutely-positioned overlay. Render it inside a relative overflow-hidden container and the beam traces the container's border radius.
import { BorderBeam } from "@/components/border-beam";
export function HighlightCard() {
return (
<div className="relative overflow-hidden rounded-xl border p-6">
<BorderBeam />
<h3>Featured</h3>
</div>
);
}The animation is a single CSS keyframe on a registered custom property (--beam-angle). Browsers interpolate the angle on the GPU, so the beam stays smooth even on dozens of stacked cards.
Patterns
Stacked beams
Render multiple <BorderBeam /> instances with different colors and delay values to get a multi-color rotation without re-running the animation.
<div className="relative overflow-hidden rounded-xl border p-6">
<BorderBeam duration={6} delay={0} colorTo="hsl(217 91% 60%)" />
<BorderBeam duration={6} delay={3} colorTo="hsl(330 81% 60%)" reverse />
<h3>Pro</h3>
</div>Match the parent radius
The beam reads the parent's border radius via borderRadius: "inherit". If you need a different curve, pass a number or CSS value:
<BorderBeam borderRadius={24} />
<BorderBeam borderRadius="9999px" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 1.5 | Beam thickness in pixels. |
duration | number | 10 | One full rotation, in seconds. |
delay | number | 0 | Delay before the rotation starts. |
colorFrom | string | "transparent" | Color at the start of the conic gradient (the tail). |
colorTo | string | "hsl(217 91% 60%)" | Color at the end (the bright lead). |
borderRadius | number | string | "inherit" | CSS radius for the beam path. |
reverse | boolean | false | Reverse the rotation direction. |
className | string | — | Forwarded to the overlay <div>. |
Accessibility & motion
- The beam is decorative — it carries
aria-hidden="true"and is not exposed to assistive tech. - A
prefers-reduced-motion: reducemedia query halts the animation. The beam stays visible but stops rotating.
Browser support
@property is supported in all evergreen browsers (Chrome 85+, Safari 16.4+, Firefox 128+). On older browsers the beam renders as a static conic gradient — still readable, just not animated.