Moving / Glowing Border
One conic gradient whose angle is a CSS variable: animated for moving, set from the pointer for follow, faded in for hover. A soft blurred copy glows outside the edge. Stops off screen.
The decision inside it
The inside stays the card colour
Only the rim lights up, so text in the card keeps its contrast whatever the light is doing.
When to use it
Use Glow Border to make one card or button stand out: the recommended plan, the main call to action, a featured item. Keep it to one or two per screen.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Layro's Moving / Glowing Border for this.
Install it: npx shadcn@latest add @layro/glow-border
(the @layro registry is set up in components.json, with LAYRO_KEY in .env.local)
Import it from @/components/ui/glow-border.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @layro registry with your CLI token: see the Namespaced tab.
Usage
import { GlowBorder } from "@/components/ui/glow-border";
export function FeaturedPlan() {
return (
<GlowBorder mode="moving" radius={20} className="p-6">
<h3 className="font-semibold">Team</h3>
<p className="text-sm text-muted-foreground">$12 per sender a month</p>
</GlowBorder>
);
}API reference
“Copy prompt” above puts a full brief on your clipboard — install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Prop | Type | Notes |
|---|---|---|
children | React.ReactNode | — |
mode | "moving" | "follow-pointer" | "hover" | "moving" travels round, "follow-pointer" faces the pointer, "hover" lights up on hover and focus. Default "moving". |
colors | string[] | Two or more CSS colours for the light. Default the theme's info and success hues. |
borderWidth | number | Thickness of the border, in pixels. Default 1.5. |
radius | number | Corner radius, in pixels. Default 18. |
duration | number | Milliseconds for one trip round. Default 4000. |
as | React.ElementType | The element to render, e.g. "button" or "a". Default "div". |
href | string | For `as="a"`. |
type | "button" | "submit" | "reset" | For `as="button"`. |
Dependencies
npm packages
clsxtailwind-mergeLayro foundations, installed alongside it
layro-themeStates
All of them are drawn by the component. None is left for you to design.
- Moving
- Follow pointer
- Hover
- Focused button
- Reduced motion
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances
Lifetime access
Every component, and everything we ship next.
- All 232 components, source included
- Every template, and everything released after you buy
- shadcn CLI or download — React 18/19, Tailwind v4
- One payment. No subscription.