Glowing Border Card

PreviousNext

A customizable card with a glowing border effect that changes colors based on light and dark modes.

Docs
scrollxuicomponent

Preview

Loading preview…
components/ui/glowingbordercard.tsx
import React from "react";
import { cn } from "@/lib/utils";

type GlowingBorderCardProps = {
  children: React.ReactNode;
  fromColor: string;
  toColor: string;
  className?: string;
};

export default function GlowingBorderCard({
  children,
  fromColor,
  toColor,
  className,
}: GlowingBorderCardProps) {
  return (
    <div className={cn("relative group", className)}>
      <div
        className={cn(
          "absolute -inset-0.5 rounded-lg blur opacity-75 group-hover:opacity-100 transition duration-1000 group-hover:duration-200 animate-tilt",
          `bg-gradient-to-r from-${fromColor} to-${toColor}`
        )}
      />
      <div className="relative flex items-center justify-center h-full bg-white dark:bg-black rounded-lg p-6">
        {children}
      </div>
    </div>
  );
}

Installation

npx shadcn@latest add @scrollxui/glowingbordercard

Usage

import { Glowingbordercard } from "@/components/glowingbordercard"
<Glowingbordercard />