Modus UI

Border Glow

Web (React)

An interactive card wrapper with an ambient glowing mesh gradient that mathematically tracks the mouse.

An interactive card wrapper with an ambient glowing mesh gradient that mathematically tracks the mouse. The glow traces the borders exactly and cascades over the inner padding realistically.

Interactive Glow

A highly sensitive ambient glow effect that tracks the cursor mathematically around the border radius.

Installation

CLI

npx @modus-ui/cli add border-glow

Manual

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

Usage

tsx
import { BorderGlow } from "@/components/ui/border-glow";

export default function Example() {
  return (
    <BorderGlow
      className="h-[350px] w-[300px] p-8"
      glowColor="200 100 65"
      colors={["hsl(var(--primary))", "hsl(var(--primary))", "hsl(var(--primary))"]}
      animated={true}
      backgroundColor="hsl(var(--primary))"
    >
      <h3 className="text-xl font-medium text-white">Interactive Glow</h3>
      <p className="text-zinc-400">Content goes here.</p>
    </BorderGlow>
  );
}

Props

PropTypeDefaultDescription
edgeSensitivitynumber30How close in pixels to the edge the glow appears.
glowColorstring"266 100 65"Glow colour as space-separated HSL values.
backgroundColorstring"hsl(var(--card))"Card background colour.
borderRadiusnumber28Corner radius in pixels.
glowRadiusnumber40Size of the glow in pixels.
glowIntensitynumber1Strength of the glow.
coneSpreadnumber25Angular spread of the glow in degrees.
animatedbooleanfalseRuns an intro sweep of the glow.
colorsstring[]["hsl(var(--primary))", "hsl(var(--primary))", "hsl(var(--primary))"]Colours of the border gradient.
fillOpacitynumber0.5Opacity of the inner glow fill.

Comments

  • No comments yet.