{
  "element": "nve-tooltip",
  "entrypoint": "@nvidia-elements/core/tooltip/tooltip.examples.json",
  "items": [
    {
      "id": "tooltip",
      "name": "Default",
      "template": "<nve-tooltip id=\"tooltip\">hello there</nve-tooltip>\n<nve-button interestfor=\"tooltip\">button</nve-button>\n",
      "summary": "Basic tooltip triggered by popovertarget attribute. Use for providing brief, contextual information on hover or focus without cluttering the interface.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-visual",
      "name": "Visual",
      "template": "<nve-tooltip anchor=\"btn\">hello there</nve-tooltip>\n<nve-button id=\"btn\">button</nve-button>\n",
      "summary": "Tooltip using anchor attribute to reference the trigger element. Use when you need to explicitly connect tooltips to their triggers by ID for better control over relationships.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-position",
      "name": "Position",
      "template": "<nve-tooltip anchor=\"btn\" position=\"top\">top</nve-tooltip>\n<nve-tooltip anchor=\"btn\" position=\"right\">right</nve-tooltip>\n<nve-tooltip anchor=\"btn\" position=\"bottom\">bottom</nve-tooltip>\n<nve-tooltip anchor=\"btn\" position=\"left\">left</nve-tooltip>\n<nve-button id=\"btn\">button</nve-button>\n",
      "summary": "Tooltip positioning options for optimal placement relative to trigger elements. Use different positions based on available screen space and content layout to ensure tooltips remain visible and don't obscure important content.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-alignment",
      "name": "Alignment",
      "template": "<nve-tooltip anchor=\"card\" position=\"top\" alignment=\"start\">top start</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"top\">top center</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"top\" alignment=\"end\">top end</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"right\" alignment=\"start\">right start</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"right\">right center</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"right\" alignment=\"end\">right end</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"bottom\" alignment=\"start\">bottom start</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"bottom\">bottom center</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"bottom\" alignment=\"end\">bottom end</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"left\" alignment=\"start\">left start</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"left\">left center</nve-tooltip>\n<nve-tooltip anchor=\"card\" position=\"left\" alignment=\"end\">left end</nve-tooltip>\n<nve-card id=\"card\" style=\"width: 400px; height: 200px\"></nve-card>\n",
      "summary": "Fine-grained tooltip alignment combined with positioning for precise placement control. Use to align tooltips to specific edges of trigger elements, improving visual hierarchy and reducing overlap with other UI elements.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-events",
      "name": "Events",
      "template": "<nve-tooltip id=\"tooltip\">hello there</nve-tooltip>\n<nve-button interestfor=\"tooltip\">button</nve-button>\n<script type=\"module\">\n  const tooltip = document.querySelector(\"nve-tooltip\");\n  tooltip.addEventListener(\"beforetoggle\", () => console.log(\"beforetoggle\"));\n  tooltip.addEventListener(\"toggle\", () => console.log(\"toggle\"));\n  tooltip.addEventListener(\"close\", () => console.log(\"close\"));\n  tooltip.addEventListener(\"open\", () => console.log(\"open\"));\n</script>\n",
      "summary": "Event handling for tooltip lifecycle events. Useful for adding custom behavior when tooltip state changes.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-content",
      "name": "Content",
      "template": "<nve-tooltip anchor=\"btn\" position=\"bottom\">\n  <h3 nve-text=\"label\">Title</h3>\n  <p nve-text=\"body\">some text content</p>\n</nve-tooltip>\n<nve-button id=\"btn\">button</nve-button>\n",
      "summary": "Tooltip with structured content including title and body text. Use for tooltips that need hierarchical information, but keep content brief to maintain tooltip's lightweight nature.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-dynamic-trigger",
      "name": "DynamicTrigger",
      "template": "<nve-tooltip id=\"dynamic-popover\"></nve-tooltip>\n<div nve-layout=\"row gap:sm align:center\">\n  <nve-button interestfor=\"dynamic-popover\">one</nve-button>\n  <nve-button interestfor=\"dynamic-popover\">two</nve-button>\n  <nve-button interestfor=\"dynamic-popover\">three</nve-button>\n</div>\n<script type=\"module\">\n  document.querySelector(\"#dynamic-popover\").addEventListener(\"toggle\", (e) => {\n    if (e.newState === \"open\") {\n      e.target.textContent = \"tooltip \" + e.source.textContent;\n    }\n  });\n</script>\n",
      "summary": "Single tooltip shared across many triggers with dynamic content updates. Use to reduce DOM nodes and improve performance when many similar elements need contextual help, updating tooltip content based on which trigger activated it.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-hint",
      "name": "Hint",
      "template": "<div nve-layout=\"row gap:xs align:vertical-center\">\n  <h2 nve-text=\"heading sm\">Preview</h2>\n  <nve-icon-button container=\"flat\" icon-name=\"information-circle-stroke\" interestfor=\"hint\"></nve-icon-button>\n  <nve-tooltip id=\"hint\" position=\"right\">Preview in progress CI tasks for the active host</nve-tooltip>\n</div>\n",
      "summary": "Tooltip as a hint icon pattern for providing contextual help next to labels or headings. Perfect for explaining features or terminology without cluttering the main interface, allowing users to discover information on demand.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-status",
      "name": "Status",
      "template": "<div nve-layout=\"row align:center\" style=\"height: 250px\">\n  <nve-tooltip anchor=\"btn\">default status</nve-tooltip>\n  <nve-tooltip anchor=\"btn\" position=\"bottom\" status=\"muted\">muted status</nve-tooltip>\n  <nve-button id=\"btn\">button</nve-button>\n</div>\n",
      "summary": "Tooltip with muted status variant for subtle, low-emphasis contextual information. Use muted tooltips when the information is supplementary and shouldn't draw attention away from primary content.",
      "description": "",
      "composition": false,
      "tags": []
    },
    {
      "id": "tooltip-wrap",
      "name": "Wrap",
      "template": "<nve-tooltip anchor=\"btn\" style=\"--width: 200px\">\n  Tooltips provide contextual help for interface elements. Keep content brief and descriptive to help users understand\n  available actions.\n</nve-tooltip>\n<nve-button id=\"btn\">button</nve-button>\n",
      "summary": "Tooltip with constrained width for controlled text wrapping. Use when tooltip content is longer than a single line, but prefer keeping tooltips brief for better scannability and user experience.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-async-trigger",
      "name": "AsyncTrigger",
      "template": "\n<div id=\"async-trigger-demo\">\n  <nve-tooltip id=\"tooltip\">hello there</nve-tooltip>\n  <template><nve-button interestfor=\"tooltip\">button</nve-button></template>\n</div>\n<script type=\"module\">\n  import '@nvidia-elements/core/button/define.js';\n  import '@nvidia-elements/core/tooltip/define.js';\n  const template = document.querySelector('#async-trigger-demo template');\n  const instance = template.content.cloneNode(true);\n  setTimeout(() => {\n    document.querySelector('#async-trigger-demo').appendChild(instance);\n  }, 1000);\n</script>\n  ",
      "summary": "Tooltip anchoring to a dynamically created anchor element.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-position-strategy-absolute",
      "name": "PositionStrategyAbsolute",
      "template": "<nve-button interestfor=\"tooltip\">button</nve-button>\n<nve-tooltip id=\"tooltip\">hello there</nve-tooltip>\n",
      "summary": "Tooltip with absolute positioning strategy for precise placement in complex layouts. Use when default fixed positioning causes issues with scrolling containers or nested positioning contexts.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-scroll-container",
      "name": "ScrollContainer",
      "template": "<style>\n  #scroll-container {\n    display: flex;\n    flex-direction: column;\n    height: 300px;\n    width: 200px;\n    overflow-y: auto;\n    border: 1px solid #ccc;\n    margin: 20vh;\n    & > button {\n      min-height: 50px;\n      width: 100%;\n    }\n  }\n</style>\n<section id=\"scroll-container\">\n  <button interestfor=\"tooltip\">1</button>\n  <button interestfor=\"tooltip\">2</button>\n  <button interestfor=\"tooltip\">3</button>\n  <button interestfor=\"tooltip\">4</button>\n  <button interestfor=\"tooltip\">5</button>\n  <button interestfor=\"tooltip\">6</button>\n  <button interestfor=\"tooltip\">7</button>\n  <button interestfor=\"tooltip\">8</button>\n  <button interestfor=\"tooltip\">9</button>\n  <button interestfor=\"tooltip\">10</button>\n</section>\n<nve-tooltip id=\"tooltip\" position=\"left\">hello there</nve-tooltip>\n",
      "summary": "Tooltip behavior within scrollable containers with automatic repositioning. Tooltips maintain visibility and proper positioning even when anchor elements scroll, ensuring consistent user experience in scrollable interfaces.",
      "description": "",
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-dynamic-anchor-position",
      "name": "DynamicAnchorPosition",
      "template": "<dynamic-anchor-position-demo></dynamic-anchor-position-demo>\n",
      "summary": "Tooltip that follows a dynamically positioned anchor element. Real-time tooltip repositioning as the anchor moves, useful for cursor-following tooltips or drag-and-drop interfaces.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-legacy-dynamic-trigger",
      "name": "LegacyDynamicTrigger",
      "template": "<div id=\"dynamic-trigger-demo\" nve-layout=\"row align:center\" style=\"height: 250px\">\n  <nve-tooltip behavior-trigger hidden>hello there</nve-tooltip>\n  <div nve-layout=\"row gap:xl\">\n    <nve-button>button</nve-button>\n    <nve-button>button</nve-button>\n    <nve-button>button</nve-button>\n  </div>\n  <script type=\"module\">\n    const tooltip = document.querySelector(\"#dynamic-trigger-demo nve-tooltip\");\n    document.querySelector(\"#dynamic-trigger-demo\").addEventListener(\"mouseover\", (e) => {\n      if (e.target.tagName === \"NVE-BUTTON\") {\n        tooltip.anchor = e.target;\n        tooltip.trigger = e.target;\n      }\n    });\n  </script>\n</div>\n",
      "summary": "Legacy pattern for dynamic tooltip triggers using behavior-trigger attribute. Programmatic anchor and trigger reassignment for backward compatibility with older implementations.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-legacy-trigger",
      "name": "LegacyTrigger",
      "template": "<div nve-layout=\"row align:center\" style=\"height: 250px\">\n  <nve-tooltip anchor=\"action-btn\" trigger=\"action-btn\" hidden>hello there</nve-tooltip>\n  <nve-button id=\"action-btn\">button</nve-button>\n  <script type=\"module\">\n    const tooltip = document.querySelector('nve-tooltip[anchor=\"action-btn\"]');\n    tooltip.addEventListener(\"close\", () => (tooltip.hidden = true));\n    tooltip.addEventListener(\"open\", () => (tooltip.hidden = false));\n  </script>\n</div>\n",
      "summary": "Legacy trigger pattern with manual event handling and hidden attribute management. Older implementation approach for backward compatibility; prefer using popovertarget for new implementations.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-legacy-behavior-trigger",
      "name": "LegacyBehaviorTrigger",
      "template": "<nve-tooltip behavior-trigger anchor=\"action-btn\" trigger=\"action-btn\" hidden>hello there</nve-tooltip>\n<nve-button id=\"action-btn\">button</nve-button>\n",
      "summary": "Legacy behavior-trigger pattern for automatic tooltip lifecycle management. Deprecated approach that auto-manages visibility, prefer modern popovertarget API for new implementations.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-legacy-open-delay",
      "name": "LegacyOpenDelay",
      "template": "<nve-tooltip behavior-trigger anchor=\"delay-tooltip-1\" trigger=\"delay-tooltip-1\" open-delay=\"500\" hidden\n  >delayed tooltip</nve-tooltip\n>\n<nve-button id=\"delay-tooltip-1\">button</nve-button>\n<nve-tooltip behavior-trigger anchor=\"delay-tooltip-2\" trigger=\"delay-tooltip-2\" open-delay=\"500\" hidden\n  >delayed tooltip</nve-tooltip\n>\n<nve-button id=\"delay-tooltip-2\">button</nve-button>\n<nve-tooltip behavior-trigger anchor=\"delay-tooltip-3\" trigger=\"delay-tooltip-3\" open-delay=\"500\" hidden\n  >delayed tooltip</nve-tooltip\n>\n<nve-button id=\"delay-tooltip-3\">button</nve-button>\n",
      "summary": "Legacy implementation combining behavior-trigger with open-delay for many tooltips. Older pattern for delayed tooltip appearance; prefer modern popovertarget with open-delay attribute.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-nested-dynamic",
      "name": "NestedDynamic",
      "template": "<nve-button popovertarget=\"dialog\">open</nve-button>\n<nve-dialog id=\"dialog\" size=\"lg\" modal closable>\n  <nve-button interestfor=\"tooltip\">button</nve-button>\n  <section>\n    <button interestfor=\"tooltip\">button</button>\n  </section>\n</nve-dialog>\n<nve-tooltip id=\"tooltip\">test</nve-tooltip>\n",
      "summary": "Tooltip functionality within modal dialogs with many triggers. Ensures tooltips work correctly in layered UI contexts, maintaining proper stacking order and interaction behavior within modal overlays.",
      "description": "",
      "composition": true,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-interest-invokers",
      "name": "InterestInvokers",
      "template": "<section nve-layout=\"row gap:md align:center\">\n  <button popovertarget=\"dropdown\" interestfor=\"tooltip\">open</button>\n  <nve-button popovertarget=\"dropdown\" interestfor=\"tooltip\">open</nve-button>\n  <nve-dropdown id=\"dropdown\">dropdown content</nve-dropdown>\n  <nve-tooltip id=\"tooltip\">tooltip content</nve-tooltip>\n  <div id=\"div\">static</div>\n  <nve-tooltip trigger=\"div\" hidden>static</nve-tooltip>\n</section>\n",
      "summary": "Tooltip functionality using interest invokers to control tooltip visibility on hover and focus.",
      "description": "",
      "composition": true,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-open-delay",
      "name": "OpenDelay",
      "template": "<nve-tooltip id=\"delay-tooltip\" open-delay=\"500\">delayed tooltip</nve-tooltip>\n<nve-button interestfor=\"delay-tooltip\">button</nve-button>\n",
      "summary": "Tooltip with delayed appearance to reduce visual noise during quick mouse movements. Use open-delay for better user experience when tooltips are dense, preventing tooltips from flashing during cursor transitions.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    },
    {
      "id": "tooltip-legacy-popover-target",
      "name": "LegacyPopoverTarget",
      "template": "<nve-button popovertarget=\"tooltip\">open</nve-button>\n<nve-tooltip id=\"tooltip\">tooltip content</nve-tooltip>\n",
      "summary": "Legacy behavior that allowed tooltip triggering via popovertarget attribute instead of interestfor attribute with hover events.",
      "description": "",
      "deprecated": true,
      "composition": false,
      "tags": [
        "test-case"
      ]
    }
  ]
}