Spotlight Card
A radial spotlight that follows the cursor across the card. The premium-feature look.
Move your cursor →
import { motion, useMotionTemplate, useMotionValue } from "framer-motion";
export function SpotlightCard({ children }) {
const x = useMotionValue(-200); const y = useMotionValue(-200);
const bg = useMotionTemplate`radial-gradient(150px circle at ${x}px ${y}px, rgba(79,160,255,0.28), transparent 70%)`;
return (
<div
onMouseMove={(e) => { const r = e.currentTarget.getBoundingClientRect(); x.set(e.clientX - r.left); y.set(e.clientY - r.top); }}
className="relative overflow-hidden rounded-2xl border border-white/10 bg-[#0a0e1a] p-6"
>
<motion.div className="pointer-events-none absolute inset-0" style={{ background: bg }} />
<div className="relative">{children}</div>
</div>
);
}How it works
Spotlight Card is a hand-built card component for React, styled with Tailwind and animated with Framer Motion — no heavy dependency tree, no 60-package install. Drop it in, keep your bundle lean, and it stays performant on real devices. It's free — copy the code above and ship it.
← Browse all components