{"id":18888095,"url":"https://github.com/codex-team/codex.tooltips","last_synced_at":"2025-07-16T03:37:11.142Z","repository":{"id":36460368,"uuid":"213326962","full_name":"codex-team/codex.tooltips","owner":"codex-team","description":"JavaScript module to add custom tooltips to any element","archived":false,"fork":false,"pushed_at":"2024-02-15T14:35:17.000Z","size":1057,"stargazers_count":22,"open_issues_count":9,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-19T15:49:25.790Z","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/codex-team.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}},"created_at":"2019-10-07T08:05:48.000Z","updated_at":"2024-07-25T07:34:06.000Z","dependencies_parsed_at":"2024-11-08T07:42:25.799Z","dependency_job_id":"aa06ebe7-a812-4d21-a596-37ecf3e174e3","html_url":"https://github.com/codex-team/codex.tooltips","commit_stats":{"total_commits":42,"total_committers":7,"mean_commits":6.0,"dds":"0.40476190476190477","last_synced_commit":"777e880945025ad10a98de0766d96a0effe97744"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codex-team/codex.tooltips","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcodex.tooltips","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcodex.tooltips/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcodex.tooltips/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcodex.tooltips/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-team","download_url":"https://codeload.github.com/codex-team/codex.tooltips/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-team%2Fcodex.tooltips/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265479626,"owners_count":23773573,"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":[],"created_at":"2024-11-08T07:42:13.502Z","updated_at":"2025-07-16T03:37:11.116Z","avatar_url":"https://github.com/codex-team.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codex.tooltips\n\nLightweight JavaScript module for adding tooltips with custom content\nto any HTML element\n\n\u003cimg src=\"tooltips.png\" style=\"max-width: 100%\"\u003e\n\n## Installation\n\nFirst, install it via package manager:\n\n```shell\nyarn add codex-tooltip\n```\n\n```shell\nnpm install codex-tooltip\n```\n\nThen, include tooltips to your script, create an instance and call hiding/showig methods:\n\n```js\nimport Tooltip from 'codex.tooltip';\n\nconst tooltip = new Tooltip();\n\ntooltip.show(targetElement, 'Tooltip text');\n\n```\n\n## Usage\n\nThere are two main methods: `show()` and `hide()`  \n\n### Show\n\nMethod shows tooltip with custom content on passed element\n \n```js\ntooltip.show(element, content, options);\n``` \n\n| parameter | type | description |\n| -- | -- | -- |\n| `element` | _HTMLElement_ | Tooltip will be showed near this element |\n| `content` | _String_ or _Node_ | Content that will be appended to the Tooltip |\n| `options` | _Object_ | Some displaying options, see below |\n\nAvailable showing options \n\n| name | type | action |\n| -- | -- | -- |\n| placement | `top`, `bottom`, `left`, `right` | Where to place the tooltip. Default value is `bottom' | \n| marginTop | _Number_ | Offset above the tooltip with `top` placement | \n| marginBottom | _Number_ | Offset below the tooltip with `bottom` placement | \n| marginLeft | _Number_ | Offset at left from the tooltip with `left` placement | \n| marginRight | _Number_ | Offset at right from the tooltip with `right` placement | \n| delay | _Number_ | Delay before showing, in ms. Default is `70` | \n| hidingDelay | _Number_ | Delay before hiding, in ms. Default is `0` | \n\n### Hide\n\nMethod hides the Tooltip.\n\n```js\ntooltip.hide();\n```\n\n### Example\n\n```js\nimport Tooltip from 'codex.tooltip';\n\nconst tooltip = new Tooltip();\nconst someButton = document.getElementById('some-button');\n\nsomeButton.addEventListener('mouseenter', () =\u003e {\n  tooltip.show(someButton, 'Button helper');\n});\n\nsomeButton.addEventListener('mouseleave', () =\u003e {\n  tooltip.hide();\n});\n```\n\nIn example above we show tooltip near some button by \"mouseenter\" and hide by \"mouseleave\". \nFor this events you can also use the `onHover()` decorator: \n\n```js\nimport Tooltip from 'codex.tooltip';\n\nconst tooltip = new Tooltip();\nconst someButton = document.getElementById('some-button');\n\ntooltip.onHover(someButton, 'Button helper', {\n  placement: 'right',\n  delay: 150\n})\n```\n\n\n# About CodeX\n\n\u003cimg align=\"right\" width=\"120\" height=\"120\" src=\"https://codex.so/public/app/img/codex-logo.svg\" hspace=\"50\"\u003e\n\nCodeX is a team of digital specialists around the world interested in building high-quality open source products on a global market. We are [open](https://codex.so/join) for young people who want to constantly improve their skills and grow professionally with experiments in cutting-edge technologies.\n\n| 🌐 | Join  👋  | Twitter | Instagram |\n| -- | -- | -- | -- |\n| [codex.so](https://codex.so) | [codex.so/join](https://codex.so/join) |[@codex_team](http://twitter.com/codex_team) | [@codex_team](http://instagram.com/codex_team/) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fcodex.tooltips","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-team%2Fcodex.tooltips","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-team%2Fcodex.tooltips/lists"}