{"id":16525763,"url":"https://github.com/art29/react-image-pin","last_synced_at":"2025-10-28T08:31:43.139Z","repository":{"id":219503882,"uuid":"749212771","full_name":"art29/react-image-pin","owner":"art29","description":"React Image Pin is a small React library made to be able to add pins to images. This can be used for maps, cards and more!","archived":false,"fork":false,"pushed_at":"2024-10-07T18:37:22.000Z","size":1228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-10T06:48:59.302Z","etag":null,"topics":["library","npm","react","vite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-image-pin","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/art29.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-27T22:29:06.000Z","updated_at":"2024-10-07T18:37:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf75fb55-35c4-43f5-a102-d7fc3b663084","html_url":"https://github.com/art29/react-image-pin","commit_stats":{"total_commits":57,"total_committers":2,"mean_commits":28.5,"dds":"0.29824561403508776","last_synced_commit":"04912ce70211be482d986cdcc2a429cb4d7eb2e4"},"previous_names":["art29/react-image-pin"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art29%2Freact-image-pin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art29%2Freact-image-pin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art29%2Freact-image-pin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/art29%2Freact-image-pin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/art29","download_url":"https://codeload.github.com/art29/react-image-pin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219859895,"owners_count":16556031,"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":["library","npm","react","vite"],"created_at":"2024-10-11T17:06:38.978Z","updated_at":"2025-10-28T08:31:37.729Z","avatar_url":"https://github.com/art29.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Image Pin\n\nReact Image Pin is a small React library made to be able to add pins to images. This can be used for maps, cards and more!\n\nThis got inspired by this library: https://github.com/galexandrade/react-image-marker.\n\n## Installation\n\nInstall via yarn or npm\n\n```bash\n# Yarn\nyarn add react-image-pin\n\n# NPM\nnpm install react-image-pin\n```\n\n## Props\n\n| Prop               | Type               | Default | Required | Description                                                                                                                                                                                                                    |\n| ------------------ | ------------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| image              | string             | -       | Yes      | The source of the image                                                                                                                                                                                                        |\n| imageAlt           | string             | 'Image' | No       | The alternative text for the image                                                                                                                                                                                             |\n| pins               | ImagePin[]         | `[]`    | No       | An array of pin objects. Each object should have `positionX`, `positionY`, and `id` properties, there is also a optional draggable property to make that pin draggable if the draggable property of the parent is also to true |\n| customPinComponent | React.ReactElement | -       | No       | A custom component to be used as the pin                                                                                                                                                                                       |\n| onNewPin           | function           | -       | No       | A function that is called when a new pin is added. It receives the new pin object as an argument                                                                                                                               |\n| onExistingPin      | function           | -       | No       | A function that is called when a existing pin is clicked. It receives the existing pin object as an argument                                                                                                                   |\n| draggable          | boolean            | false   | No       | A boolean that indicates if the pins should be draggable or not                                                                                                                                                                |\n| onDraggedPin       | function           | -       | No       | A function that is called when a pin is dragged. It receives the pin object as an argument                                                                                                                                     |\n\n## Usage\n\nFirst, import the `ImagePinContainer` component from the library:\n\n```typescript jsx\n { ImagePinContainer } from 'react-image-pin';\n```\n\nThen, use it in your component:\n\n```typescript jsx\nimport Image from './image.png';\n\u003cImagePinContainer\n  image={Image}\n  imageAlt=\"A beautiful image\"\n  draggable={true}\n  pins={[\n    {\n      id: '1',\n      positionX: 0.5,\n      positionY: 0.5,\n    },\n    {\n      id: '2',\n      positionX: 0.2,\n      positionY: 0.8,\n    },\n  ]}\n  onNewPin={(pin) =\u003e console.log(pin)}\n  onExistingPin={(pin) =\u003e console.log(pin)}\n  onDraggedPin={(pin) =\u003e console.log(pin)}\n/\u003e\n```\n\n## Custom Pin Component\n\nYou can use a Custom Pin Component! This can be very useful if you want to do special actions on click, change the style and more!\n\n## Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nAGPL-3.0 (See LICENSE.md for more information)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart29%2Freact-image-pin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fart29%2Freact-image-pin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fart29%2Freact-image-pin/lists"}