{
  "id": "user-hover-card",
  "name": "User Hover Card",
  "category": "effects",
  "tags": [
    "hover card",
    "rich tooltip",
    "profile preview",
    "mention",
    "focus-within",
    "popover"
  ],
  "description": "A rich tooltip that previews a user profile when you hover or tab to an @mention, and stays open while you use it.",
  "url": "https://copy-css.com/snippets/user-hover-card",
  "markdown": "https://copy-css.com/snippets/user-hover-card.md",
  "html": "<p class=\"mention-text\">\n  Thanks to\n  <span class=\"hover-card\">\n    <a href=\"#\" aria-describedby=\"hover-card-mira\">@mira</a>\n    <span class=\"hover-card-panel\" id=\"hover-card-mira\" role=\"tooltip\">\n      <span class=\"hover-card-avatar\" aria-hidden=\"true\">MO</span>\n      <strong>Mira Okafor</strong>\n      <span>Design engineer. Builds tiny tools.</span>\n    </span>\n  </span>\n  for the review.\n</p>",
  "css": ".mention-text {\n  max-width: 260px;\n  margin: 0;\n  color: #44403c;\n  font: 16px/1.6 system-ui, sans-serif;\n}\n\n.hover-card {\n  position: relative;\n  display: inline-block;\n}\n\n.hover-card > a {\n  color: #7c3aed;\n  font-weight: 700;\n  text-decoration: none;\n}\n\n.hover-card > a:focus-visible {\n  outline: 2px solid #7c3aed;\n  outline-offset: 2px;\n  border-radius: 3px;\n}\n\n.hover-card-panel {\n  position: absolute;\n  top: 100%;\n  left: 50%;\n  z-index: 10;\n  display: grid;\n  gap: 2px;\n  width: 200px;\n  margin-top: 8px;\n  padding: 14px;\n  border: 1px solid #e7e5e4;\n  border-radius: 14px;\n  background: #fff;\n  box-shadow: 0 16px 32px -12px rgba(28, 25, 23, 0.3);\n  color: #57534e;\n  font-size: 13px;\n  line-height: 1.4;\n  opacity: 0;\n  visibility: hidden;\n  translate: -50% 6px;\n  transition: opacity 0.2s ease, translate 0.2s ease, visibility 0.2s;\n}\n\n.hover-card-panel::before {\n  content: \"\";\n  position: absolute;\n  bottom: 100%;\n  left: 0;\n  right: 0;\n  height: 10px;\n}\n\n.hover-card:hover .hover-card-panel,\n.hover-card:focus-within .hover-card-panel {\n  opacity: 1;\n  visibility: visible;\n  translate: -50% 0;\n}\n\n.hover-card-avatar {\n  display: grid;\n  place-items: center;\n  width: 40px;\n  height: 40px;\n  margin-bottom: 6px;\n  border-radius: 50%;\n  background: linear-gradient(135deg, #a78bfa, #6d28d9);\n  color: #fff;\n  font-size: 14px;\n  font-weight: 700;\n}\n\n.hover-card-panel strong {\n  color: #1c1917;\n  font-size: 15px;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .hover-card-panel {\n    transition: none;\n  }\n}",
  "features": [
    "transitions",
    "linear gradients",
    "box shadows",
    "CSS Grid",
    "keyboard focus styles",
    "reduced-motion support"
  ],
  "customProperties": []
}
