Skip to content

Lightbox

BsLightbox is a modal image gallery component that is used to display a collection of images.

Overview

BsLightbox uses <bs-overlay> component internally and can be closed using the ESC key (enabled by default), or clicking the backdrop (enabled by default). BsLightbox has previous/next controls, indicator and toolbar buttons enabled by default. Data sources is provided via items property. Additionally, you can use arrow key left/right as navigation.

Custom Toolbar

BsLightbox toolbar buttons can be customized to some extent. Additionally, you can add custom menus to your needs via menubar slot and enable the menubar button via toolbar property to make the custom menus work correctly. Some buttons do not perform any action, only trigger an event. You must provide your own method for these buttons. The buttons that don't provide any actions are: download, delete and info buttons.

Single Image

BsLightbox can also be used to display single modal image. To achieve this, you have to sets show-counter, show-nav-control, and show-thumbnail property to false. Additionally, you can also sets show-toolbar property to false, if you don't need any toolbar buttons.

CSS Variables

Added since v2.0.0
scss
--md-lightbox-element-padding-x: 0.5rem;
--md-lightbox-display-bg: rgba(0,0,0, .3);
--md-lightbox-toolbar-bg: (0,0,0, .9);
--md-lightbox-toolbar-color: #ced4da;
--md-lightbox-overlay-bg: #151515;
--md-lightbox-title-bg: rgba(0,0,0, .7);
--md-lightbox-title-color: #ced4da;
--md-lightbox-title-size: 1.25rem;
--md-lightbox-thumbnail-bg: rgba(0,0,0, .95);
--md-lightbox-thumbnail-border: 1px solid rgba(0,0,0, .6);
--md-lightbox-thumbnail-opacity: 0.5;
--md-lightbox-thumbnail-active-border-color: #f44336;
--md-lightbox-thumbnail-active-border-width: 2px;

API Reference

Released under the BSD-3-Clause License.