Scale Tooltip
A copy-paste tooltips component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.
TooltipsHTMLCSSany framework
Scales from origin
Copy into your project
HTML
<div class="nuda-scale-tooltip-wrap">
<button class="nuda-scale-tooltip__trigger" aria-describedby="scale-tip-1">
Hover me
</button>
<div class="nuda-scale-tooltip" role="tooltip" id="scale-tip-1">
Scales from origin
</div>
</div>CSS
/* Scale Tooltip
Tooltip that scales up from origin point on hover.
Customize: --tooltip-bg, --tooltip-text */
.nuda-scale-tooltip-wrap {
position: relative;
display: inline-block;
}
.nuda-scale-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-scale-tooltip {
--tooltip-bg: #1a1a1a;
--tooltip-text: #ccc;
position: absolute;
bottom: calc(100% + 8px);
left: 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: 6px;
white-space: nowrap;
opacity: 0;
transform: translateX(-50%) scale(0.85);
transform-origin: center bottom;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
}
.nuda-scale-tooltip-wrap:hover .nuda-scale-tooltip {
opacity: 1;
transform: translateX(-50%) scale(1);
}
@media (prefers-reduced-motion: reduce) {
.nuda-scale-tooltip {
transition: none;
}
}How to use Scale 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.