Skip to content
Premium & Brand

Border Beam

Server Component

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

Import

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

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component BorderBeamDefault layout:inline style:border-beam {
  label "Beam"
}

page "/audit/border-beam/default" type:custom {
  use BorderBeamDefault
}

API Reference

Generated from the component's exported types.

BorderBeamProps

Extends HTMLAttributes<HTMLDivElement>

Skip BorderBeamProps props table
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(--cronus-fg)"Colour of the leading edge of the beam. Defaults to `var(--cronus-fg)`.
colorTo
string"transparent"Colour the trail fades through before it dissolves. Defaults to transparent.
borderWidth
number1Thickness of the border band the beam rides in, in pixels. Defaults to `1` (hairline).
reverse
booleanfalseTravel counter-clockwise instead of clockwise. Defaults to `false`.
className
string—Additional class names merged onto the root.
children
ReactNode—Contents of the component.
id
string—DOM id of the root element.