Modus UI

Focus Card

Web (React)

A card with a subtle radial gradient spotlight that follows the user's cursor.

A card with a subtle radial gradient spotlight that follows the user's cursor, bringing attention to the elements you're hovering over. Great for feature grids and pricing cards.

✨

Focus Card

This card features a subtle spotlight effect that follows your cursor, bringing attention to the elements you're hovering over.

Installation

CLI

npx @modus-ui/cli add focus-card

Manual

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

Usage

tsx
import { FocusCard } from "@/components/ui/focus-card";

export default function Example() {
  return (
    <FocusCard>
      <div className="relative z-10 p-8">
        <h3 className="text-xl font-semibold">Hover me</h3>
        <p>The spotlight follows your mouse.</p>
      </div>
    </FocusCard>
  );
}

Props

PropTypeDefaultDescription
childrenReactNode-The content inside the card.
classNamestring-Additional CSS classes for the card.
spotlightColorstring"rgba(255, 255, 255, 0.15)"The color of the spotlight radial gradient.

Comments

  • No comments yet.