Moving / Glowing Border
A border of light that travels round a card, faces the pointer, or wakes on hover.
PROGet Moving / Glowing Border and 168 other Pro components with pro lifetime — Get Pro
- Category
- Creative
- Access
- ProPro · unlocked
- Source
- 154 lines · one file
- States
- 5 drawn
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 Liro's Moving / Glowing Border for this.
Install it: npx shadcn@latest add @liro/glow-border
(the @liro registry is set up in components.json, with LIRO_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 @liro 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.
| Type | Notes | ||
|---|---|---|---|
children | React.ReactNode | No | – |
mode | "moving" | "follow-pointer" | "hover" | No | "moving" travels round, "follow-pointer" faces the pointer, "hover" lights up on hover and focus. Default "moving". |
colors | string[] | No | Two or more CSS colours for the light. Default the theme's info and success hues. |
borderWidth | number | No | Thickness of the border, in pixels. Default 1.5. |
radius | number | No | Corner radius, in pixels. Default 18. |
duration | number | No | Milliseconds for one trip round. Default 4000. |
as | React.ElementType | No | The element to render, e.g. "button" or "a". Default "div". |
href | string | No | For `as="a"`. |
type | "button" | "submit" | "reset" | No | For `as="button"`. |
Dependencies
npm packages
clsxtailwind-mergeLiro foundations, installed alongside it
liro-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