Components

Shine Border

A React shine border: a thin outline with a soft, multi-color sheen gliding around any card, badge or panel. Built with Motion and Tailwind CSS, it follows the real rounded shape at any aspect ratio, pauses off-screen and stays still for prefers-reduced-motion.

  • Multi-color sheen
  • Any aspect ratio
  • Pauses off-screen
  • No layout shift
  • prefers-reduced-motion

Team plan

$24 per seat, billed monthly

Shared projects, role-based access and audit logs for your whole team.

Installation

$ npx shadcn@latest add https://duskui.com/r/shine-border.json

Usage

promo-card.tsx
import { ShineBorder } from "@/components/dusk/shine-border/shine-border"

export function PromoCard() {
  return (
    <ShineBorder color={["#a78bfa", "#22d3ee"]} contentClassName="p-6">
      <h3 className="font-semibold">Upgrade to Pro</h3>
      <p className="text-sm text-white/60">Unlock every animated block.</p>
    </ShineBorder>
  )
}

Examples

Colors

color takes one CSS color or an array. Multiple colors blend from the core of the sheen outwards; a second sheen runs half a lap behind with the colors reversed.

Mint

Single color

Warm

2 colors

Cool

2 colors

Width, speed & shape

borderWidth sets the line thickness, duration the seconds per lap and radius the corner radius — a large radius gives a pill.

Now in public beta

Thicker border

borderWidth 2, duration 6

API Reference

Also accepts every <div> prop. The content wrapper paints bg-card by default; override it with contentClassName.

PropTypeDefaultDescription
colorstring | string[]var(--color-primary)One CSS color, or several that blend from the sheen's core outwards.
borderWidthnumber1Border width in px.
durationnumber8Seconds for the sheen to travel once around the border.
radiusnumber12Corner radius in px.
contentClassNamestring—Classes for the inner content wrapper (padding, background).
classNamestring—Classes for the outer wrapper, merged with tailwind-merge.

Accessibility

  • The border layers are aria-hidden and absolutely positioned, so they never reach screen readers or change the size of the content.
  • Content is rendered as-is: links, buttons and headings inside keep their own semantics and focus styles.
  • With prefers-reduced-motion the sheen is parked in one place instead of moving; it also pauses whenever the element is off-screen.
  • Animation runs on Motion values, so it never re-renders React and is cleaned up on unmount.