Skip to content\n\n/* CSS */\n/* Spotlight Hero\n Radial spotlight tracks the cursor through --x / --y custom properties.\n Customize: spotlight radius & --spoth-accent. */\n\n.nuda-spoth {\n --x: 50%;\n --y: 50%;\n --spoth-accent: 228, 255, 84;\n position: relative;\n width: 100%;\n height: 420px;\n border-radius: 18px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #09090b;\n border: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.nuda-spoth::before {\n content: \"\";\n position: absolute;\n inset: 0;\n background: radial-gradient(\n 300px circle at var(--x) var(--y),\n rgba(var(--spoth-accent), 0.18),\n transparent 60%\n );\n transition: background 0.08s linear;\n}\n\n.nuda-spoth__content {\n position: relative;\n z-index: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n text-align: center;\n}\n\n.nuda-spoth__content h2 {\n font: 800 clamp(2rem, 5vw, 3.5rem) ui-sans-serif, system-ui, sans-serif;\n color: #fafafa;\n margin: 0;\n letter-spacing: -0.02em;\n}\n\n.nuda-spoth__sub {\n font: 500 1rem ui-sans-serif, system-ui, sans-serif;\n color: #a1a1aa;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .nuda-spoth::before { transition: none; }\n}","license":"https://opensource.org/licenses/MIT","codeRepository":"https://github.com/sgomez-dev/nudaui","isPartOf":{"@id":"https://nudaui.dev/#software"},"isAccessibleForFree":true,"inLanguage":"en","author":{"@id":"https://nudaui.dev/#founder"},"creator":{"@id":"https://nudaui.dev/#founder"},"copyrightHolder":{"@id":"https://nudaui.dev/#founder"},"keywords":"Hero Sections, Spotlight Hero, copy paste, css animation, ui component, framework agnostic"},{"@type":"Person","@id":"https://nudaui.dev/#founder","name":"Santiago Gómez de la Torre Romero","givenName":"Santiago","familyName":"Gómez de la Torre Romero","url":"https://sgomez.dev","jobTitle":"Software Engineer","description":"Creator, owner, and maintainer of NudaUI.","sameAs":["https://sgomez.dev","https://blog.sgomez.dev","https://github.com/sgomez-dev","https://linkedin.com/in/sgomez-dev","https://www.npmjs.com/package/sgomez-cli"]}]}

Spotlight Hero

A copy-paste hero sections component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Hero SectionsHTMLCSSany framework

Follow the light.

Move your cursor.

Copy into your project

HTML
<!-- Spotlight Hero — cursor-tracking spotlight via --x / --y -->
<section class="nuda-spoth" id="spoth">
  <div class="nuda-spoth__content">
    <h2>Follow the light.</h2>
    <span class="nuda-spoth__sub">Move your cursor.</span>
  </div>
</section>

<script>
  const el = document.getElementById("spoth");
  el.addEventListener("pointermove", (e) => {
    const r = el.getBoundingClientRect();
    el.style.setProperty("--x", (e.clientX - r.left) + "px");
    el.style.setProperty("--y", (e.clientY - r.top) + "px");
  });
</script>
CSS
/* Spotlight Hero
   Radial spotlight tracks the cursor through --x / --y custom properties.
   Customize: spotlight radius & --spoth-accent. */

.nuda-spoth {
  --x: 50%;
  --y: 50%;
  --spoth-accent: 228, 255, 84;
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.nuda-spoth::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px circle at var(--x) var(--y),
    rgba(var(--spoth-accent), 0.18),
    transparent 60%
  );
  transition: background 0.08s linear;
}

.nuda-spoth__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.nuda-spoth__content h2 {
  font: 800 clamp(2rem, 5vw, 3.5rem) ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  margin: 0;
  letter-spacing: -0.02em;
}

.nuda-spoth__sub {
  font: 500 1rem ui-sans-serif, system-ui, sans-serif;
  color: #a1a1aa;
}

@media (prefers-reduced-motion: reduce) {
  .nuda-spoth::before { transition: none; }
}

How to use Spotlight Hero

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More hero sections components

← Browse all NudaUI components