{"id":13476088,"url":"https://github.com/DCzajkowski/vue-pure-lightbox","last_synced_at":"2025-03-27T02:31:25.377Z","repository":{"id":23333125,"uuid":"98733958","full_name":"DCzajkowski/vue-pure-lightbox","owner":"DCzajkowski","description":"Very simple lightbox plugin (without any dependencies) for Vuejs 🌅","archived":false,"fork":false,"pushed_at":"2022-10-12T12:28:06.000Z","size":471,"stargazers_count":160,"open_issues_count":1,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-12T18:15:59.114Z","etag":null,"topics":["gallery","gallery-plugin","hacktoberfest","javascript","js","lightbox","lightbox-gallery","lightbox-gallery-plugin","vue","vuejs","vuejs2"],"latest_commit_sha":null,"homepage":"https://codepen.io/DCzajkowski/pen/rzOErW","language":"Vue","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/DCzajkowski.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":"2017-07-29T13:25:37.000Z","updated_at":"2024-01-09T01:55:24.000Z","dependencies_parsed_at":"2023-01-13T23:08:49.124Z","dependency_job_id":null,"html_url":"https://github.com/DCzajkowski/vue-pure-lightbox","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fvue-pure-lightbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fvue-pure-lightbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fvue-pure-lightbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCzajkowski%2Fvue-pure-lightbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCzajkowski","download_url":"https://codeload.github.com/DCzajkowski/vue-pure-lightbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222183866,"owners_count":16944933,"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":["gallery","gallery-plugin","hacktoberfest","javascript","js","lightbox","lightbox-gallery","lightbox-gallery-plugin","vue","vuejs","vuejs2"],"created_at":"2024-07-31T16:01:26.443Z","updated_at":"2024-10-30T08:30:18.270Z","avatar_url":"https://github.com/DCzajkowski.png","language":"Vue","funding_links":[],"categories":["Vue","UI组件","Components \u0026 Libraries","UI Components [🔝](#readme)","UI Components"],"sub_categories":["覆盖","UI Components","Overlay"],"readme":"# Pure JS lightbox component for Vue.js\n\u003ca href=\"https://www.npmjs.com/package/vue-pure-lightbox\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/vue-pure-lightbox.svg\" alt=\"Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.npmjs.com/package/vue-pure-lightbox\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/vue-pure-lightbox.svg\" alt=\"Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://spdx.org/licenses/MIT.html\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/vue-pure-lightbox.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\n## Disclaimer\n\nThis package is not WCAG-compliant yet. It was created when the author was not aware of how important it is to be fully accessible. Proceed with caution.\n\n## Table of contents\n* [Demo](#demo)\n* [Installation](#installation)\n  * [With NPM](#with-npm)\n  * [With a CDN](#with-a-cdn)\n* [Usage](#usage)\n  * [With an ES6 bundler (via NPM)](#with-an-es6-bundler-via-npm)\n    * [Importing a component](#importing-a-component)\n    * [Importing CSS styles](#importing-css-styles)\n      * [Via an import](#via-an-import)\n      * [Via a \u0026lt;style\u0026gt; tag](#via-a-style-tag)\n  * [With a CDN](#with-a-cdn)\n  * [Simple example](#simple-example)\n  * [Example using content slot and custom loader](#example-using-content-slot-and-custom-loader)\n  * [Available props](#available-props)\n  * [Available slots](#available-slots)\n* [Contents](#contents)\n* [License](#license)\n* [Issues](#issues)\n\n## Demo\nThe live demo is available here: [https://codepen.io/DCzajkowski/pen/rzOErW](https://codepen.io/DCzajkowski/pen/rzOErW).\n\n## Installation\n### With NPM:\n```bash\nnpm i vue-pure-lightbox --save\n```\n\n### With a CDN:\n```html\n\u003c!-- In \u003chead\u003e --\u003e\n\u003cmeta rel=\"stylesheet\" href=\"https://unpkg.com/vue-pure-lightbox/dist/VuePureLightbox.css\"\u003e\n\u003c!-- In \u003cbody\u003e, after Vue import --\u003e\n\u003cscript src=\"https://unpkg.com/vue-pure-lightbox/dist/VuePureLightbox.umd.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n### With an ES6 bundler (via NPM)\n\n#### Importing a component\n```js\nimport VuePureLightbox from 'vue-pure-lightbox'\n\n/* @vue/component */\nexport default {\n  components: {\n    // ...\n    VuePureLightbox,\n  },\n}\n```\n\n#### Importing CSS styles\n\nIf you are using an ES6 bundler, you will need to manually import the styles.\n\n##### Via an import\n```js\nimport styles from 'vue-pure-lightbox/dist/VuePureLightbox.css'\n```\n\n##### Via a \u0026lt;style\u0026gt; tag\n```vue\n\u003cstyle src=\"vue-pure-lightbox/dist/VuePureLightbox.css\"\u003e\u003c/style\u003e\n```\n\n### With a CDN\n```html\n\u003cscript\u003e\n  new Vue({\n    components: {\n      'vue-pure-lightbox': window.VuePureLightbox,\n    }\n  }).$mount('#app')\n\u003c/script\u003e\n```\n\n---\n\n### Simple example\n\n```vue\n\u003cVuePureLightbox\n  thumbnail=\"/path/to/thumbnail.jpg\"\n  :images=\"['/path/to/image1.jpg', '/path/to/image1.jpg']\"\n/\u003e\n```\n\n\u003e **Note:** if you are not using a vue-loader (e.g. you are using a CDN), you have to use the kebab-case'ing for the component i.e. `\u003cvue-pure-lightbox\u003e` instead of `\u003cVuePureLightbox\u003e`.\n\n### Example using content slot and custom loader\n\n```vue\n\u003cVuePureLightbox\n  thumbnail=\"https://via.placeholder.com/350x150\"\n  :images=\"[\n    { link: 'https://placekitten.com/1080/910', alt: 'Cat 1' },\n    { link: 'https://placekitten.com/1080/920', alt: 'Cat 2' },\n  ]\"\n\u003e\n  \u003ctemplate v-slot:loader\u003eLoading…\u003c/template\u003e\n  \u003ctemplate v-slot:content=\"{ url: { link, alt } }\"\u003e\n    \u003cimg :src=\"link\" :alt=\"alt\"\u003e\n  \u003c/template\u003e\n\u003c/VuePureLightbox\u003e\n```\n\n\u003e **Note:** if you are not using a vue-loader (e.g. you are using a CDN), you have to use the kebab-case'ing for the component i.e. `\u003cvue-pure-lightbox\u003e` instead of `\u003cVuePureLightbox\u003e`.\n\n---\n\n### Available props:\n\n| Prop           | Type              | Value                                                           |\n| -------------- | ----------------- | --------------------------------------------------------------- |\n| thumbnail      | string            | Path to a file being your thumbnail                             |\n| images         | string[] or array | Array of paths to files visible in the lightbox                 |\n| alternate-text | string            | **(Optional)** alt=\"\" text for your image                       |\n| value          | boolean           | **(Optional)** reactive visibility prop                         |\n| open-at-index  | integer           | **(Optional)** index of an image to show when opening the modal |\n\n### Available slots:\n\n| Slot          | Description                                          | Default                                   |\n| ------------- | ---------------------------------------------------- | ----------------------------------------- |\n| content       | DOM to be used in place of an image in the lightbox  | \u0026lt;img\u0026gt; tag with src set to path      |\n| loader        | DOM to be used when there is an image loading        | LightboxDefaultLoader                     |\n| icon-close    | Icon to be used as a close button                    | \u0026times; (\u0026amp;times;)                     |\n| icon-previous | Icon to be used as the \"next\" arrow button           | ![](https://i.imgur.com/HcdxJmd.png)(svg) |\n| icon-next     | Icon to be used as the \"previous\" arrow button       | ![](https://i.imgur.com/oErSVk3.png)(svg) |\n| preview       | DOM to be used in place of the default thumbnail     | Clickable link with a thumbnail           |\n\n## Contents\nThis package consists of just one `.vue` file. It is meant to be as small and simple as possible.\nIn return you get a `\u003cVuePureLightbox\u003e` Vue component that allows you to show images in a nice, responsive lightbox.\n\nSupported keys:\n- Arrow right - Go to the next image\n- Arrow left - Go to the previous image\n- Escape key - Close the modal\n- Arrow up, Arrow down and a Space Bar - inactive when the lightbox is visible\n\nCSS is being used in the component, but each class is prefixed with a `lightbox` keyword. You can overwrite them as you wish.\n\n## License\n[MIT](https://github.com/DCzajkowski/vue-pure-lightbox/blob/3.0.0/LICENSE)\n\n## Issues\nIf you find any bug or problem with the plugin please open an issue or create a pull request on the [Github repo](https://github.com/DCzajkowski/vue-pure-lightbox).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDCzajkowski%2Fvue-pure-lightbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDCzajkowski%2Fvue-pure-lightbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDCzajkowski%2Fvue-pure-lightbox/lists"}