{"id":15650228,"url":"https://github.com/hmarr/pick-dom-element","last_synced_at":"2025-04-14T06:37:15.583Z","repository":{"id":41245955,"uuid":"301133618","full_name":"hmarr/pick-dom-element","owner":"hmarr","description":"🖱 A JavaScript library for interactively picking DOM elements","archived":false,"fork":false,"pushed_at":"2023-10-18T13:59:57.000Z","size":49,"stargazers_count":41,"open_issues_count":2,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-08T13:08:06.688Z","etag":null,"topics":["dom","javascript-library","typescript"],"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/hmarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-10-04T13:14:50.000Z","updated_at":"2025-04-02T08:54:20.000Z","dependencies_parsed_at":"2024-06-19T22:49:50.622Z","dependency_job_id":"fcdbdb76-e718-4963-8e46-7f18cce9f6e1","html_url":"https://github.com/hmarr/pick-dom-element","commit_stats":{"total_commits":24,"total_committers":5,"mean_commits":4.8,"dds":"0.16666666666666663","last_synced_commit":"98563b3ef51907a89e15898b81f9b63ef3f67e5d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpick-dom-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpick-dom-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpick-dom-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmarr%2Fpick-dom-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmarr","download_url":"https://codeload.github.com/hmarr/pick-dom-element/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248836291,"owners_count":21169370,"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":["dom","javascript-library","typescript"],"created_at":"2024-10-03T12:34:06.410Z","updated_at":"2025-04-14T06:37:15.552Z","avatar_url":"https://github.com/hmarr.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pick-dom-element\n\n[![npm version](https://badge.fury.io/js/pick-dom-element.svg)](https://badge.fury.io/js/pick-dom-element)\n\nA JavaScript library (written in TypeScript) for interactively picking DOM elements.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/110275/95014911-02d42d80-0642-11eb-856e-301b00f8fbf9.gif\" width=\"500px\" /\u003e\n\u003c/p\u003e\n\n## Usage\n\nCreate an instance of the `ElementPicker` class, and call its `start()` method to start picking. Provide an `onHover` or `onClick` callback to get the picked element(s). Call `stop()` to stop picking and remove the overlay from the DOM.\n\n```javascript\nimport { ElementPicker } from \"pick-dom-element\";\n\nconst style = { borderColor: \"#0000ff\" };\nconst picker = new ElementPicker({ style });\npicker.start({\n  onHover: (el) =\u003e console.log(`Hover: ${el}`),\n  onClick: (el) =\u003e {\n    picker.stop();\n    console.log(`Picked: ${el}`);\n  },\n});\n```\n\nSee the [example](example/) directory for a more complete example of how to use the library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fpick-dom-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmarr%2Fpick-dom-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmarr%2Fpick-dom-element/lists"}