UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "shine-border",
"type": "registry:ui",
"title": "Shine Border",
"description": "Shine border is an animated background border effect.",
"files": [
{
"path": "registry/magicui/shine-border.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\ninterface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Width of the border in pixels\n * @default 1\n */\n borderWidth?: number\n /**\n * Duration of the animation in seconds\n * @default 14\n */\n duration?: number\n /**\n * Color of the border, can be a single color or an array of colors\n * @default \"#000000\"\n */\n shineColor?: string | string[]\n}\n\n/**\n * Shine Border\n *\n * An animated background border effect component with configurable properties.\n */\nexport function ShineBorder({\n borderWidth = 1,\n duration = 14,\n shineColor = \"#000000\",\n className,\n style,\n ...props\n}: ShineBorderProps) {\n return (\n <div\n style={\n {\n \"--border-width\": `${borderWidth}px`,\n \"--duration\": `${duration}s`,\n backgroundImage: `radial-gradient(transparent,transparent, ${\n Array.isArray(shineColor) ? shineColor.join(\",\") : shineColor\n },transparent,transparent)`,\n backgroundSize: \"300% 300%\",\n mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,\n WebkitMaskComposite: \"xor\",\n maskComposite: \"exclude\",\n padding: \"var(--border-width)\",\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"motion-safe:animate-shine pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position]\",\n className\n )}\n {...props}\n />\n )\n}\n",
"type": "registry:ui"
}
],
"cssVars": {
"theme": {
"animate-shine": "shine var(--duration) infinite linear"
}
},
"css": {
"@keyframes shine": {
"0%": {
"background-position": "0% 0%"
},
"50%": {
"background-position": "100% 100%"
},
"to": {
"background-position": "0% 0%"
}
}
}
}