{"id":15420228,"url":"https://github.com/andrewbranch/react-use-hover","last_synced_at":"2025-04-13T05:40:35.883Z","repository":{"id":34043536,"uuid":"166767369","full_name":"andrewbranch/react-use-hover","owner":"andrewbranch","description":"State hook to determine whether a React element is being hovered","archived":false,"fork":false,"pushed_at":"2023-01-03T16:05:03.000Z","size":647,"stargazers_count":59,"open_issues_count":18,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T22:21:37.293Z","etag":null,"topics":["hooks","hooks-api-react","react"],"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/andrewbranch.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":"2019-01-21T07:24:56.000Z","updated_at":"2024-07-29T07:51:32.000Z","dependencies_parsed_at":"2023-01-15T04:10:36.871Z","dependency_job_id":null,"html_url":"https://github.com/andrewbranch/react-use-hover","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewbranch%2Freact-use-hover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewbranch%2Freact-use-hover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewbranch%2Freact-use-hover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewbranch%2Freact-use-hover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewbranch","download_url":"https://codeload.github.com/andrewbranch/react-use-hover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670515,"owners_count":21142899,"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":["hooks","hooks-api-react","react"],"created_at":"2024-10-01T17:28:41.432Z","updated_at":"2025-04-13T05:40:35.664Z","avatar_url":"https://github.com/andrewbranch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-use-hover [![Build Status](https://travis-ci.com/andrewbranch/react-use-hover.svg?branch=master)](https://travis-ci.com/andrewbranch/react-use-hover) [![NPM Version](https://img.shields.io/npm/v/react-use-hover.svg)](https://www.npmjs.com/package/react-use-hover) [![Minified size](https://img.shields.io/bundlephobia/min/react-use-hover.svg)](https://www.npmjs.com/package/react-use-hover) [![Greenkeeper badge](https://badges.greenkeeper.io/andrewbranch/react-use-hover.svg)](https://greenkeeper.io/)\n\nA React state hook to determine whether a React element is being hovered.\n\n## Installation\n\n```\nnpm install react-use-hover\n```\n\n## Usage\n\n```js\nimport useHover from 'react-use-hover';\n\nfunction Tooltip() {\n  const [isHovering, hoverProps] = useHover();\n  return (\n    \u003c\u003e\n      \u003cspan {...hoverProps} aria-describedby=\"overlay\"\u003eHover me\u003c/span\u003e\n      \u003cOverlay visible={isHovering} role=\"tooltip\" id=\"overlay\"\u003e\n        I’m a lil popup or something!\n      \u003c/Overlay\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n### Options\n\n```js\nuseHover({\n  mouseEnterDelayMS,\n  mouseLeaveDelayMS\n})\n```\n\n- **`mouseEnterDelayMS: number = 200`**. The number of milliseconds to delay before setting the `isHovering` state to `true`. (Mousing back out during this delay period will cancel the state change.)\n- **`mouseLeaveDelayMS: number = 0`**. The number of milliseconds to delay before setting the `isHovering` state to `false`. (Mousing back in during this period will cancel the state change.)\n\n## Testing\n\n```bash\n# Run once, with coverage\nnpm run test\n\n# Watch mode\nnpm run test -- --watch\n\n# Do whatever you want\nnpx jest src # --any --jest --options\n```\n\n## Contributing\n\nPRs welcome! Please ensure you `npm run build` and commit before pushing (to run prettier) and maintain 100% test coverage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewbranch%2Freact-use-hover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewbranch%2Freact-use-hover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewbranch%2Freact-use-hover/lists"}