Gallery
JavaScript based lightbox component for presenting various types of media.
Around component
Gallery component relies on 3rd party plugin. Make sure to link to Light Gallery css and js files in your document: vendor/lightgallery.js/dist/css/lightgallery.min.css and lightgallery.js/dist/js/lightgallery.min.js. If you need extra features like zooming, fullscreen view or video you need to include additional plugins:
- vendor/lg-fullscreen.js/dist/lg-fullscreen.min.js
- vendor/lg-zoom.js/dist/lg-zoom.min.js
- vendor/lg-video.js/dist/lg-video.min.js
Use this page as a reference.
Media: Image
<!-- Image gallery -->
<div class="gallery">
<a href="path-to-large-image" class="gallery-item rounded-3" data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Gallery image caption</span>
</a>
</div>
// Image gallery
.gallery
a(href="path-to-large-image", data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>').gallery-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Gallery image caption
Media: Video
<!-- Video gallery -->
<div class="gallery">
<a href="link-to-youtube/vimeo-video" class="gallery-item gallery-video rounded-3" data-sub-html='<h6 class="fs-sm text-light">Gallery video caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Gallery video caption</span>
</a>
</div>
// Video gallery
.gallery
a(href="link-to-youtube/vimeo-video", data-sub-html='<h6 class="fs-sm text-light">Gallery video caption</h6>').gallery-item.video-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Gallery video caption
Media: Iframe (Google map)
<!-- Iframe (Google map) -->
<div class="gallery">
<a href="link-to-google-map-embed" class="gallery-item rounded-3" data-sub-html='<h6 class="fs-sm text-light">Google map embed</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Google map embed</span>
</a>
</div>
// Iframe (Google map)
.gallery
a(href="link-to-google-map-embed", data-sub-html='<h6 class="fs-sm text-light">Google map embed</h6>').gallery-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Google map embed
Grid with gutters
<!-- Gallery grid with gutters -->
<div class="row gallery">
<!-- Item -->
<div class="col-xl-4 col-sm-6 mb-grid-gutter">
<a href="path-to-large-image" class="gallery-item rounded-3" data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Gallery image caption</span>
</a>
</div>
<!-- Item -->
<div class="col-xl-4 col-sm-6 mb-grid-gutter">
....
</div>
<!-- Add as many columns with gallery item inside as you need -->
</div>
// Gallery grid with gutters
.row.gallery
//- Item
.col-xl-4.col-sm-6.mb-grid-gutter
a(href="path-to-large-image", data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>').gallery-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Gallery image caption
//- Item
.col-xl-4.col-sm-6.mb-grid-gutter
...
//- Add as many columns with gallery item inside as you need
Grid no gutters
<!-- Gallery grid no gutters -->
<div class="row gallery g-0">
<!-- Item -->
<div class="col-xl-4 col-sm-6">
<a href="path-to-large-image" class="gallery-item" data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Gallery image caption</span>
</a>
</div>
<!-- Item -->
<div class="col-xl-4 col-sm-6">
....
</div>
<!-- Add as many columns with gallery item inside as you need -->
</div>
// Gallery grid no gutters
.row.gallery.g-0
//- Item
.col-xl-4.col-sm-6
a(href="path-to-large-image", data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>').gallery-item
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Gallery image caption
//- Item
.col-xl-4.col-sm-6
...
//- Add as many columns with gallery item inside as you need
Inside card
Card with gallery thumbnail
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhere<!-- Gallery inside card -->
<div class="card gallery">
<a href="path-to-large-image" class="gallery-item card-img-top" data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
</a>
<div class="card-body">
<h5 class="card-title">Card with gallery thumbnail</h5>
<p class="card-text fs-sm">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-sm btn-primary">Go somewhere</a>
</div>
</div>
// Gallery inside card
.card.gallery
a(href="path-to-large-image", data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>').gallery-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
.card-body
h5.card-title
| Card with gallery thumbnail
p.card-text.fs-sm
| Some quick example text to build on the card title and make up the bulk of the card's content.
a.btn.btn-sm.btn-primary(href="#") Go somewhere
Inside carousel
<!-- Gallery inside carousel -->
<div class="tns-carousel-wrapper tns-controls-center gallery">
<div class="tns-carousel-inner" data-carousel-options='{"nav": false, "responsive": {"0":{"items":1},"576":{"items":2, "gutter": 20},"1200":{"items":3, "gutter": 30}}}'>
<!-- Item -->
<div>
<a href="path-to-large-image" class="gallery-item" data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>'>
<img src="path-to-thumbnail-image" alt="Gallery thumbnail">
<span class="gallery-caption">Gallery image caption</span>
</a>
</div>
<!-- Add as many gallery items wrapped in divs as you need -->
</div>
</div>
// Gallery inside carousel
.tns-carousel-wrapper.tns-controls-center.gallery
.tns-carousel-inner(data-carousel-options='{"nav": false, "responsive": {"0":{"items":1},"576":{"items":2, "gutter": 20},"1200":{"items":3, "gutter": 30}}}')
//- Item
div
a(href="path-to-large-image", data-sub-html='<h6 class="fs-sm text-light">Gallery image caption</h6>').gallery-item.rounded-3
img(src="path-to-thumbnail-image", alt="Gallery thumbnail")
span.gallery-caption Gallery image caption
//- Add as many gallery items wrapped in divs as you need