{"id":18830308,"url":"https://github.com/vlzh/react-lightgallery","last_synced_at":"2025-09-09T13:51:08.279Z","repository":{"id":34259598,"uuid":"174034172","full_name":"VLZH/react-lightgallery","owner":"VLZH","description":"React wrapper for lightgallery.js","archived":false,"fork":false,"pushed_at":"2023-01-06T01:41:56.000Z","size":835,"stargazers_count":63,"open_issues_count":21,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-06T04:48:52.263Z","etag":null,"topics":["gallery","lightgallery","react","ui-components"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-lightgallery","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/VLZH.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-05T23:06:15.000Z","updated_at":"2024-11-19T00:34:33.000Z","dependencies_parsed_at":"2023-01-15T05:43:57.533Z","dependency_job_id":null,"html_url":"https://github.com/VLZH/react-lightgallery","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/VLZH/react-lightgallery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLZH%2Freact-lightgallery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLZH%2Freact-lightgallery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLZH%2Freact-lightgallery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLZH%2Freact-lightgallery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VLZH","download_url":"https://codeload.github.com/VLZH/react-lightgallery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLZH%2Freact-lightgallery/sbom","scorecard":{"id":146795,"data":{"date":"2025-08-11","repo":{"name":"github.com/VLZH/react-lightgallery","commit":"03d230a5d26551cd5eb6c4e254a25cbf9b982705"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/npm-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/VLZH/react-lightgallery/npm-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/VLZH/react-lightgallery/npm-publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/npm-publish.yml:20","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"62 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr","Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T09:33:11.786Z","repository_id":34259598,"created_at":"2025-08-16T09:33:11.786Z","updated_at":"2025-08-16T09:33:11.786Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274307287,"owners_count":25261216,"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","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gallery","lightgallery","react","ui-components"],"created_at":"2024-11-08T01:48:31.443Z","updated_at":"2025-09-09T13:51:08.234Z","avatar_url":"https://github.com/VLZH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThis package is react wrapper for: [lightgallery.js](https://sachinchoolur.github.io/lightgallery.js)\n\n![npm](https://img.shields.io/npm/dm/react-lightgallery) ![GitHub issues](https://img.shields.io/github/issues-raw/vlzh/react-lightgallery) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-lightgallery)\n\n# Installation\n\n```bash\nyarn add react-lightgallery\n```\n\nor\n\n```bash\nnpm install --save react-lightgallery\n```\n\n# Run example\n\n```\ngit clone git@github.com:VLZH/react-lightgallery.git\n# go to the project folder\ncd ./react-lightgallery\n# install dependencies\nyarn install\n# run example\nyarn start:example\n```\n\n## Live demo\n\n[![Edit react-lightgallery1](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/mo45kpo92j?fontsize=14)\n\n# Usage\n\nImport `.css` file in your code:\n\n```javascript\n// some Root.js file\nimport \"lightgallery.js/dist/css/lightgallery.css\";\n```\n\nAdd the **provider** to your a high-level component\n\n```javascript\n// some Root.js file\nimport React from \"react\";\nimport { LightgalleryProvider } from \"react-lightgallery\";\n\nclass App extends React.Component {\n    render() {\n        return (\n            \u003cLightgalleryProvider\n                lightgallerySettings={\n                    {\n                        // settings: https://sachinchoolur.github.io/lightgallery.js/docs/api.html\n                    }\n                }\n                galleryClassName=\"my_custom_classname\"\n            \u003e\n                // your components\n            \u003c/LightgalleryProvider\u003e\n        );\n    }\n}\n```\n\nThe Provider is the manager of `photo-groups` in a case when you want to have several sets of photos, also this is settings storage for lightgallery.js\n\nWrap some elements by `\u003cLightgalleryItem\u003e`\n\n```javascript\n// some PhotoItem.js file\nimport { LightgalleryItem } from \"react-lightgallery\";\n\nconst PhotoItem = ({ image, url, title }) =\u003e (\n    \u003cdiv\u003e\n        \u003cLightgalleryItem group=\"any\" src={image}\u003e\n            \u003ca href={url}\u003e\n                \u003cimg src={image} /\u003e\n                \u003cItemTitle\u003e\n                    \u003cLinesEllipsis\n                        text={title}\n                        maxLine=\"2\"\n                        ellipsis=\"...\"\n                        trimRight\n                        basedOn=\"letters\"\n                    /\u003e\n                \u003c/ItemTitle\u003e\n            \u003c/a\u003e\n        \u003c/LightgalleryItem\u003e\n    \u003c/div\u003e\n);\n```\n\n# Props\n\n## LightgalleryProvider\n\n| Prop                  | Type     | Default                                                                | Required | Description                                                                                                         |\n| --------------------- | -------- | ---------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |\n| lightgallerySettings  | Object   | {}                                                                     | no       | Setting for lightgallery. [More information](https://sachinchoolur.github.io/lightgallery.js/docs/api.html#options) |\n| galleryClassName      | String   | \"react_lightgallery_gallery\"                                           | no       | Class name of gallery target element                                                                                |\n| portalElementSelector | String   | body                                                                   | no       | Portal target element for adding divelement(lightgallery target element)                                            |\n| plugins               | String[] | [ \"lg-fullscreen.js\", \"lg-thumbnail.js\", \"lg-video.js\", \"lg-zoom.js\" ] | no       | List of enabled plugins                                                                                             |\n\n### List of supported plugins\n\n-   lg-autoplay.js\n-   lg-fullscreen.js\n-   lg-hash.js\n-   lg-pager.js\n-   lg-thumbnail.js\n-   lg-video.js\n-   lg-zoom.js\n-   lg-share.j\n\n### Supported Events\n\nYou can access to events by using these **props**:\n\n| Prop              | Type     |\n| ----------------- | -------- |\n| onAfterOpen       | Function |\n| onSlideItemLoad   | Function |\n| onBeforeSlide     | Function |\n| onAfterSlide      | Function |\n| onBeforePrevSlide | Function |\n| onBeforeNextSlide | Function |\n| onDragstart       | Function |\n| onDragmove        | Function |\n| onDragend         | Function |\n| onSlideClick      | Function |\n| onBeforeClose     | Function |\n| onCloseAfter      | Function |\n\nExample of using events:\n\n```javascript\nclass App extends React.Component {\n    render() {\n        return (\n            \u003cLightgalleryProvider\n                onAfterSlide={(event, lightgallery_object) =\u003e {\n                    console.log(lightgallery_object);\n                    console.log(\n                        `Prev slide index: ${event.detail.prevIndex}; Current index: ${event.detail.index}`\n                    );\n                }}\n            \u003e\n                // your components\n            \u003c/LightgalleryProvider\u003e\n        );\n    }\n}\n```\n\n## LightgalleryItem\n\n| Prop          | Type   | Default                   | Required | Description                                                     |\n| ------------- | ------ | ------------------------- | -------- | --------------------------------------------------------------- |\n| group         | String | undefined                 | yes      | Name of group of photos set                                     |\n| src           | String | undefined                 | yes      | Url to image                                                    |\n| thumb         | String | same as `src`👆           | no       | Url to image                                                    |\n| downloadUrl   | String | undefined                 | no       | Link for download link                                          |\n| subHtml       | String | undefined                 | no       | id or class name of an object(div) which contain your sub html. |\n| itemClassName | String | \"react_lightgallery_item\" | no       | class name of wrapper(div) of children                          |\n\n# HOCs and Hooks\n\n\u003e ⚠️ Note!  \n\u003e You should to use this HOCs and hooks only inside of `LightgalleryProvider`\n\n## useLightgallery\n\nReact hook that returns `openGallery` function for opening of a group.\n\n### Example\n\n```javascript\nimport React, { useCallback } from \"react\";\nimport { useLightgallery } from \"react-lightgallery\";\n\nfunction MySuperButton({ group_name }) {\n    const { openGallery } = useLightgallery();\n\n    const open = useCallback(() =\u003e {\n        openGallery(group_name, 5); // you must to define target group, index (second parameter) is optional\n    }, [group_name]);\n\n    return \u003cbutton onClick={open}\u003eOpen gallery\u003c/button\u003e;\n}\n```\n\n## withLightgallery\n\nReact HOC for providing `openGallery` function.\n\n### Example\n\n```javascript\nimport React, { useCallback } from \"react\";\nimport { withLightgallery } from \"react-lightgallery\";\n\n@withLightgallery\nclass MySuperButton(){\n    open = () =\u003e {\n        this.props.openGallery(\"very_cool_group\")\n    }\n\n    render() {\n        return \u003cbutton onClick={this.open}\u003eOpen gallery\u003c/button\u003e;\n    }\n}\n```\n\n# TODO\n\n-   Rewrite to typescript\n-   Remove lightgallery.js and plugins imports and provide this job to user(developer) (new major version)\n-   Write tests\n-   Support of video\n-   Access to specific events through LightgalleryItem, like: `onOpen`, `onLeave`, `onEnter`\n-   More options from lightgallery for LightgalleryItem\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlzh%2Freact-lightgallery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlzh%2Freact-lightgallery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlzh%2Freact-lightgallery/lists"}