1.3.0 • Published 1 year ago

vue-tinybox v1.3.0

Weekly downloads
504
License
MIT
Repository
github
Last release
1 year ago

vue-tinybox

A slick, yet tiny lightbox gallery component for Vue.js

  • Slick. Nothing excessive. Image, controls and thumbnails.
  • Small. Dependency-free and less than 3 KB minified and gzipped.
  • Adaptive. Works great on both desktop and mobile.

Demo

The live demo can be found at https://os.karamoff.ru/vue-tinybox

Install

Node.js

Install the module as you normally would via npm or yarn:

npm install vue-tinybox
# or
yarn add vue-tinybox

Browsers

Just include the link to the Tinybox in your <head>:

<script src="path/to/vue.js"></script>
<script src="path/to/tinybox.umd.js"></script>

Usage

If you're using the Tinybox not from the browser, you'll have to import it:

import Tinybox from "vue-tinybox";

Then you include it your usual way:

Vue.component('tinybox', Tinybox);

// or

Vue.use(Tinybox);

// or, inside a Vue instance or SFC

{
    components: { Tinybox }
}

Then you can use the Tinybox component:

<Tinybox
    :images="images"
    :index="idx"
    @close="idx = null"
/>

The Tinybox component accepts these props:

Prop nameTypeDefaultDescription
imagesArray[]The array of either image URLs or Image objects
indexNumber / nullnullThe index of the image that has to be shown. If null, the lightbox is closed
loopBooleanfalseIndicates whether the images should loop

The Image object is an object with following fields:

Field nameTypeDescription
srcStringThe URL of the image
altString(optional) The text to be set inside alt attribute, e.g. a caption
thumbnailString(optional) The URL of the smaller version of the image to be shown in the thumbnail strip
2.0.0-alpha.3

1 year ago

2.0.0-alpha.1

1 year ago

2.0.0-alpha.2

1 year ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.1.0-3

4 years ago

1.1.0-2

4 years ago

1.1.0-1

4 years ago

1.1.0-0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-2

4 years ago

1.0.0-1

4 years ago

1.0.0-0

4 years ago

0.3.0

4 years ago

0.2.0

5 years ago

0.1.0

5 years ago