{"id":13436775,"url":"https://github.com/jossmac/react-images","last_synced_at":"2025-05-13T23:09:31.807Z","repository":{"id":47462775,"uuid":"42211141","full_name":"jossmac/react-images","owner":"jossmac","description":"🌄 A mobile-friendly, highly customizable, carousel component for displaying media in ReactJS","archived":false,"fork":false,"pushed_at":"2024-05-20T20:03:02.000Z","size":12231,"stargazers_count":2341,"open_issues_count":50,"forks_count":440,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-05-08T13:44:40.271Z","etag":null,"topics":["carousel","lightbox-component","modal-dialogs","react","responsive"],"latest_commit_sha":null,"homepage":"http://jossmac.github.io/react-images","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/jossmac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/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":"2015-09-09T23:57:53.000Z","updated_at":"2025-05-01T00:18:39.000Z","dependencies_parsed_at":"2024-06-18T11:18:04.139Z","dependency_job_id":null,"html_url":"https://github.com/jossmac/react-images","commit_stats":{"total_commits":507,"total_committers":71,"mean_commits":7.140845070422535,"dds":0.7633136094674556,"last_synced_commit":"11f2237e74f7d9053ad34b58a2eb1f7d9746df70"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jossmac%2Freact-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jossmac%2Freact-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jossmac%2Freact-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jossmac%2Freact-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jossmac","download_url":"https://codeload.github.com/jossmac/react-images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254042142,"owners_count":22004849,"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":["carousel","lightbox-component","modal-dialogs","react","responsive"],"created_at":"2024-07-31T03:00:52.029Z","updated_at":"2025-05-13T23:09:26.773Z","avatar_url":"https://github.com/jossmac.png","language":"JavaScript","readme":"# React Images\n\n### ⚠️ Warning!\n\n**Don't use this in a new project.** This package hasn't been properly maintained in a long time and there are much better options available.\n\n**Instead, try...**\n\n- [React Responsive Carousel](http://react-responsive-carousel.js.org/)\n\n---\n\nA mobile-friendly, highly customizable, carousel component for displaying media in ReactJS.\n\n### Browser support\n\nShould work in every major browser... maybe even IE10 and IE11?\n\n### Getting Started\n\nStart by installing `react-images`\n\n```bash\nnpm install react-images\n```\n\nor\n\n```bash\nyarn add react-images\n```\n\n**If you were using `0.x` versions:** library was significantly rewritten for `1.x` version and contains several breaking changes.\nThe best way to upgrade is to read the docs and follow the examples.\n\nPlease note that the default footer parses HTML automatically (such as `\u003cb\u003eI'm bold!\u003c/b\u003e`) but it **does not implement any form of XSS or sanitisation**. You should do that yourself before passing it into the caption field of react-images.\n\n### Using the Carousel\n\nImport the carousel from `react-images` at the top of a\ncomponent and then use it in the render function.\n\n```jsx\nimport React from 'react'\nimport Carousel from 'react-images'\n\nconst images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]\n\nclass Component extends React.Component {\n  render() {\n    return \u003cCarousel views={images} /\u003e\n  }\n}\n```\n\n### Using the Modal\n\nImport the modal and optionally the modal gateway from\n`react-images` at the top of a component and then use it in\nthe render function.\n\nThe `ModalGateway` will insert the modal just before the\nend of your `\u003cbody /\u003e` tag.\n\n```jsx\nimport React from 'react'\nimport Carousel, { Modal, ModalGateway } from 'react-images'\n\nconst images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]\n\nclass Component extends React.Component {\n  state = { modalIsOpen: false }\n  toggleModal = () =\u003e {\n    this.setState(state =\u003e ({ modalIsOpen: !state.modalIsOpen }))\n  }\n  render() {\n    const { modalIsOpen } = this.state\n\n    return (\n      \u003cModalGateway\u003e\n        {modalIsOpen ? (\n          \u003cModal onClose={this.toggleModal}\u003e\n            \u003cCarousel views={images} /\u003e\n          \u003c/Modal\u003e\n        ) : null}\n      \u003c/ModalGateway\u003e\n    )\n  }\n}\n```\n\n### Advanced Image Lists\n\nThe simplest way to define a list of images for the carousel looks like:\n\n```jsx\nconst images = [{ source: 'path/to/image-1.jpg' }, { source: 'path/to/image-2.jpg' }]\n```\n\nHowever, react-images supports several other properties on each image object than just `source`. For example:\n\n```jsx\nconst image = {\n  caption: \"An image caption as a string, React Node, or a rendered HTML string\",\n  alt: \"A plain string to serve as the image's alt tag\",\n  source: {\n    download: \"A URL to serve a perfect quality image download from\",\n    fullscreen: \"A URL to load a very high quality image from\",\n    regular: \"A URL to load a high quality image from\",\n    thumbnail: \"A URL to load a low quality image from\"\n  };\n}\n```\n\nAll these fields are optional except `source`. Additionally, if using an object of URLs (rather than a plain string URL) as your `source`, you must specify the `regular` quality URL.\n","funding_links":[],"categories":["Uncategorized","UI Components","Demos","\u003csummary\u003eUI Components\u003c/summary\u003e","JavaScript"],"sub_categories":["Uncategorized","Photo / Image"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjossmac%2Freact-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjossmac%2Freact-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjossmac%2Freact-images/lists"}