Files
bedolaga-cabinet/src/components/ui/hover-border-gradient.tsx
Fringg d8b83ccdb8 fix: rewrite gradient border with @property CSS angle animation
Pure CSS approach: @property --border-angle + conic-gradient on border-box.
No extra elements, no overflow issues, no JS animation.
Smooth rotation via CSS Houdini custom property animation.
2026-02-25 08:48:48 +03:00

31 lines
697 B
TypeScript

import React from 'react';
import { cn } from '@/lib/utils';
export function HoverBorderGradient({
children,
containerClassName,
className,
as: Tag = 'button',
...props
}: React.PropsWithChildren<
{
as?: React.ElementType;
containerClassName?: string;
className?: string;
} & React.HTMLAttributes<HTMLElement>
>) {
return (
<Tag
className={cn(
'hover-border-gradient group flex items-center justify-center rounded-xl text-sm font-medium text-white',
containerClassName,
)}
{...props}
>
<span className={cn('relative z-10 flex items-center justify-center', className)}>
{children}
</span>
</Tag>
);
}