Spotlight-hover magic card
Tracks the cursor and paints a soft radial spotlight plus a highlighted border on hover, wraps around any shadcn/ui Card content. Needs next-themes for the dark/light gradient color swap, strip that if the project has no theme provider.
Live preview
open in new tab ↗"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 { MagicCard } from "@/components/magicui/magic-card"
export function MagicCardDemo() {
const { theme } = useTheme()
return (
<Card className="w-full max-w-sm border-none p-0 shadow-none">
<MagicCard gradientColor={theme === "dark" ? "#262626" : "#D9D9D955"} className="p-0">
<CardHeader className="border-border border-b p-4">
<CardTitle>Sign in</CardTitle>
<CardDescription>Enter your details to continue</CardDescription>
</CardHeader>
<CardContent className="p-4">
<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>
</CardContent>
<CardFooter className="border-border border-t p-4">
<Button className="w-full">Sign in</Button>
</CardFooter>
</MagicCard>
</Card>
)
}Block id: magicui-magic-card-loginreact-tailwind · code-required
More card blocks
Want the whole site, not just the block?
We ship real client sites in 3 weeks — with blocks like this one, wired to your brand.



