Border Beam

A beam of light that travels around an element's border. Great for highlighting a card or signaling work in progress.

Motion

Sign in

Welcome back. Pick up where you left off.

Playground

Tweak the props, the preview and the code follow.

Your content
Props
80
6
1
import { BorderBeam } from "@/components/ui/border-beam"

<div className="relative rounded-2xl border">
  Your content
  <BorderBeam />
</div>

Installation

npx @plumsydev/plum-ui add border-beam

Usage

import { BorderBeam } from "@/components/ui/border-beam"
<div className="relative rounded-2xl border p-6">
  …
  <BorderBeam />
</div>

Examples

Two beams

Two beams with opposite directions and offset timing.

Upgrade to Pro

Unlimited projects, preview deployments and priority builds.

As a status

Mount it only while a build runs.

acme-web
main · 4f2c91a
Ready

API Reference

BorderBeam

Place inside a relative parent with a border radius.

PropTypeDefault
size

Beam length in px.

number80
duration

Seconds per lap.

number6
delay

Offset in seconds, to stagger several beams.

number0
borderWidth

Thickness in px — match the parent border.

number1
colorFrom

Head color of the beam.

string"var(--foreground)"
colorTo

Tail color of the beam.

string"transparent"
reverse

Travel counter-clockwise.

booleanfalse

Notes

  • Uses CSS offset-path: rect() and a border mask — no SVG, no measuring.
  • Renders nothing with reduced motion.