![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
vue-tinybox
Advanced tools
A slick, yet tiny lightbox gallery for Vue.js
Observe the live demo here: os.karamoff.dev/vue-tinybox
<Tinybox
v-model="index"
:images="images"
loop
no-thumbs
/>
Include the link to Tinybox in <head>
alongside Vue.js:
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-tinybox"></script>
Tinybox will auto-install upon detecting the global Vue instance. You can use it right away.
Install the Tinybox package:
npm install vue-tinybox
# or
yarn add vue-tinybox
Register it as you usually would:
import Tinybox from "vue-tinybox";
// or
const Tinybox = require('vue-tinybox');
Vue.component('Tinybox', Tinybox);
//or
Vue.use(Tinybox);
//or
new Vue({
components: { Tinybox },
// ...
});
An Image
object is an object with following fields:
Field name | Type | Description |
---|---|---|
src | String | Image URL |
thumbnail | String | (optional) Thumbnail URL. If omitted, the image URL will be used |
caption | String | (optional) Caption text to be overlayed on the image |
alt | String | (optional) Alt text. If omitted, the caption will be used |
Prop name | Type | Default | Description |
---|---|---|---|
images | Array | [] | List of either image URLs or Image objects |
loop | Boolean | false | Indicates whether the images should loop |
no-thumbs | Boolean | false | When enabled, the thumbnails are hidden |
v-model
You can use v-model
on a Number
variable, which will hold the index of the
image currently open. If no image is open (i.e. Tinybox is closed), the value
becomes null
.
Instead of v-model
you can use the index
prop and change
event:
<Tinybox
v-model="index"
:images="images"
/>
<!-- is equivalent to -->
<Tinybox
:images="images"
:index="index"
@change="(i) => {index = i}"
/>
Event name | Payload | Description |
---|---|---|
change | index of the image changed to | Is emitted on any image change (thumbnail navigation, prev/next, close) |
prev /next | index of the image changed to | Is emitted specifically when the user clicks "Prev"/"Next" or presses Left/Right arrow key |
close | index of the image Tinybox was closed at | Is emitted specifically when the user clicks "Close" or presses the Esc key |
Events can come in handy for business logic cases:
<Tinybox
:images="images"
v-model="index"
@change="onChange"
@prev="onPrevious"
@next="onNext"
@close="onClose"
/>
export default {
// ...
methods: {
onChange(index) {
console.log("User navigated to the photo: ", index);
},
onPrevious(index) {
console.log("User clicked 'previous' to switch to: ", index);
},
onNext(index) {
console.log("User clicked 'previous' to switch to: ", index);
},
onClose(index) {
console.log("User closed TinyBox on this photo: ", index);
}
},
}
![]() | ![]() | ![]() | ![]() | ![]() |
---|---|---|---|---|
21+ | 28+ | 7+ | 16+ | 11 |
FAQs
A slick, yet tiny lightbox gallery for Vue.js
The npm package vue-tinybox receives a total of 1,113 weekly downloads. As such, vue-tinybox popularity was classified as popular.
We found that vue-tinybox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.