Skip to content

Photo Preview Tooltip

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

TooltipsHTMLCSSany framework
View Aurora.jpg

Copy into your project

HTML
<div class="nuda-phototip-wrap">
  <a class="nuda-phototip-link" href="#">View Aurora.jpg</a>
  <div class="nuda-phototip" role="tooltip">
    <div class="nuda-phototip__img"
         style="background-image: url(/photo.jpg)"></div>
    <div class="nuda-phototip__meta">
      <span>Aurora.jpg</span>
      <span>1920 × 1080</span>
    </div>
  </div>
</div>
CSS
.nuda-phototip-wrap {
  position: relative;
  display: inline-block;
}

.nuda-phototip-link {
  color: #e4ff54;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.nuda-phototip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 160px;
  padding: 6px;
  background: #0c0c10;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  box-shadow: 0 14px 36px -10px rgba(0,0,0,.6);
  opacity: 0;
  transform: translateY(6px) scale(.96);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity .25s,transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 10;
}

.nuda-phototip-wrap:hover .nuda-phototip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.nuda-phototip__img {
  width: 100%;
  height: 90px;
  border-radius: 6px;
  background: linear-gradient(135deg,#9d6dff,#62b6ff,#6ee7b7);
}

.nuda-phototip__meta {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 2px;
  color: #a0a0a8;
  font-size: 10px;
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
}

.nuda-phototip__meta span:first-child {
  color: #fafafa;
  font-weight: 600;
}

How to use Photo Preview 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