NEW
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
shadcn registry is live·
Learn more
Skip to content
Docs

Glowing Card

The card glows in gradient colours when hovered

requires interactionhover
Loading...

Installation

CLI

pnpm dlx shadcn@latest add https://animata.design/r/card/glowing-card.json

Manual

Add to your CSS

Add the following to your CSS file.

@theme {
  --shadow-glow: 0 0 20px rgba(255, 204, 112, 0.7), 0 0 40px rgba(200, 80, 192, 0.5), 0 0 60px rgba(65, 88, 208, 0.3);
  --shadow-glow2: 0 0 20px rgba(50, 255, 50, 0.7), 0 0 40px rgba(20, 200, 20, 0.5), 0 0 60px rgba(5, 150, 5, 0.3);
}

Run the following command

It will create a new file called glowing-card.tsx inside the components/animata/card directory.

mkdir -p components/animata/card && touch components/animata/card/glowing-card.tsx

Paste the code

Open the newly created file and paste the following code:

import type React from "react";
 
interface GlowCardProps extends React.HTMLAttributes<HTMLDivElement> {
  /**
   * Starting gradient color.
   */
  fromColor?: string;
  /**
   * Middle gradient color.
   */
  viaColor?: string;
  /**
   * Ending gradient color.
   */
  toColor?: string;
}
 
export default function GlowingCard({
  fromColor = "#4158D0",
  viaColor = "#C850C0",
  toColor = "#FFCC70",
}: GlowCardProps) {
  return (
    <div
      className="rounded-3xl bg-linear-to-r p-0.5 hover:shadow-glow hover:brightness-150"
      style={{
        transition: " box-shadow 0.5s ease",
        backgroundImage: `linear-gradient(to right, ${fromColor}, ${viaColor}, ${toColor})`,
      }}
    >
      <div
        className="blur-20 inset-0 h-full w-full rounded-3xl bg-linear-to-r from-[#4158D0] via-[#C850C0] to-[#FFCC70]"
        style={{ transition: "filter 0.5s ease" }}
      />
      <div className="flex h-64 w-56 flex-col gap-2 rounded-3xl bg-blue-950 p-4">
        <div className="mb-2 text-xl font-bold text-gray-50">Glowing</div>
 
        <div className="flex-1 text-sm font-medium text-gray-100/80">
          A glowing card is a card that glows.
        </div>
      </div>
    </div>
  );
}

Credits

Built by Aashish Katila