{"id":51820536,"url":"https://github.com/h-k-dev/angular-tooltips","last_synced_at":"2026-07-24T14:00:38.105Z","repository":{"id":367410934,"uuid":"1280651458","full_name":"h-k-dev/angular-tooltips","owner":"h-k-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-03T20:58:06.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-03T22:23:29.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h-k-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-25T19:57:24.000Z","updated_at":"2026-07-03T20:57:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/h-k-dev/angular-tooltips","commit_stats":null,"previous_names":["h-k-dev/angular-tooltips"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/h-k-dev/angular-tooltips","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h-k-dev%2Fangular-tooltips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h-k-dev%2Fangular-tooltips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h-k-dev%2Fangular-tooltips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h-k-dev%2Fangular-tooltips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h-k-dev","download_url":"https://codeload.github.com/h-k-dev/angular-tooltips/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h-k-dev%2Fangular-tooltips/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35844578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-24T02:00:07.870Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-22T05:00:25.538Z","updated_at":"2026-07-24T14:00:38.090Z","avatar_url":"https://github.com/h-k-dev.png","language":"TypeScript","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Tooltips"],"readme":"# @h-k-dev/angular-tooltips\n\n[![npm version](https://img.shields.io/npm/v/@h-k-dev/angular-tooltips.svg)](https://www.npmjs.com/package/@h-k-dev/angular-tooltips)\n[![CI/CD](https://github.com/h-k-dev/angular-tooltips/actions/workflows/ci.yml/badge.svg)](https://github.com/h-k-dev/angular-tooltips/actions/workflows/ci.yml)\n[![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n\u003e [!WARNING]\n\u003e **Experimental — Chrome only for now.** This library is built on bleeding-edge platform\n\u003e features (CSS Anchor Positioning, `position-visibility`, anchored container queries, and\n\u003e Interest Invokers) that are currently only fully supported in Chrome and other Chromium-based\n\u003e browsers. Everywhere else the directive degrades to the native `title` attribute. Expect\n\u003e breaking changes while the underlying specs and this API settle.\n\nModern, lightweight tooltips for Angular. One singleton popover element, positioned entirely by\n**CSS Anchor Positioning** — no overlay module, no scroll listeners, no per-trigger DOM.\n\n**[Live demo →](https://h-k-dev.github.io/angular-tooltips/)**\n\n## Why another tooltip library?\n\n- **Singleton architecture** — a single tooltip element is re-pointed between anchors instead of\n  being destroyed and recreated. Sweep across a dense grid and the tooltip *glides*; the enter\n  animation never restarts mid-sweep (the classic `MatTooltip` flicker).\n- **Top layer, always** — the tooltip is a native `[popover]`, so it renders above dialogs and is\n  never clipped by `overflow` or `z-index` stacking contexts.\n- **CSS does the work** — placement, auto-flipping at the viewport edge, tail direction, and\n  hide-when-scrolled-out (`position-visibility: anchors-visible`) are all handled by the browser.\n- **Browser-native triggering for links** — on `\u003ca href\u003e` elements in supporting browsers, the\n  [Interest Invokers](https://developer.chrome.com/blog/interestfor) (`interestfor`) path is used:\n  the browser owns hover, keyboard focus, touch long-press, and delays.\n- **Works on any element** — `\u003cbutton\u003e`, `\u003ca\u003e`, `\u003cspan\u003e`, `\u003cdiv\u003e`, `\u003cimg\u003e`, `\u003cinput\u003e`, icons,\n  component hosts…\n- **Graceful degradation** — browsers without CSS Anchor Positioning fall back to the native\n  `title` attribute.\n\n## Installation\n\n```bash\nnpm install @h-k-dev/angular-tooltips\n```\n\n## Usage\n\nImport the standalone directive and attach it to anything:\n\n```ts\nimport { Component } from '@angular/core';\nimport { HkTooltip } from '@h-k-dev/angular-tooltips';\n\n@Component({\n  selector: 'app-demo',\n  imports: [HkTooltip],\n  template: `\n    \u003cbutton [hkTooltip]=\"'Save your progress'\"\u003eSave\u003c/button\u003e\n\n    \u003cbutton hkTooltip=\"Deletes immediately\" hkTooltipPlacement=\"right\" [hkTooltipDelay]=\"300\"\u003e\n      Delete\n    \u003c/button\u003e\n\n    \u003ca href=\"/docs\" hkTooltip=\"Opens the documentation\"\u003eDocs\u003c/a\u003e\n  `,\n})\nexport class Demo {}\n```\n\n## API\n\n### `[hkTooltip]` directive\n\n| Input                | Type                                     | Default | Description                                     |\n| -------------------- | ---------------------------------------- | ------- | ----------------------------------------------- |\n| `hkTooltip`          | `string` (required)                      | —       | Tooltip text.                                   |\n| `hkTooltipPlacement` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | `'top'` | Preferred side; auto-flips when space runs out. |\n| `hkTooltipDelay`     | `number` (ms)                            | `0`     | Delay before showing.                           |\n| `hkTooltipHideDelay` | `number` (ms)                            | `80`    | Delay before hiding.                            |\n\n### `[hkTooltipRoot]` directive\n\nOptional. Scopes the event delegation to a subtree (for example a virtualized grid) instead of\n`document.body`.\n\n## Theming\n\nThe tooltip is styled through CSS custom properties with the **`--tt-` prefix**. Every variable\nfalls back to the **Angular Material tooltip tokens**, then the **`--mat-sys-*` system tokens**,\nthen a built-in default:\n\n```text\n--tt-*  (your theme)  →  --mat-tooltip-*  →  --mat-sys-*  →  default\n```\n\nWith an Angular Material theme present, the tooltip matches it out of the box. Without Material,\nthe defaults give you the familiar dark M3 look. Override on `:root` (or any ancestor of `\u003cbody\u003e`):\n\n```css\n:root {\n  --tt-container-color: #1e293b;\n  --tt-text-color: #e2e8f0;\n  --tt-border-radius: 8px;\n  --tt-max-width: 320px;\n}\n```\n\n| Variable              | Purpose                       | Material fallback                                                       | Default             |\n| --------------------- | ----------------------------- | ----------------------------------------------------------------------- | ------------------- |\n| `--tt-container-color`| Background of bubble and tail | `--mat-tooltip-container-color` → `--mat-sys-inverse-surface`            | `#313033`           |\n| `--tt-text-color`     | Text color                    | `--mat-tooltip-supporting-text-color` → `--mat-sys-inverse-on-surface`   | `#f4eff4`           |\n| `--tt-border-radius`  | Corner radius                 | `--mat-tooltip-container-shape` → `--mat-sys-corner-extra-small`         | `4px`               |\n| `--tt-font-family`    | Font family                   | `--mat-tooltip-supporting-text-font` → `--mat-sys-body-small-font`       | `Roboto, sans-serif`|\n| `--tt-font-size`      | Font size                     | `--mat-tooltip-supporting-text-size` → `--mat-sys-body-small-size`       | `12px`              |\n| `--tt-font-weight`    | Font weight                   | `--mat-tooltip-supporting-text-weight` → `--mat-sys-body-small-weight`   | `400`               |\n| `--tt-line-height`    | Line height                   | `--mat-tooltip-supporting-text-line-height` → `--mat-sys-body-small-line-height` | `1.4`       |\n| `--tt-letter-spacing` | Letter spacing                | `--mat-tooltip-supporting-text-tracking` → `--mat-sys-body-small-tracking` | `0.033em`         |\n| `--tt-shadow`         | Box shadow                    | —                                                                        | `none`              |\n| `--tt-padding`        | Inner padding                 | —                                                                        | `6px 10px`          |\n| `--tt-max-width`      | Maximum width                 | —                                                                        | `280px`             |\n| `--tt-gap`            | Distance from the anchor      | —                                                                        | `8px`               |\n| `--tt-tail-size`      | Tail (arrow) size             | —                                                                        | `6px`               |\n| `--tt-enter-duration` | Slide-in duration             | —                                                                        | `0.3s`              |\n| `--tt-fade-duration`  | Fade-in duration              | —                                                                        | `0.15s`             |\n| `--tt-slide-distance` | Slide-in distance             | —                                                                        | `10px`              |\n\n\u003e Keep `--tt-tail-size` smaller than `--tt-gap`, so the tail never overlaps the trigger.\n\n## Browser support\n\n| Capability                                   | Behaviour                                                       |\n| -------------------------------------------- | --------------------------------------------------------------- |\n| [CSS Anchor Positioning](https://caniuse.com/css-anchor-positioning) | Full experience: singleton popover, auto-flip, scroll tracking. |\n| Interest Invokers (`interestfor`)            | Additionally: browser-native triggering on `\u003ca href\u003e` links.    |\n| Neither                                      | Falls back to the native `title` attribute.                     |\n\n## Development\n\n```bash\nnpm start                        # demo app on http://localhost:4200\nnpm run test:ci                  # headless vitest suite\nnpm run build angular-tooltips   # build the library into dist/\n```\n\nReleases are automated with semantic-release: conventional commits pushed to `main` (or `beta`\nfor prereleases) publish to npm and GitHub Packages and deploy the demo to GitHub Pages.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh-k-dev%2Fangular-tooltips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh-k-dev%2Fangular-tooltips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh-k-dev%2Fangular-tooltips/lists"}