Border beam preview

Border beam

A light that travels around the border of its positioned parent.

  • Group
    Effects
  • Origin
    Adapted · Magic UI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/border-beam

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { BorderBeam } from "@/registry/components/border-beam/border-beam";

<BorderBeam />

Props

PropTypeDefaultDescription
size?number50Length of the beam in px.
duration?number6Seconds for one lap.
delay?number0Seconds to offset the start, so several beams can chase each other.
colorFrom?string"var(--glow-from)"Head color of the beam.
colorTo?string"var(--glow-to)"Tail color of the beam.
transition?TransitionExtra Motion transition options.
className?string
style?CSSProperties
reverse?booleanfalseRun counter-clockwise.
initialOffset?number0Start position along the border, 0 to 100.
borderWidth?number1Border width in px.

When to use

Highlighting one card, input or CTA with a moving light on its border.

When not to use

Several elements at once (it loses meaning).

Related

Spotlight card · Button