# Shine Border

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

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/shine-border
- Source (registry JSON with the full file): https://ui.minidev.pro/r/shine-border.json
- License: MIT. One file, yours to edit after install.

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

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/shine-border
```

Writes `components/ui/shine-border.tsx` plus the MiniDev files it is built from (button) and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/shine-border.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

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

From the npm package:

```tsx
import { ShineBorder } from "minidev-ui-kit/premium/shine-border"
```

## Usage

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

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

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `children` | `React.ReactNode` | - | no |  |
| `colors` | `string[]` | `["var(--accent)", "var(--accent-2)", ...` | no | Colours in the band, in order. Any CSS colour; tokens like var(--accent) work. |
| `duration` | `number` | `8` | no | Seconds per lap. |
| `borderWidth` | `number` | `2` | no | Border width in pixels. |
| `radius` | `number` | `18` | no | Corner radius in pixels. |
| `className` | `string` | - | no |  |

## Examples

### Your colours

colors fill the band in order; give the child rounded-[inherit] so its corners follow the radius prop.

```tsx
<ShineBorder colors={["var(--success)", "var(--info)"]} radius={16}>
  <div className="w-[320px] max-w-full rounded-[inherit] bg-surface p-5 shadow-raised">
    <div className="flex items-center justify-between">
      <p className="text-sm font-medium text-fg">Lumen Pro</p>
      <Badge variant="accent">Recommended</Badge>
    </div>
    <p className="mt-3 text-3xl font-medium tracking-[-0.04em] text-fg tabular-nums">$24<span className="text-sm text-fg-muted"> / month</span></p>
    <ul className="mt-4 space-y-2 text-sm text-fg">
      <li className="flex items-center gap-2"><CheckIcon className="size-4 text-success" /> Unlimited invoices</li>
      <li className="flex items-center gap-2"><CheckIcon className="size-4 text-success" /> Bank reconciliation</li>
      <li className="flex items-center gap-2"><CheckIcon className="size-4 text-success" /> Priority support</li>
    </ul>
    <Button className="mt-5 w-full">Choose Pro</Button>
  </div>
</ShineBorder>
```

### Thick and fast

borderWidth thickens the ring and a short duration makes the band chase; good for one announcement, not a grid of cards.

```tsx
<ShineBorder borderWidth={4} duration={3} radius={24}>
  <div className="flex w-[360px] max-w-full items-center gap-4 rounded-[inherit] bg-surface p-5 shadow-raised">
    <div className="grid size-12 shrink-0 place-items-center rounded-xl bg-ink text-on-ink"><SparklesIcon className="size-5" /></div>
    <div className="min-w-0">
      <p className="text-sm font-medium text-fg">Autopilot is live</p>
      <p className="text-xs text-fg-muted">Lumen now matches payments to invoices on its own.</p>
    </div>
  </div>
</ShineBorder>
```

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

```tsx
<ShineBorder radius={10} borderWidth={1.5} duration={4}>
  <Button size="lg" variant="outline">Upgrade to Pro <ArrowRightIcon /></Button>
</ShineBorder>
```

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

## FAQ

### 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`](https://ui.minidev.pro/docs/border-beam) sends one short beam around it, which is quieter.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`
- Built from: [button](https://ui.minidev.pro/docs/button/md)

## Related

- [Border Beam](https://ui.minidev.pro/docs/border-beam/md): React border beam: a light that travels around any card's border, drawn as a masked conic gradient in your accent colors. Pauses for reduced motion.
- [Cta Glow](https://ui.minidev.pro/docs/cta-glow/md): A call to action card in Tailwind with soft accent glow layers, a title, optional description, a magnetic get started button and an outline button.
- [Shimmer Button](https://ui.minidev.pro/docs/shimmer-button/md): A React call to action with a slow band of light sweeping across it, a lit top edge and a press state. Ink or accent tone, renders as a button or a link.
- [Tilt Card](https://ui.minidev.pro/docs/tilt-card/md): React card that tilts toward the pointer in 3D with a moving glare and parallax children marked data-depth. Springs flat on leave, still for reduced motion.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.
- [Card Tilt](https://ui.minidev.pro/docs/card-tilt/md): A card that tilts in 3D toward the pointer on springs, with an accent glare that follows the cursor. It stays flat when reduced motion is preferred.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
