Border Beam
An animated light beam that travels around an element's border.
Import
import { BorderBeam } from "@cooud-ui/ui";
npx cooud-ui add border-beam
Examples
API Reference
Generated from the component's exported types.
BorderBeamProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 60 | Length of the luminous head, in pixels. Also sets the corner radius of the travel path so the beam rounds the corners smoothly. Larger values read as a longer comet trail. Defaults to `60`. |
duration | number | 8 | Seconds for one full lap around the perimeter. Defaults to `8` (a calm, premium drift). |
delay | number | 0 | Phase offset in seconds — the beam starts as if it had already been running for this long, so two beams on stacked cards can be staggered around the loop instead of moving in lockstep. Defaults to `0`. |
colorFrom | string | "var(--cooud-primary)" | Colour of the leading edge of the beam. Defaults to the theme primary (`var(--cooud-primary)`). |
colorTo | string | "var(--cooud-accent)" | Colour the trail fades through before it dissolves. Defaults to the theme accent (`var(--cooud-accent)`). |
borderWidth | number | 1.5 | Thickness of the border band the beam rides in, in pixels. Defaults to `1.5`. |
reverse | boolean | false | Travel counter-clockwise instead of clockwise. Defaults to `false`. |