{"id":13497221,"url":"https://github.com/drozhzhin-n-e/ng2-tooltip-directive","last_synced_at":"2025-03-28T21:32:10.082Z","repository":{"id":17247697,"uuid":"81422627","full_name":"drozhzhin-n-e/ng2-tooltip-directive","owner":"drozhzhin-n-e","description":"The tooltip is a pop-up tip that appears when you hover over an item or click on it.","archived":false,"fork":false,"pushed_at":"2023-01-07T04:05:12.000Z","size":1168,"stargazers_count":102,"open_issues_count":67,"forks_count":76,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-12T16:32:59.240Z","etag":null,"topics":["angular","angular2","ngx","tooltip"],"latest_commit_sha":null,"homepage":"http://ivylab.space/tooltip","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/drozhzhin-n-e.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}},"created_at":"2017-02-09T07:32:15.000Z","updated_at":"2023-11-11T16:17:45.000Z","dependencies_parsed_at":"2023-01-13T19:14:07.467Z","dependency_job_id":null,"html_url":"https://github.com/drozhzhin-n-e/ng2-tooltip-directive","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drozhzhin-n-e%2Fng2-tooltip-directive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drozhzhin-n-e%2Fng2-tooltip-directive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drozhzhin-n-e%2Fng2-tooltip-directive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drozhzhin-n-e%2Fng2-tooltip-directive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drozhzhin-n-e","download_url":"https://codeload.github.com/drozhzhin-n-e/ng2-tooltip-directive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246105350,"owners_count":20724299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["angular","angular2","ngx","tooltip"],"created_at":"2024-07-31T20:00:26.975Z","updated_at":"2025-03-28T21:32:09.692Z","avatar_url":"https://github.com/drozhzhin-n-e.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized","UI Components"],"sub_categories":["Uncategorized","Tooltip"],"readme":"# Tooltip for Angular\n\n[![Build Status](https://travis-ci.org/drozhzhin-n-e/ng2-tooltip-directive.svg?branch=master)](https://travis-ci.org/drozhzhin-n-e/ng2-tooltip-directive) \u003cimg src=\"https://badgen.net/bundlephobia/min/ng2-tooltip-directive\" /\u003e\n\nThe tooltip is a pop-up tip that appears when you hover over an item or click on it.\n\n🔬️ Help make Tooltips better by [answering a few questions](https://docs.google.com/forms/d/e/1FAIpQLSfuDYQLyGWLApEtnQH5wD2_HNjEM7lV_XJAhrQZEPm14mBZ-A/viewform).\n\n## Demo\nhttp://ivylab.space/tooltip\n\n## Installation\n\nInstall the npm package.\n\n    npm i ng2-tooltip-directive\n        \nImport `Ng2Module`:\n\n```ts\nimport { TooltipModule } from 'ng2-tooltip-directive';\n \n@NgModule({\n    imports: [ TooltipModule ]\n}) \n```\n\n## Usage\n    \nOptions can be set in the directive tag, so they have the highest priority.\n\n```html\n\u003cspan tooltip=\"Tooltip\" placement=\"top\" showDelay=\"500\"\u003eTooltip on top\u003c/span\u003e\n```\n\nYou may pass as an object:\n\n```html\n\u003cspan tooltip=\"Tooltip\" [options]=\"myOptions\"\u003eTooltip on left\u003c/span\u003e\n```\n```ts\nmyOptions = {\n    'placement': 'left',\n    'showDelay': 500\n}\n```\n\nYou can pass HTML as content :\n\n```html\n\u003cspan tooltip=\"\u003cp\u003eHello i'm a \u003cstrong\u003ebold\u003c/strong\u003e text!\u003c/p\u003e\"\u003e\n  Tooltip with HTML content\n\u003c/span\u003e\n```\n\n```html\n\u003cng-template #HtmlContent\u003e\n  \u003cp\u003eHello i'm a \u003cstrong\u003ebold\u003c/strong\u003e text!\u003c/p\u003e\n\u003c/ng-template\u003e\n\n\u003cspan [tooltip]=\"HtmlContent\" contentType=\"template\"\u003e\n  Tooltip with template content\n\u003c/span\u003e\n```\n\n## Set default values\n\nCreate a file with your settings, for example:\n```ts\nimport { TooltipOptions } from 'ng2-tooltip-directive';\n\nexport const MyDefaultTooltipOptions: TooltipOptions = {\n  'show-delay': 500\n}\n```\n    \nAnd pass your parameters when importing the module:\n```ts\nimport { TooltipModule, TooltipOptions } from 'ng2-tooltip-directive';\nimport { MyDefaultTooltipOptions } from './my-default-options';\n \n@NgModule({\n    imports: [ \n      TooltipModule.forRoot(MyDefaultTooltipOptions as TooltipOptions)\n    ]\n})\n```\n\n## Properties\n\n| name             | type                                | default | description                                 |\n|------------------|-------------------------------------|---------|---------------------------------------------|\n| placement        | \"top\", \"bottom\", \"left\", \"right\"    | \"top\"   | The position of the tooltip.                |\n| autoPlacement    | boolean                             | true    | Place the tooltip so that it does not go beyond the borders of the browser window. |\n| showDelay       | number                              | 0       | The delay in ms before showing the tooltip. |\n| hideDelay       | number                              | 300     | The delay in ms before removing the tooltip. |\n| hideDelayTouchscreen | number                          | 0       | Delay in milliseconds before hiding the tooltip (for mobile devices). |\n| display          | boolean                             | true    | Tooltip availability for display.           |\n| displayTouchscreen | boolean                           | true    | Display the tooltip on mobile devices.      |\n| zIndex          | number                              | 0       | Z-index of the tooltip.                     |\n| trigger          | \"hover\", \"click\"                    | \"hover\" | Specifies how the tooltip is triggered. Control the closing time with \"hide-delay\". |\n| tooltipClass    | string                              |         | Classes to be passed to the tooltip.        |\n| animationDuration | number                            | 300     | The duration controls how long the animation takes to run from start to finish. |\n| theme            | \"dark\", \"light\"                     | \"dark\"  | Theme of tooltip background and text.       |\n| shadow           | boolean                             | true    | Shadow of the tooltip.                      |\n| offset           | number                              | 8       | Offset the tooltip relative to the item.    |\n| width            | number                              | undefined | Width of the tooltip.                     |\n| maxWidth        | number                              | 200     | Maximum width of the tooltip.               |\n| contentType     | \"string\", \"html', \"template\"        | \"string\" | The content type passed to the tooltip.    |\n| hideDelayAfterClick | number                           | 2000    | Tooltip hiding delay for \"click\" trigger.   |\n| pointerEvents    | \"auto\", \"none\"                      | \"none\"  | Defines whether or not an element reacts to pointer events. |\n| position         | {top: number, left: number}         | undefined | The tooltip coordinates relative to the browser window. |\n\n## Events\n\nWhen you call events, the delays that are specified in the options in the directive are taken into account. Default delay before tooltip hiding is 300 milliseconds.\n\n| Event            | Description                                                                                 |\n|------------------|---------------------------------------------------------------------------------------------|\n| {type: \"show\", position: DOMRect} | The event is called before the tooltip appears. |\n| {type: \"shown\", position: DOMRect} | The event is called after the animation of the appearance of the tooltip. |\n| {type: \"hide\", position: DOMRect} | The event is called before the tooltip is hidden. |\n| {type: \"hidden\", position: DOMRect} | The event is called after the animation of the tooltip is hidden. |\n\n## Methods\n\nIf you specified the directive options, they will be taken into account when calling methods. Including the delay before the appearance and hiding of the tooltip.\n\n| Method           | Description                                                                                 |\n|------------------|---------------------------------------------------------------------------------------------|\n| show()           | Shows the tooltip                                                                           |\n| hide()           | Hides the tooltip                                                                           |\n\n## Author services\n\nAre you interested in this library but lacks features? [Write to the author](https://github.com/drozhzhin-n-e), he can do it for you.\n\n## Sponsors\n\nWe use Browserstack for cross-browser testing.\n\n[![Browserstack](http://ivylab.space/assets/img/browserstack-logo.png)](http://browserstack.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrozhzhin-n-e%2Fng2-tooltip-directive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrozhzhin-n-e%2Fng2-tooltip-directive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrozhzhin-n-e%2Fng2-tooltip-directive/lists"}