{"id":13671028,"url":"https://github.com/pedropalau/react-bnb-gallery","last_synced_at":"2026-03-06T15:04:41.484Z","repository":{"id":33884094,"uuid":"163304831","full_name":"pedropalau/react-bnb-gallery","owner":"pedropalau","description":"Simple react-based photo gallery inspired by Airbnb image gallery.","archived":false,"fork":false,"pushed_at":"2026-02-25T06:46:54.000Z","size":13763,"stargazers_count":218,"open_issues_count":60,"forks_count":86,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-25T10:25:48.389Z","etag":null,"topics":["create-react-app","create-react-library","image-gallery","javascript","npm-package","photo-gallery","react","reactjs","rollup-js"],"latest_commit_sha":null,"homepage":"https://bnb-gallery.vercel.app/","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/pedropalau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-27T14:42:27.000Z","updated_at":"2026-02-25T06:46:58.000Z","dependencies_parsed_at":"2023-01-15T03:15:54.905Z","dependency_job_id":null,"html_url":"https://github.com/pedropalau/react-bnb-gallery","commit_stats":null,"previous_names":["peterpalau/react-bnb-gallery"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/pedropalau/react-bnb-gallery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropalau%2Freact-bnb-gallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropalau%2Freact-bnb-gallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropalau%2Freact-bnb-gallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropalau%2Freact-bnb-gallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedropalau","download_url":"https://codeload.github.com/pedropalau/react-bnb-gallery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedropalau%2Freact-bnb-gallery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30008924,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T15:15:59.058Z","status":"ssl_error","status_checked_at":"2026-03-02T15:15:58.758Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["create-react-app","create-react-library","image-gallery","javascript","npm-package","photo-gallery","react","reactjs","rollup-js"],"created_at":"2024-08-02T09:00:56.231Z","updated_at":"2026-03-06T15:04:39.499Z","avatar_url":"https://github.com/pedropalau.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp\u003e\n  \u003cimg alt=\"react-bnb-gallery\" width=\"250\" src=\"https://raw.githubusercontent.com/peterpalau/react-bnb-gallery/master/rbg-logo.png\" /\u003e\u003cbr /\u003e\n  Friendly, customizable and accessible-ready simple photo gallery based on React.\n\u003c/p\u003e\n\n\u003cp\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-bnb-gallery\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/react-bnb-gallery.svg\" alt=\"NPM\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://www.npmjs.com/package/react-bnb-gallery\" target=\"_blank\"\u003e\u003cimg src=\"http://img.shields.io/npm/dm/react-bnb-gallery.svg?style=flat\" alt=\"Download Count\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/peterpalau/react-bnb-gallery/actions\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/peterpalau/react-bnb-gallery/actions/workflows/ci.yml/badge.svg\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n------\n\n## Install\n\nYou can install [react-bnb-gallery](https://www.npmjs.com/package/react-bnb-gallery) from [npm](https://www.npmjs.com/).\n\n```bash\nnpm install react-bnb-gallery\n```\n\n```bash\nyarn add react-bnb-gallery\n```\n\n```bash\npnpm add react-bnb-gallery\n```\n\nDon't forget to import the stylesheet:\n\n```js\nimport 'react-bnb-gallery/dist/style.css';\n```\n\n## Usage\n\n```jsx\nimport React, { useState } from 'react';\nimport ReactBnbGallery from 'react-bnb-gallery';\nimport 'react-bnb-gallery/dist/style.css';\n\nconst PHOTOS = [\n  {\n    photo: 'https://example.com/photo1.jpg',\n    thumbnail: 'https://example.com/photo1-thumb.jpg',\n    caption: 'Photo 1',\n    subcaption: 'Author name or location',\n  },\n  {\n    photo: 'https://example.com/photo2.jpg',\n    thumbnail: 'https://example.com/photo2-thumb.jpg',\n    caption: 'Photo 2',\n  },\n];\n\nexport default function App() {\n  const [open, setOpen] = useState(false);\n\n  return (\n    \u003c\u003e\n      \u003cbutton onClick={() =\u003e setOpen(true)}\u003eOpen Gallery\u003c/button\u003e\n      \u003cReactBnbGallery\n        show={open}\n        photos={PHOTOS}\n        onClose={() =\u003e setOpen(false)}\n      /\u003e\n    \u003c/\u003e\n  );\n}\n```\n\n## Props\n\n### `\u003cReactBnbGallery /\u003e`\n\n| Prop | Type | Default | Description |\n|---|---|---|---|\n| `photos` | `Photo[] \\| string[]` | — | **Required.** Array of photo objects or plain URL strings. |\n| `onClose` | `() =\u003e void` | — | **Required.** Callback fired when the gallery is closed. |\n| `show` | `boolean` | `false` | Controls whether the gallery modal is visible. |\n| `activePhotoIndex` | `number` | `0` | Index of the photo shown on open. |\n| `showThumbnails` | `boolean` | `true` | Show the thumbnail strip. |\n| `keyboard` | `boolean` | `true` | Enable keyboard navigation (arrow keys, Escape). |\n| `wrap` | `boolean` | `true` | Cycle continuously through photos instead of hard stops. |\n| `preloadSize` | `number` | `1` | Number of adjacent photos to preload. |\n| `opacity` | `number` | `1` | Background overlay opacity (0–1). |\n| `backgroundColor` | `string` | `'#000'` | Background color of the gallery. |\n| `zIndex` | `number` | — | CSS `z-index` for the modal. |\n| `phrases` | `object` | — | Custom labels for UI strings (e.g. close button, counters). |\n| `activePhotoPressed` | `() =\u003e void` | — | Callback fired when the active photo is clicked. |\n| `nextButtonPressed` | `() =\u003e void` | — | Callback fired when the next button is pressed. |\n| `prevButtonPressed` | `() =\u003e void` | — | Callback fired when the previous button is pressed. |\n| `leftKeyPressed` | `() =\u003e void` | — | Callback fired when the left arrow key is pressed. |\n| `rightKeyPressed` | `() =\u003e void` | — | Callback fired when the right arrow key is pressed. |\n\n### `Photo` object\n\n| Field | Type | Description |\n|---|---|---|\n| `photo` | `string` | **Required.** URL of the full-size image. |\n| `thumbnail` | `string` | URL of the thumbnail image (recommended: `100×67px`). |\n| `caption` | `string` | Short description shown below the photo. |\n| `subcaption` | `string` | Secondary description (e.g. author or location). |\n| `number` | `number` | Override the displayed photo number. |\n\n## Live Demo\n\nThe demo and documentation are available at the [docs site](https://peterpalau.github.io/react-bnb-gallery/). To run them locally:\n\n```bash\npnpm docs:dev\n```\n\n![Demo](https://raw.githubusercontent.com/peterpalau/react-bnb-gallery/master/react-bnb-demo.png)\n\n## License\n\nThis package has been released under the [MIT Licence](https://raw.githubusercontent.com/peterpalau/react-bnb-gallery/master/LICENSE).\n\n## Updates\n\nTo view the full changelog visit [CHANGELOG.md](https://github.com/peterpalau/react-bnb-gallery/blob/master/CHANGELOG.md).\n\n## Migration to 2.0.0\n\n### React support\n\n- `react-bnb-gallery@2.x` requires `react` and `react-dom` `^18 || ^19`.\n- React 15/16 are no longer supported.\n\n### Breaking changes\n\n- Preload images are now correctly returned/rendered by the gallery preload path.\n- Gallery and caption controls now react correctly when the `photos` prop changes at runtime.\n- The `phrases` prop-type shape is now generated from the keys of the provided object.\n\n### Deprecation policy\n\nDeprecated APIs receive warnings and documentation during `2.x`, then are removed in the next major release unless doing so would be unsafe.\n\n## Contributing\n\nIf you're interested in contributing please read the [contributing docs](https://github.com/peterpalau/react-bnb-gallery/blob/master/CONTRIBUTING.md) **before submitting a pull request**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedropalau%2Freact-bnb-gallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedropalau%2Freact-bnb-gallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedropalau%2Freact-bnb-gallery/lists"}