Socket
Socket
Sign inDemoInstall

vue-tinybox

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-tinybox

A slick, yet tiny lightbox gallery for Vue.js


Version published
Weekly downloads
722
decreased by-3.22%
Maintainers
1
Install size
32.1 kB
Created
Weekly downloads
 

Readme

Source

vue-tinybox

Milky Way emoji

A slick, yet tiny lightbox gallery for Vue.js

  • Slick. No excessive design. Pictures, thumbnails, controls.
  • Tiny. Dependency-free. Less than 3 KB minified and gzipped.
  • Adaptive. Works on computers. Works on tablets. Works on phones.

Demo

Observe the live demo here: os.karamoff.dev/vue-tinybox

Basic usage

<Tinybox
    v-model="index"
    :images="images"
    loop
    no-thumbs
/>

Install

Browsers

  1. 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>
    
  2. Tinybox will auto-install upon detecting the global Vue instance. You can use it right away.

Node environment

  1. Install the Tinybox package:

    npm install vue-tinybox
    # or
    yarn add vue-tinybox
    
  2. 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 },
        // ... 
    });
    

API

Image object

An Image object is an object with following fields:

Field nameTypeDescription
srcStringThe image URL
altString(optional) the alt text
thumbnailString(optional) The thumbnail (a smaller, square version of the image) URL

Props

Prop nameTypeDefaultDescription
imagesArray[]List of either image URLs or Image objects
loopBooleanfalseIndicates whether the images should loop
no-thumbsBooleanfalseWhen 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}"
/>

Browser support

ChromeFirefoxSafariMS EdgeInternet Explorer
21+28+7+16+11

Keywords

FAQs

Last updated on 26 Apr 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc