Skip to content
Premium & Brand

Border Beam

An animated light beam that travels around an element's border.

Import

tsx
import { BorderBeam } from "@cooud-ui/ui";
bash
npx cooud-ui add border-beam

Examples

API Reference

Generated from the component's exported types.

BorderBeamProps

Extends HTMLAttributes<HTMLDivElement>

PropTypeDefaultDescription
size
number60Length 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
number8Seconds for one full lap around the perimeter. Defaults to `8` (a calm, premium drift).
delay
number0Phase 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
number1.5Thickness of the border band the beam rides in, in pixels. Defaults to `1.5`.
reverse
booleanfalseTravel counter-clockwise instead of clockwise. Defaults to `false`.