Image & Video Light Gallery For Vue.js

Description:

A feature-rich lightbox library to display images and videos in a gallery lightbox.

Features:

  • Counter
  • Image caption
  • Navigation arrows
  • Thumbnail navigation

Basic usage:

1. Import the lightbox component.

import Vue from 'vue'

// lazy load
import VueLazyLoad from 'vue-lazyload'
Vue.use(VueLazyLoad)

// lightbox component
import LightBox from 'vue-image-lightbox'

2. Add videos and images to a media array.

[
  { 
    thumb: 'thumb.jpg',
    src: 'image.jpg',
    caption: 'Image caption', 
    srcset: '...' // for responsive images
  },
  { 
    thumb: 'cover.jpg',
    sources: [
      {
        src: 'video.mp4',
        type: 'video/mp4'
      }
    ],
    type: "video",
    caption: '<h4>Caption</h4>',
    width: 800, 
    height: 600,
    autoplay: true
  }
]

3. Add the lightbox component to the template.

<LightBox :media="media"></LightBox>

4. All default props.

media: {
  type: Array,
  required: true,
},
disableScroll: {
  type: Boolean,
  default: true,
},
showLightBox: {
  type: Boolean,
  default: true,
},
closable: {
  type: Boolean,
  default: true,
},
startAt: {
  type: Number,
  default: 0,
},
nThumbs: {
  type: Number,
  default: 7,
},
showThumbs: {
  type: Boolean,
  default: true,
},
showFooterCount: {
  type: Boolean,
  default: true,
},
// Mode
autoPlay: {
  type: Boolean,
  default: false,
},
autoPlayTime: {
  type: Number,
  default: 3000,
},
siteLoading: {
  type: String,
  default: '',
},
showCaption: {
  type: Boolean,
  default: false,
},
lengthToLoadMore: {
  type: Number,
  default: 0,
},
closeText: {
  type: String,
  default: 'Close (Esc)',
},
previousText: {
  type: String,
  default: 'Previous',
},
nextText: {
  type: String,
  default: 'Next',
},
previousThumbText: {
  type: String,
  default: 'Previous',
},
nextThumbText: {
  type: String,
  default: 'Next',
},

Preview:

Image & Video Light Gallery For Vue.js

Changelog:

10/05/2020

  • add custom props to show footer when images == 1

Download Details:

Author: pexea12

Live Demo: https://pexea12.github.io/vue-image-lightbox/

Download Link: https://github.com/pexea12/vue-image-lightbox/archive/master.zip

Official Website: https://github.com/pexea12/vue-image-lightbox

Install & Download:

# Yarn
$ yarn add vue-image-lightbox vue-lazyload

# NPM
$ npm i vue-image-lightbox vue-lazyload --save

You Might Be Interested In:

Add Comment