{"id":24568769,"url":"https://github.com/yysuni/react-single-tooltip","last_synced_at":"2025-03-17T05:27:25.468Z","repository":{"id":191610893,"uuid":"681456444","full_name":"YYsuni/react-single-tooltip","owner":"YYsuni","description":"A tiny intelligent tooltip component.","archived":false,"fork":false,"pushed_at":"2023-10-16T08:32:32.000Z","size":2020,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-25T09:42:39.295Z","etag":null,"topics":["function-component","react","react-component","tooltip"],"latest_commit_sha":null,"homepage":"","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/YYsuni.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}},"created_at":"2023-08-22T04:02:08.000Z","updated_at":"2023-09-14T03:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6b402a7-45ac-46d2-bfbb-870bbcd9132b","html_url":"https://github.com/YYsuni/react-single-tooltip","commit_stats":null,"previous_names":["yysuni/react-single-tooltip"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Freact-single-tooltip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Freact-single-tooltip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Freact-single-tooltip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Freact-single-tooltip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YYsuni","download_url":"https://codeload.github.com/YYsuni/react-single-tooltip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243978626,"owners_count":20378070,"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":["function-component","react","react-component","tooltip"],"created_at":"2025-01-23T14:55:20.559Z","updated_at":"2025-03-17T05:27:25.435Z","avatar_url":"https://github.com/YYsuni.png","language":"TypeScript","readme":"react-single-tooltip is a opinionated tooltip component. It uses no dependencies. so, it is tiny yet intelligent.\n\n## Usage\n\nTo start using the library, install it in your project:\n\n```bash\nnpm install react-single-tooltip\n```\n\nAdd `\u003cSingleTooltip /\u003e` to your app, it will be the place where all your tooltip will be rendered.\nAfter that you can use `useTooltip()` hook in your component.\n\n```jsx\nimport { useTooltipRef, SingleTooltip } from 'react-single-tooltip';\n\nfunction App() {\n  const ref = useTooltipRef(\"Tooltip content\")\n  \n  return (\n    \u003cdiv\u003e\n      \u003cSingleTooltip /\u003e\n      \u003cbutton ref={ref}\u003eHover me\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## Props\n\n### SingleTooltip component\n\n| Name            | Type             | Default                    | Description         |\n| :-------------- | :--------------- | :------------------------- | :------------------ |\n| backgroundColor | string           | `rgba(0, 0, 0, 0.8)`       | -                   |\n| zIndex          | number           | 99                         | -                   |\n| borderRadius    | number           | 12                         | -                   |\n| offset          | number \\| string | 4                          | container padding   |\n| padding         | number \\| string | 12                         | content padding     |\n| fontSize        | number \\| string | 14                         | -                   |\n| fontWeight      | number \\| string | 400                        | -                   |\n| color           | string           | `white`                    | -                   |\n| maxWidth        | number \\| string | `360px`(`200px` in mobile) | -                   |\n| trangleWidth    | number           | 16                         | the bottom triangle |\n| trangleHeight   | number           | 6                          | the bottom triangle |\n\n### useTooltip params\n\n| Name | Type    | Default   | Description |\n| :--- | :------ | :-------- | :---------- |\n| text | string  | undefined | required    |\n| show | boolean | true      | -           |","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysuni%2Freact-single-tooltip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyysuni%2Freact-single-tooltip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysuni%2Freact-single-tooltip/lists"}