{"id":13403115,"url":"https://github.com/aautio/react-modal-image","last_synced_at":"2025-03-14T08:31:26.989Z","repository":{"id":28436234,"uuid":"118373913","full_name":"aautio/react-modal-image","owner":"aautio","description":"A tiny React component providing modal image Lightbox.","archived":false,"fork":false,"pushed_at":"2024-01-30T15:24:34.000Z","size":2521,"stargazers_count":197,"open_issues_count":23,"forks_count":64,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T22:23:35.701Z","etag":null,"topics":["image","lightbox","modal","react"],"latest_commit_sha":null,"homepage":"https://aautio.github.io/react-modal-image/","language":"JavaScript","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/aautio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2018-01-21T21:06:19.000Z","updated_at":"2024-10-14T12:44:00.000Z","dependencies_parsed_at":"2024-01-16T10:35:24.837Z","dependency_job_id":"8e4662a5-a9f4-403f-8675-0501e4c3577b","html_url":"https://github.com/aautio/react-modal-image","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":"0.059523809523809534","last_synced_commit":"83e375e26ab8f520f7af57962ea5ab522f45a70c"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aautio%2Freact-modal-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aautio%2Freact-modal-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aautio%2Freact-modal-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aautio%2Freact-modal-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aautio","download_url":"https://codeload.github.com/aautio/react-modal-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243547362,"owners_count":20308693,"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":["image","lightbox","modal","react"],"created_at":"2024-07-30T19:01:25.607Z","updated_at":"2025-03-14T08:31:26.981Z","avatar_url":"https://github.com/aautio.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# react-modal-image\n\n[![npm package][npm-badge]][npm]\n\nA _lightweight_ React component providing modal image Lightbox.\n\n[DEMO](https://aautio.github.io/react-modal-image/)\n\n## Features\n\n- Only _3 kB_ when gzipped.\n- Zero dependencies.\n- Includes builds for CommonJS and ES modules.\n- For React 16.x, 17.x and 18.x.\n- Esc, Enter \u0026 click outside the image close the lightbox\n- User can zoom \u0026 move the image or download the highest quality one\n- Download and Zoom -buttons can be hidden.\n- Image alt shown as title of lightbox\n- Background color of transparent images can be overridden.\n\nYou need to bring your own `Set` and `fetch` polyfills if you use old Internet Explorers.\n\n## Simple API\n\n```js\nimport ModalImage from \"react-modal-image\";\n\n\u003cModalImage\n  small={urlToTinyImageFile}\n  large={urlToHugeImageFile}\n  alt=\"Hello World!\"\n/\u003e;\n```\n\n| Prop                   | Type      | Description                                                                                                   |\n| ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------- |\n| `className`            | `String`  | Optional. `class` for the small preview image.                                                                |\n| `alt`                  | `String`  | Optional. `alt` for the small image and the heading text in Lightbox.                                         |\n| `small`                | `URL`     | `src` for the small preview image.                                                                            |\n| `smallSrcSet`          | `String`  | Optional. `srcSet` for the small preview image.                                                               |\n| `medium`               | `URL`     | Optional if `large` is defined. Image shown when zoomed out in Lightbox.                                      |\n| `large`                | `URL`     | Optional if `medium` is defined. Image shown when zoomed in Lightbox. Downloadable.                           |\n| `hideDownload`         | `boolean` | Optional. Set to `true` to hide download-button from the Lightbox.                                            |\n| `hideZoom`             | `boolean` | Optional. Set to `true` to hide zoom-button from the Lightbox.                                                |\n| `showRotate`           | `boolean` | Optional. Set to `true` to show rotate-button within the Lightbox.                                            |\n| `imageBackgroundColor` | `String`  | Optional. Background color of the image shown in Lightbox. Defaults to black. Handy for transparent images.   |\n\n## Lightbox-only API for advanced usage\n\nYou can also choose to import only the Lightbox.\n\nTo use the Lightbox only, you'll need to handle the open state by yourself:\n\n```js\nimport { Lightbox } from \"react-modal-image\";\n\n// ...\n\nconst closeLightbox = () =\u003e {\n  this.state.open = true;\n};\n\n// ...\n\n{\n  this.state.open \u0026\u0026 (\n    \u003cLightbox\n      medium={urlToLargeImageFile}\n      large={urlToHugeImageFile}\n      alt=\"Hello World!\"\n      onClose={this.closeLightbox}\n    /\u003e\n  );\n}\n```\n\n| Prop      | Type       | Description                                             |\n| --------- | ---------- | ------------------------------------------------------- |\n| `onClose` | `function` | Will be invoked when the Lightbox requests to be closed |\n\n[npm-badge]: https://img.shields.io/npm/v/react-modal-image.svg\n[npm]: https://www.npmjs.org/package/react-modal-image\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faautio%2Freact-modal-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faautio%2Freact-modal-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faautio%2Freact-modal-image/lists"}