{"id":21224262,"url":"https://github.com/sam-parsons/react-shape-detect","last_synced_at":"2025-06-11T14:33:40.518Z","repository":{"id":57344520,"uuid":"326332692","full_name":"sam-parsons/react-shape-detect","owner":"sam-parsons","description":"shape detection api integration component","archived":false,"fork":false,"pushed_at":"2021-06-01T01:27:21.000Z","size":451,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-27T13:49:52.953Z","etag":null,"topics":["react","shape-detection-api"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-shape-detect","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/sam-parsons.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}},"created_at":"2021-01-03T05:12:20.000Z","updated_at":"2023-03-09T03:58:18.000Z","dependencies_parsed_at":"2022-09-11T09:01:01.621Z","dependency_job_id":null,"html_url":"https://github.com/sam-parsons/react-shape-detect","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-parsons%2Freact-shape-detect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-parsons%2Freact-shape-detect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-parsons%2Freact-shape-detect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-parsons%2Freact-shape-detect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sam-parsons","download_url":"https://codeload.github.com/sam-parsons/react-shape-detect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sam-parsons%2Freact-shape-detect/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280657,"owners_count":22833433,"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":["react","shape-detection-api"],"created_at":"2024-11-20T22:57:31.076Z","updated_at":"2025-06-11T14:33:40.491Z","avatar_url":"https://github.com/sam-parsons.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-shape-detect\n![CI](https://github.com/sam-parsons/react-shape-detect/workflows/Node.js%20CI/badge.svg)\n\n\u003e A React component integration with the Shape Detection API. Provides coordinate data and overlay capabilites.\n\n\n## Install\n\n```\n$ npm i react-shape-detect\n```\n\n\n## Usage\n\n```js\nimport ShapeDetect from 'react-shape-detect';\n\nconst path = 'path-or-url-to-image';\nconst overlay = 'path-or-url-to-overlay';\n\nconst func = function(data) {\n  console.log('objects detected: ', data);\n}\n\nexport default function App() {\n  const overlayOptions = { \n    input: overlay,\n    options: {\n      width: '70%'\n    }\n  };\n  \n  return (\n    \u003cShapeDetect \n      image={path} \n      onRender={func} \n      options={{ type: 'face', overlay: overlayOptions }} \n    /\u003e\n  );\n}\n```\n\n## Basic Props\n\n### image\n\n\u003e `string` | _required_\n\nPath to image\n\n### onRender\n\n\u003e `function(data: any)` | defaults to: `(data) =\u003e void`\n\nCallback is executed with the onLoad event of the `\u003cimg/\u003e` tag. \u003cbr\u003e\nReturns coordinate data from matches on criteria defined in options object.\n\n### options\n\n\u003e `object`\n\nDetector type, custom Shape Detector API options, and HTML img tag attributes\n\n```js\n{\n  type?: string // 'barcode', 'text' // default 'face'\n  attributes?: React.CSSProperties,\n  resizeDebounce?: number // default 250(ms)\n  overlay?: {\n    input: string || ReactComponent,\n    options?: {\n      width?: string, // auto height or set height independently\n      height?: string,\n      offset?: { // in pixels\n        top?: number,\n        left?: number\n      }\n    }\n  }\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-parsons%2Freact-shape-detect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsam-parsons%2Freact-shape-detect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsam-parsons%2Freact-shape-detect/lists"}