Vue-cool-lightbox is a Vue.js lightbox component without any dependencies, inspired by fancybox with zoom and videos supported.


Use the node package manager to install vue-cool-lightbox.

npm install --save vue-cool-lightbox

and use the lightbox:

import CoolLightBox from 'vue-cool-lightbox'

export default {
  components: {


  <div id="app">
      @close="index = null">

    <div class="images-wrapper">
        v-for="(image, imageIndex) in items"
        :style="{ backgroundImage: 'url(' + image.src + ')' }"

import CoolLightBox from 'vue-cool-lightbox'

export default {
  name: "app",
  data: function () {
    return {
      items: [
          src: '
          src: '
      index: null
  components: {
  methods: {
    setIndex(index) {
      this.index = index

Or items can be just an array:

items: [

Items Supported attributes

Attribute required type Description
src yes string media source, it can be an image or a Youtube / Vimeo / Mp4 video
title no string the image title
description no string the image description
thumb no string thumb url used in thumbs block

Props Supported

Attribute type Description Default
items Array Array of images/videos
index Number Index of items to open
loop Boolean Enables looping through items true
slideshow Boolean Enables lighbox slideshow true
slideshowColorBar String Color of the slideshow progress bar #fa4242
slideshowDuration Number Duration of slides when slideshow is running (in ms) 3000
srcName String Name of the prop to use as image/video url src
srcThumb String Name of the prop to use as image/video thumb thumb
overlayColor String Overlay color rgba(30, 30, 30, .9)

Slots Supported

Name Description
icon-previous Previous icon
icon-next Next icon
close Close icon