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 component for Vue.js


Version published
Maintainers
1
Created

Readme

Source

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

Keywords

FAQs

Last updated on 08 Jan 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