Modus UI

Border Beam

Web (React)

A glowing, animated gradient beam that endlessly traces the perimeter.

A popular SaaS design element. It wraps any container and mathematically rotates a glowing conic-gradient beam perfectly along its edge borders without bleeding into the background.

✨

Animated Borders

Endlessly rotating beams around any container.

Installation

CLI

npx @modus-ui/cli add border-beam

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/border-beam.tsx.
  3. Paste the code.

Usage

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

export default function Example() {
  return (
    <div className="relative rounded-xl border bg-card p-6">
      <h3>Card Content</h3>
      <BorderBeam size={100} duration={6} />
    </div>
  );
}

Props

PropTypeDefaultDescription
durationnumber8Seconds for one full trip around the border.
borderWidthnumber1.5Thickness of the beam in pixels.
sizenumber200Length of the beam in pixels.
colorFromstring"hsl(var(--primary))"Start colour of the beam gradient.
colorTostring"transparent"End colour of the beam gradient.
delaynumber0Seconds before the animation starts.

Comments

  • No comments yet.