{"id":16467310,"url":"https://github.com/elforastero/use-click-outside","last_synced_at":"2025-03-16T18:31:28.450Z","repository":{"id":46917648,"uuid":"209752378","full_name":"ElForastero/use-click-outside","owner":"ElForastero","description":"React hook to detect clicks outside of the components. With shadow DOM support.","archived":false,"fork":false,"pushed_at":"2023-01-07T09:54:17.000Z","size":700,"stargazers_count":24,"open_issues_count":17,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T12:08:29.534Z","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/ElForastero.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-09-20T09:19:49.000Z","updated_at":"2023-09-08T17:58:12.000Z","dependencies_parsed_at":"2023-02-06T20:45:49.909Z","dependency_job_id":null,"html_url":"https://github.com/ElForastero/use-click-outside","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/ElForastero%2Fuse-click-outside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fuse-click-outside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fuse-click-outside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElForastero%2Fuse-click-outside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElForastero","download_url":"https://codeload.github.com/ElForastero/use-click-outside/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826788,"owners_count":20354220,"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-10-11T11:46:55.834Z","updated_at":"2025-03-16T18:31:27.806Z","avatar_url":"https://github.com/ElForastero.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eWelcome to use-click-outside 👋\u003c/h1\u003e\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/use-click-outside\"\u003e\n    \u003cimg alt=\"Version\" src=\"https://img.shields.io/npm/v/use-click-outside.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003e React hook to execute callback when a click is happened outside of component.\n\n## Install\n\n```sh\nyarn add use-click-outside\n```\n\n## Usage\n\n```jsx\nimport React, { useRef } from 'react';\nimport useClickOutside from 'use-click-outside';\n\nconst Modal = ({ onClose }) =\u003e {\n  const ref = useRef();\n  useClickOutside(ref, onClose);\n\n  return \u003cdialog ref={ref}\u003eHello, World!\u003c/dialog\u003e;\n};\n```\n\nOr if you need a custom event type instead of default 'click', third parameter can be passed:\n\n```js\n  useClickOutside(ref, onClose, 'mousedown');\n```\n\n## Show your support\n\nGive a ⭐️ if this project helped you!\n\n***\n_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felforastero%2Fuse-click-outside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felforastero%2Fuse-click-outside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felforastero%2Fuse-click-outside/lists"}