🌌 A slick, yet tiny lightbox gallery for Vue.js https://os.karamoff.dev/vue-tinybox/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.8 KiB

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="description" content="A slick, yet tiny lightbox gallery for Vue.js">
<meta name="keywords" content="vue,vuejs,vue.js,lightbox,gallery,component,javascript">
<meta name="author" content="Nikita Karamov">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue-tinybox | A slick, yet tiny lightbox gallery for Vue.js</title>
<link rel="preconnect" href="https://picsum.photos/">
<link rel="stylesheet" href="awsm.opt.min.css">
.open-tinybox {
display: inline-block;
cursor: pointer;
margin: 5px;
width: 100px;
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<img src="https://raw.githubusercontent.com/googlefonts/noto-emoji/master/png/128/emoji_u1f30c.png" width="64" height="64" alt="Milky Way emoji">
<p>A slick, yet tiny lightbox gallery for Vue.js</p>
<a href="https://www.npmjs.com/package/vue-tinybox" target="_blank" rel="noopener noreferrer">npm</a>
<a href="https://github.com/NickKaramoff/vue-tinybox" target="_blank" rel="noopener noreferrer">github</a>
<a id="what-is-it" href="#what-is-it" aria-hidden="true"></a>
What is it?
Tinybox is a simple lightbox gallery for Vue.js.
While being not as customizable as some other
lightboxes, Tinybox is very slick and lightweight (3&nbsp;KB minzipped). Tinybox is
great on mobile devices too: it supports swipe gestures and changes its size responsively.
the size of Tinybox is controlled with
<a href="https://github.com/ai/size-limit" target="_blank" rel="noopener noreferrer">Size Limit</a>
<article id="demo-app">
<a href="#demo" id="demo" aria-hidden="true"></a>
<p>Click on any image below to open Tinybox</p>
<Tinybox v-model="index" :images="images"></Tinybox>
v-for="(img, idx) in images"
@click="index = idx"
<a href="#install" id="install" aria-hidden="true"></a>
Include the link to Tinybox in <code>&lt;head&gt;</code> alongside Vue.js:
<pre><code>&lt;script src="https://cdn.jsdelivr.net/npm/vue-tinybox"&gt;&lt;/script&gt;</code></pre>
Install the Tinybox package and register it as you usually would:
<pre><code>$ npm install vue-tinybox</code></pre>
<pre><code>import Tinybox from "vue-tinybox";
Vue.component('Tinybox', Tinybox);</code></pre>
<h2>API and more</h2>
For API docs and more info on installation consult the
<a href="https://github.com/NickKaramoff/vue-tinybox#readme" rel="noopener noreferrer">README</a>.
<p>vue-tinybox by <a href="https://karamoff.dev" target="_blank" rel="noopener noreferrer">Nikita Karamov</a></p>
<p>Website built with <a href="https://igoradamenko.github.io/awsm.css/index.html" target="_blank" rel="noopener noreferrer">awsm.css</a></p>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/vue-tinybox@1.3/dist/tinybox.umd.js"></script>
window.onload = function () {
new Vue({
components: { Tinybox },
el: '#demo-app',
data: function () {
return {
images: [
src: "https://picsum.photos/id/13/600/1000",
alt: "Empty beach",
caption: "Beach",
thumbnail: "https://picsum.photos/id/13/200"
src: "https://picsum.photos/id/42/800/600",
alt: "Desk in a café",
caption: "Café",
thumbnail: "https://picsum.photos/id/42/200"
src: "https://picsum.photos/id/256/1500/600",
alt: "Mountains range",
caption: "Mountains",
thumbnail: "https://picsum.photos/id/256/200"
src: "https://picsum.photos/id/666/800/600",
alt: "Green trees in forest",
caption: "Forest",
thumbnail: "https://picsum.photos/id/666/200"
index: null