1
3
Block

Glow Card

PreviousNext

A spotlight effect that follows your mouse cursor and highlights borders on hover.

"use client"

import { useTheme } from "next-themes"

import { Button } from "@/components/ui/button"
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { GlowCard } from "@/components/ui/glow-card"

export function GlowCardDemo() {
  const { theme } = useTheme()
  return (
    <Card className="w-full max-w-sm border-none p-0 shadow-none">
      <GlowCard
        gradientColor={theme === "dark" ? "#262626" : "#D9D9D955"}
        className="p-0"
      >
        <CardHeader className="border-border border-b p-4 [.border-b]:pb-4">
          <CardTitle>Login</CardTitle>
          <CardDescription>
            Enter your credentials to access your account
          </CardDescription>
        </CardHeader>
        <CardContent className="p-4">
          <form>
            <div className="grid gap-4">
              <div className="grid gap-2">
                <Label htmlFor="email">Email</Label>
                <Input id="email" type="email" placeholder="name@example.com" />
              </div>
              <div className="grid gap-2">
                <Label htmlFor="password">Password</Label>
                <Input id="password" type="password" />
              </div>
            </div>
          </form>
        </CardContent>
        <CardFooter className="border-border border-t p-4 [.border-t]:pt-4">
          <Button className="w-full">Sign In</Button>
        </CardFooter>
      </GlowCard>
    </Card>
  )
}

Installation

pnpm dlx shadcn@latest add https://ebonui.com/r/glow-card.json

Usage

import { GlowCard } from "@/registry/ebonui/glow-card"
<GlowCard>
  <div className="p-4">
    <p>Hello World</p>
    <span>Hover me</span>
  </div>
</GlowCard>

Props

GlowCard

Prop nameTypeDefaultDescription
childrenReact.ReactNode-The content to be rendered inside the card
classNamestring-Additional CSS classes to apply to the card
gradientSizenumber200Size of the gradient effect
gradientColorstring#262626Color of the gradient effect
gradientOpacitynumber0.8Opacity of the gradient effect
gradientFromstring#9E7AFFStart color of the gradient border
gradientTostring#FE8BBBEnd color of the gradient border