Skip to content

UI Library for Design Engineers. Animated components and effects you can copy and paste into your apps. Free. Open Source.

fix: shine border bug fix for v4

Dillion Verma34455ca7d02e
diff --git a/registry/magicui/shine-border.tsx b/registry/magicui/shine-border.tsx
index cb17926f..c9ae17c5 100644
--- a/registry/magicui/shine-border.tsx
+++ b/registry/magicui/shine-border.tsx
@@ -1,8 +1,9 @@
"use client";
-import { cn } from "@/lib/utils";
import * as React from "react";
+import { cn } from "@/lib/utils";
+
interface ShineBorderProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Width of the border in pixels
@@ -40,18 +41,18 @@ export function ShineBorder({
{
"--border-width": `${borderWidth}px`,
"--duration": `${duration}s`,
- "--mask-linear-gradient": `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
- "--background-radial-gradient": `radial-gradient(transparent,transparent, ${Array.isArray(shineColor) ? shineColor.join(",") : shineColor},transparent,transparent)`,
- backgroundImage: "var(--background-radial-gradient)",
+ backgroundImage: `radial-gradient(transparent,transparent, ${Array.isArray(shineColor) ? shineColor.join(",") : shineColor},transparent,transparent)`,
backgroundSize: "300% 300%",
- mask: "var(--mask-linear-gradient)",
+ mask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
+ WebkitMask: `linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,
WebkitMaskComposite: "xor",
maskComposite: "exclude",
+ padding: "var(--border-width)",
...style,
} as React.CSSProperties
}
className={cn(
- "pointer-events-none absolute inset-0 size-full rounded-[inherit] p-[--border-width] will-change-[background-position] motion-safe:animate-shine",
+ "pointer-events-none absolute inset-0 size-full rounded-[inherit] will-change-[background-position] motion-safe:animate-shine",
className,
)}
{...props}