Shine Border
MotionReact shine border: a conic gradient sweeps around a card's edge, masked to the border ring so content stays untouched. Colors, duration and width props.
Installation
npx shadcn@latest add @minidev/shine-border
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/shine-border.json
Usage
import { ShineBorder } from "@/components/ui/shine-border"
export function Example() {
return (
<ShineBorder />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| children | React.ReactNode | - |
| colorsColours in the band, in order. Any CSS colour; tokens like var(--accent) work. | string[] | ["var(--accent)", "var(--accent-2)", ... |
| durationSeconds per lap. | number | 8 |
| borderWidthBorder width in pixels. | number | 2 |
| radiusCorner radius in pixels. | number | 18 |
| className | string | - |
When to use
Use it to single out one card: a featured plan, a new release, an invite. Reach for BorderBeam for a short travelling beam instead of a band, and CtaGlow for a whole glowing call-to-action section.
Accessibility
- The ring is an
aria-hidden,pointer-events-noneoverlay, so the content inside stays clickable and is read normally. - Under reduced motion the band is drawn but does not turn.
Frequently asked questions
Why does ShineBorder not animate in some browsers?
The band turns by animating a registered custom property (@property --shine-border-angle). Browsers without @property support show the band in a fixed position instead.
How do I match my card's corners?
Set radius in pixels to the child's radius (default 18) and give the child rounded-[inherit]. borderWidth sets the ring thickness (default 2px).
ShineBorder or BorderBeam?
ShineBorder sweeps a wide band of several colors around the whole ring. BorderBeam sends one short beam around it, which is quieter.
Dependencies
npm
Built from
Examples
Your colours
colors fill the band in order; give the child rounded-[inherit] so its corners follow the radius prop.
Thick and fast
borderWidth thickens the ring and a short duration makes the band chase; good for one announcement, not a grid of cards.
Around a button
Match radius to the button's corner (10px for the lg size) and a thin ring makes the one action on the page glow.