Glowing Border

Pro

Glowing border CSS for cards: a cursor glowing effect, or beams, spins and pulses.

borderglowgradientcsscardanimation
Glowing Border component preview

Overview

Glowing Border is a React and Tailwind CSS animated gradient border for cards, inputs and buttons, in Next.js or any React app. Its cursor glowing effect works like a lamp: light pools on the stretch of edge nearest the pointer, brightens as it approaches, and shifts hue as it travels, so a whole feature grid lights up together. Beam, spin and pulse animate on their own through a registered @property angle. The glow is masked to the outside, and an optional inner glow fills the gap of a double frame. Reduced motion drops the easing and stops every loop.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add glowing-border

Usage

Import GlowingBorder from @/components/wensity/glowing-border and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { GlowingBorder } from "@/components/wensity/glowing-border";
const features = [
{ title: "Preview every branch", text: "Each pull request gets its own URL." },
{ title: "Roll back in one click", text: "Every deploy stays warm." },
{ title: "Cache purged on deploy", text: "No stale pages after a release." },
];
export default function Example() {
return (
<ul className="grid gap-3 sm:grid-cols-3">
{features.map((feature) => (
<li key={feature.title}>
<GlowingBorder radius={22} contentClassName="p-2" className="h-full">
<div className="h-full rounded-[14px] border border-white/[0.07] bg-neutral-950 p-5">
<h3 className="font-semibold">{feature.title}</h3>
<p className="mt-1.5 text-sm text-neutral-400">{feature.text}</p>
</div>
</GlowingBorder>
</li>
))}
</ul>
);
}

Props

PropTypeDefaultDescription
variant"cursor" | "beam" | "spin" | "pulse""cursor"How the light moves. Cursor follows the pointer; the others loop on their own.
colorsstring[]["#ff1100", "#f97316", "#fbbf24", "#fb7185"]CSS colors. Cursor spreads them around the edge; the looping variants use the first three.
rangenumber160Cursor only: how far from the edge, in pixels, the cursor starts to light it.
spotnumber340Cursor only: diameter of the pool of light in pixels.
thicknessnumber1.5Border thickness in pixels.
radiusnumber16Corner radius in pixels.
durationnumber4Seconds for one lap (beam, spin) or one breath (pulse).
glownumber0Outer glow strength from 0, no glow, to 1.
glowSizenumber10How far the glow spreads outside the border, in pixels.
innerGlownumber0Light falling inward from the lit edge, 0 to 1. Shows only where the content is transparent, such as a double frame gap.
contentClassNamestring-Classes for the content box. Padding here turns the border into an outer frame.