Modus UI

Spotlight Card

Web (React)

A card with a subtle spotlight gradient that follows the user's mouse cursor on hover.

A card component that creates an ambient spotlight effect tracking the user's mouse cursor across its surface. Perfect for subtle emphasis and giving depth to interfaces.

🔦

Spotlight Card

Move your mouse over this card to reveal a subtle spotlight effect tracing your cursor. Great for subtle emphasis and interactive depth.

Installation

CLI

npx @modus-ui/cli add spotlight-card

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/spotlight-card.tsx.
  3. Paste the code.

Usage

tsx
import { SpotlightCard } from "@/components/ui/spotlight-card";

export default function Example() {
  return (
    <SpotlightCard className="max-w-sm">
      <h3 className="text-xl font-semibold">Hover me</h3>
    </SpotlightCard>
  );
}

Props

PropTypeDefaultDescription
spotlightColorstring"hsl(var(--primary) / 0.14)"Colour of the spotlight that follows the cursor. Defaults to a soft tint of the theme primary, so it shows on light and dark cards.

Comments

  • No comments yet.