# Spotlight card

A soft light follows the pointer across a layered product card.

## Usage

Use to highlight a project, feature, or editorial destination. Replace the default href with the destination in your product. The light is decorative; the link stays usable without pointer movement.

Save the JSX and CSS Module in the same folder in a React project with CSS Modules support. Controlled components need parent state and change handlers.

## JSX

```jsx
"use client";
import styles from "./SpotlightCard.module.css";
export default function SpotlightCard({
  title = "A brighter idea.",
  description = "Give your next project a little room to shine.",
  href = "/resources/guides/plan-ai-product-workflow/",
}) {
  function move(event) {
    if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
    const box = event.currentTarget.getBoundingClientRect();
    event.currentTarget.style.setProperty(
      "--x",
      `${event.clientX - box.left}px`,
    );
    event.currentTarget.style.setProperty(
      "--y",
      `${event.clientY - box.top}px`,
    );
  }
  return (
    <a className={styles.root} href={href} onPointerMove={move}>
      <div className={styles.orbit} aria-hidden="true">
        <i />
        <i />
        <span>✦</span>
      </div>
      <span className={styles.tag}>Make space for what’s next</span>
      <h3>{title}</h3>
      <p>{description}</p>
      <span className={styles.action}>
        Explore <span aria-hidden="true">↗</span>
      </span>
    </a>
  );
}

```

## CSS

```css
.root {
  --x: 50%;
  --y: 40%;
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 310px;
  min-height: 280px;
  padding: 25px;
  border: 1px solid #cfc4db;
  border-radius: var(--tdp-radius, 12px);
  background: #e7dfef;
  text-decoration: none;
  transition:
    box-shadow 0.35s,
    translate 0.35s;
}
.root::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    180px circle at var(--x) var(--y),
    #ffffffdc,
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s;
}
.root:is(:hover, :focus-visible)::before {
  opacity: 1;
}
.root:is(:hover, :focus-visible) {
  translate: 0 -4px;
  box-shadow: 0 18px 40px #56426a18;
}
.orbit {
  height: 88px;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
}
.orbit i {
  position: absolute;
  width: 115px;
  height: 45px;
  border: 1px solid #a28bb9;
  border-radius: 50%;
  rotate: -25deg;
  transition: rotate 0.7s;
}
.orbit i + i {
  rotate: 35deg;
}
.orbit span {
  font-size: 47px;
  color: var(--tdp-primary, #1f3934);
  transition:
    rotate 0.7s,
    scale 0.7s;
}
.root:is(:hover, :focus-visible) .orbit i {
  rotate: 155deg;
}
.root:is(:hover, :focus-visible) .orbit i + i {
  rotate: 215deg;
}
.root:is(:hover, :focus-visible) .orbit span {
  rotate: 90deg;
  scale: 1.15;
}
.tag {
  font-size: 10px;
  color: #6e5c7c;
}
.root h3 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 7px 0;
}
.root p {
  font-size: 13px;
  line-height: 1.6;
  color: #6e5c7c;
  margin: 0;
}
.action {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 12px;
}
.root {
  font-family: var(--tdp-font, "DM Sans", system-ui, sans-serif);
  color: var(--tdp-text, #302e2b);
  max-width: 100%;
  box-sizing: border-box;
}
.root * {
  box-sizing: border-box;
}
.root :is(button, input, a):focus-visible,
.root:focus-visible {
  outline: 3px solid var(--tdp-focus, #7851a9);
  outline-offset: 4px;
}
.root button {
  font: inherit;
  cursor: pointer;
}
.root button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.root button,
.root a {
  touch-action: manipulation;
}
@media (prefers-reduced-motion: reduce) {
  .root,
  .root *,
  .root::before,
  .root::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    translate: none !important;
    rotate: none !important;
    scale: none !important;
    scroll-behavior: auto !important;
  }
}

```

## Props

- title (string): Card heading.
- description (string): Supporting copy.
- href (string): Real destination URL.

## Accessibility

A single native link covers the card. Focus reveals the same light treatment. Essential content is always visible, with reduced motion respected.

Check accessibility again after customizing the component.

[Browse all components](/resources/components/)

Canonical: https://designproject.io/resources/components/spotlight-card/

## Keep learning

- [How to create a UI color palette, step by step](https://designproject.io/resources/guides/create-ui-color-palette/)
- [Product design glossary: 44 terms explained](https://designproject.io/resources/glossary/)
- [How to choose font pairings for a product interface](https://designproject.io/resources/guides/choose-font-pairings/)
