Skip to content\n\n/* CSS */\n/* Follow Cursor Tip\n A tooltip that trails the cursor inside the trigger area.\n Position is driven by --tx / --ty custom properties set in JS.\n Customize: --followtip-bg, offset (14px) */\n\n.nuda-followtip-wrap {\n --tx: 0px;\n --ty: 0px;\n position: relative;\n display: inline-block;\n cursor: default;\n}\n\n.nuda-followtip__area {\n display: inline-block;\n padding: 0.6rem 1.2rem;\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 8px;\n color: #ccc;\n font-size: 0.85rem;\n}\n\n.nuda-followtip {\n --followtip-bg: #e4ff54;\n position: absolute;\n left: 0;\n top: 0;\n transform: translate3d(calc(var(--tx) + 14px), calc(var(--ty) + 14px), 0);\n background: var(--followtip-bg);\n color: #09090b;\n font-size: 0.7rem;\n font-weight: 600;\n padding: 0.25rem 0.55rem;\n border-radius: 5px;\n white-space: nowrap;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.18s ease;\n z-index: 10;\n}\n\n.nuda-followtip-wrap:hover .nuda-followtip {\n opacity: 1;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .nuda-followtip {\n transition: none;\n transform: translate3d(0, calc(100% + 8px), 0);\n }\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":"Tooltips, Follow Cursor Tip, 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"]}]}

Follow Cursor Tip

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

TooltipsHTMLCSSany framework
Move over me

Copy into your project

HTML
<!-- Follow Cursor Tip — vanilla JS updates --tx / --ty on pointermove -->
<div class="nuda-followtip-wrap" id="followtip">
  <span class="nuda-followtip__area">Move over me</span>
  <span class="nuda-followtip" role="tooltip">Right here</span>
</div>

<script>
  const wrap = document.getElementById("followtip");
  wrap.addEventListener("pointermove", (e) => {
    const r = wrap.getBoundingClientRect();
    wrap.style.setProperty("--tx", (e.clientX - r.left) + "px");
    wrap.style.setProperty("--ty", (e.clientY - r.top) + "px");
  });
</script>
CSS
/* Follow Cursor Tip
   A tooltip that trails the cursor inside the trigger area.
   Position is driven by --tx / --ty custom properties set in JS.
   Customize: --followtip-bg, offset (14px) */

.nuda-followtip-wrap {
  --tx: 0px;
  --ty: 0px;
  position: relative;
  display: inline-block;
  cursor: default;
}

.nuda-followtip__area {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #ccc;
  font-size: 0.85rem;
}

.nuda-followtip {
  --followtip-bg: #e4ff54;
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(calc(var(--tx) + 14px), calc(var(--ty) + 14px), 0);
  background: var(--followtip-bg);
  color: #09090b;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 10;
}

.nuda-followtip-wrap:hover .nuda-followtip {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .nuda-followtip {
    transition: none;
    transform: translate3d(0, calc(100% + 8px), 0);
  }
}

How to use Follow Cursor Tip

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 tooltips components

← Browse all NudaUI components