Lightbox Web Widget (Gallery, image viewer)
Content Type: Widget
Categories: User Interface,Visualization
Overview
Show images in a lightbox with pan/zoom and captions. Can also be used as single image viewer
This widget is a wrapper around Yet Another React Lightbox
Documentation
<div id="readme" class="md" data-path="README.md"><article class="markdown-body entry-content container-lg" itemprop="text"><div class="markdown-heading" dir="auto"><h2 class="heading-element" dir="auto">LightboxWebWidget</h2><a id="user-content-lightboxwebwidget" class="anchor" aria-label="Permalink: LightboxWebWidget" href="#lightboxwebwidget"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<p dir="auto">Show images in a lightbox with pan/zoom and captions.</p>
<p dir="auto">This widget is a wrapper around <a href="https://yet-another-react-lightbox.com/" rel="nofollow">Yet Another React Lightbox</a></p>
<div class="markdown-heading" dir="auto"><h2 class="heading-element" dir="auto">Features</h2><a id="user-content-features" class="anchor" aria-label="Permalink: Features" href="#features"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<ul dir="auto">
<li>Show images in a lightbox allow the user to navigate between images</li>
<li>Use Mendix images or image URLs</li>
<li>Zoom and pan the image</li>
<li>Configure the maximum zoom level, default is twice the original resolution, increase to maximum ten times</li>
<li>Optionally start the lightbox at a specific image in the list</li>
<li>Optionally show a title and description for each image</li>
<li>Can also be used as a single image viewer, allowing zoom and pan</li>
</ul>
<div class="markdown-heading" dir="auto"><h2 class="heading-element" dir="auto">Limitations</h2><a id="user-content-limitations" class="anchor" aria-label="Permalink: Limitations" href="#limitations"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<ul dir="auto">
<li>This widget does not work in a default layout. Use a layout without scrollcontainer</li>
<li>The lightbox will always occupy the entire browser view area</li>
<li>The image will show nothing at all when no images are available.</li>
</ul>
<div class="markdown-heading" dir="auto"><h2 class="heading-element" dir="auto">Usage</h2><a id="user-content-usage" class="anchor" aria-label="Permalink: Usage" href="#usage"><svg data-component="Octicon" class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"></path></svg></a></div>
<ul dir="auto">
<li>Place the widget on a separate page, without any other content, do not use a layout grid</li>
<li>The page must use a layout without scroll container, create one if necessary</li>
<li>Configure the datasource, which must result in a list. However, it is perfectly fine to have a list of one image</li>
<li>Optionally pass an image at which the lightbox will position</li>
<li>When the page receives a single image as parameter, use a nanoflow that creates a list with a single item. This avoids an additional server roundtrip</li>
<li>Configure the onClose action to close the page, or call a microflow/nanoflow that at least closes the current page</li>
<li>Open the page, the lightbox will appear</li>
<li>If it is possible there are no images at all, check this before opening the page with the widget and show a relevant message, or hide the button that shows the page.</li>
</ul>
</article></div>
Releases
Version: 3.0.0
Framework Version: 11.12.2
Release Notes:
Mendix 11.12.2, update library used in the widget
Version: 2.0.0
Framework Version: 11.6.5
Release Notes:
Mendix 11.6.5, update library used in the widget
Version: 1.4.0
Framework Version: 10.24.10
Release Notes:
- Support image URLs
- Allow configuration of maximum zoom level
Version: 1.3.0
Framework Version: 10.24.4
Release Notes: Mendix 10.24.4, update lightbox library
Version: 1.2.0
Framework Version: 10.18.0
Release Notes: Mendix 10.18
Version: 1.1.0
Framework Version: 10.12.10
Release Notes: Added property to start with specific image in the list
Version: 1.0.0
Framework Version: 10.12.8
Release Notes: Initial release