Press "Enter" to skip to content

JS Lightbox Gallery for Bootstrap 5 Based on Modal and Carousel Plugins

A simplified Bootstrap 5 lightbox written in pure ES6 JavaScript that supports images, galleries, YouTube, Vimeo, and Instagram – built around the Modal and Carousel plugins in Bootstrap.

bootstrap filter gallery with lightbox, bootstrap 5 lightbox gallery, responsive lightbox image gallery jquery, responsive grid gallery with lightbox popup, bootstrap responsive lightbox

How to make use of it:

1. Import the JavaScript bs5-lightbox.js file into your Bootstrap 5 project.

// With NPM
$ npm i bs5-lightbox
import Lightbox from 'bs5-lightbox'
// Browser
<!-- Bootstrap 5 -->
<link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />
<script src="/path/to/cdn/bootstrap.bundle.min.js"></script>
<!-- Bootstrap 5 -->
<script src="/path/to/cdn/bs5-lightbox.min.js"></script>

2. Create one lightbox.

<a href="1.jpg" data-toggle="lightbox">
  <img src="thumb-1" alt="Click To Enlarge" />

3. Create a lightbox gallery with mixed content.

<!-- Image -->
<a href="1.jpg" data-toggle="lightbox" data-gallery="my-gallery">
  <img src="thumb-1" alt="Click To Enlarge" />
<!-- OR -->
<img src="thumb.jpg" data-toggle="lightbox" data-src="1.jpg" data-gallery="my-gallery" />

<!-- Youtube Video -->
<a href="" data-toggle="lightbox" data-gallery="my-gallery">
  <img src="thumb-2.jpg" />

<!-- Vimeo Video -->
<a href="" data-remote="" data-toggle="lightbox" data-gallery="my-gallery">
  <img src="thumb-3" />

<!-- Instagram Post -->
<a href="" data-toggle="lightbox" data-title="Custom Title" data-gallery="my-gallery">
  <img src="thumb-4" />

<!-- Remote URL -->
<a href="#!" data-title="" data-toggle="lightbox"  data-gallery="mixedgallery">

4. Determining the type of media in cases where no extension is provided.

<a href="" data-toggle="lightbox" data-type="image">
  Click To Open

Feature-rich Lightbox Gallery Based On Bootstrap 5, Lightbox for Bootstrap 5 Plugin/Github, bootstrap lightbox example, bootstrap lightbox multiple images, bootstrap lightbox popup

See Demo And Download

Official Website(trvswgnr): Click Here

This superior jQuery/javascript plugin is developed by trvswgnr. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.