{"id":19554992,"url":"https://github.com/kanety/stimulus-tooltip","last_synced_at":"2025-04-26T22:31:55.408Z","repository":{"id":37762521,"uuid":"506211039","full_name":"kanety/stimulus-tooltip","owner":"kanety","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-21T20:26:16.000Z","size":12,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-04T02:03:05.801Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/kanety.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-06-22T11:06:15.000Z","updated_at":"2023-03-27T23:25:25.000Z","dependencies_parsed_at":"2022-09-09T00:22:06.401Z","dependency_job_id":null,"html_url":"https://github.com/kanety/stimulus-tooltip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Fstimulus-tooltip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Fstimulus-tooltip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Fstimulus-tooltip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kanety%2Fstimulus-tooltip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kanety","download_url":"https://codeload.github.com/kanety/stimulus-tooltip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224039236,"owners_count":17245551,"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-11T04:30:51.067Z","updated_at":"2024-11-11T04:31:26.371Z","avatar_url":"https://github.com/kanety.png","language":"JavaScript","readme":"# stimulus-tooltip\n\nA stimulus controller for simple tooltip.\n\n## Dependencies\n\n* @hotwired/stimulus 3.0\n\n## Installation\n\nInstall from npm:\n\n    $ npm install @kanety/stimulus-tooltip --save\n\n## Usage\n\nRegister controller:\n\n```javascript\nimport { Application } from '@hotwired/stimulus';\nimport TooltipController from '@kanety/stimulus-tooltip';\n\nconst application = Application.start();\napplication.register('tooltip', TooltipController);\n```\n\nImport css:\n\n```css\n@import '@kanety/stimulus-tooltip';\n```\n\nBuild html as follows:\n\n```html\n\u003cspan class=\"st-tooltip\"\n      data-controller=\"tooltip\"\n      data-action=\"mouseover-\u003etooltip#show mouseout-\u003etooltip#hide\"\u003e\n  \u003cspan data-tooltip-target=\"content\"\u003e\n    Content\n  \u003c/span\u003e\n  \u003cspan class=\"st-tooltip__tip\" data-tooltip-target=\"tip\"\u003e\n    Tooltip\n  \u003c/span\u003e\n\u003c/span\u003e\n```\n\n### Options\n\n#### position\n\nShow tooltip at specified position of the content:\n\n```html\n\u003cspan class=\"st-tooltip\"\n      data-controller=\"tooltip\"\n      data-action=\"mouseover-\u003etooltip#show mouseout-\u003etooltip#hide\"\n      data-tooltip-position-value=\"top-start\"\u003e\n  ...\n\u003c/span\u003e\n```\n\nDefault is `top-start`.\nAvailable positions are:\n\n* `top-start`\n* `top-end`\n* `bottom-start`\n* `bottom-end`\n* `left-start`\n* `left-end`\n* `right-start`\n* `right-end`\n\nFollowing shorthands are also available:\n\n* `top`: shorthand of `top-start`\n* `bottom`: shorthand of `bottom-start`\n* `left`: shorthand of `left-start`\n* `right`: shorthand of `right-start`\n\nNote that the position is changed automatically if the tooltip is not visible in the window.\n\n### Callbacks\n\nRun callbacks when a tooltip is shown or hidden:\n\n```javascript\nlet element = document.querySelector('[data-controller=\"tooltip\"]');\nelement.addEventListener('tooltip:shown', (e) =\u003e {\n  console.log('shown: ' + e.detail.tip);\n});\nelement.addEventListener('tooltip:hidden', (e) =\u003e {\n  console.log('hidden: ' + e.detail.tip);\n});\n```\n\n## License\n\nThe library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanety%2Fstimulus-tooltip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkanety%2Fstimulus-tooltip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkanety%2Fstimulus-tooltip/lists"}