Skip to content

Avatar with Tooltip

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

AvatarsHTMLCSSany framework
Sara Linde

Copy into your project

HTML
<div class="nuda-avtt">
  <span class="nuda-avtt__avatar"></span>
  <span class="nuda-avtt__tip">Sara Linde</span>
</div>
CSS
.nuda-avtt {
  position: relative;
  display: inline-flex;
}

.nuda-avtt__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg,#9d6dff,#ff6dd4);
  cursor: pointer;
  transition: transform .25s;
}

.nuda-avtt:hover .nuda-avtt__avatar {
  transform: scale(1.08);
}

.nuda-avtt__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  padding: 4px 10px;
  background: #09090b;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  color: #fafafa;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s,transform .35s cubic-bezier(.16,1,.3,1);
}

.nuda-avtt:hover .nuda-avtt__tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

How to use Avatar with 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 avatars components

← Browse all NudaUI components