Skip to content

Shine Border

Motion

React 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.

src/registry/premium/shine-border.tsx/r/shine-border.json

Installation

bash
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

tsx
import { ShineBorder } from "@/components/ui/shine-border"

export function Example() {
  return (
    <ShineBorder />
  )
}

API reference

ShineBorder props
PropTypeDefault
childrenReact.ReactNode-
colorsColours in the band, in order. Any CSS colour; tokens like var(--accent) work.string[]["var(--accent)", "var(--accent-2)", ...
durationSeconds per lap.number8
borderWidthBorder width in pixels.number2
radiusCorner radius in pixels.number18
classNamestring-

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-none overlay, 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

lucide-reactmotion

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.

All Animated React components