Skip to content

Fade Tooltip

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

TooltipsHTMLCSSany framework

Copy into your project

HTML
<div class="nuda-fade-tooltip-wrap">
  <button class="nuda-fade-tooltip__trigger" aria-describedby="fade-tip-1">
    Hover me
  </button>
  <div class="nuda-fade-tooltip" role="tooltip" id="fade-tip-1">
    This is a tooltip
  </div>
</div>
CSS
/* Fade Tooltip
   Tooltip that fades in on hover above the trigger.
   Customize: --tooltip-bg, --tooltip-text, --tooltip-radius */

.nuda-fade-tooltip-wrap {
  position: relative;
  display: inline-block;
}

.nuda-fade-tooltip__trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ccc;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.nuda-fade-tooltip {
  --tooltip-bg: #1a1a1a;
  --tooltip-text: #ccc;
  --tooltip-radius: 6px;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--tooltip-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--tooltip-text);
  font-size: 0.75rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--tooltip-radius);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nuda-fade-tooltip-wrap:hover .nuda-fade-tooltip {
  opacity: 1;
}

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

How to use Fade Tooltip

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