lightgallery.js is a JavaScript image and video gallery with no dependencies.
The tool solves the problem of displaying images and videos in an interactive lightbox interface without requiring external libraries. It works by providing a modular architecture where core functionality handles responsive gallery display, touch and mouse interactions, and keyboard navigation, while optional plugins extend capabilities for video platforms, social sharing, and additional effects. The gallery supports inline content, dynamically added slides, and hardware-accelerated CSS3 transitions for smooth animations across devices.
Developers should choose this tool if they need a lightweight gallery solution without jQuery or other framework dependencies. It suits projects ranging from simple image galleries to complex multimedia presentations that include YouTube, Vimeo, and HTML5 video content. The tool offers particular value for mobile-first projects through its touch support, pinch-to-zoom, swipe-to-close gestures, and optimized performance on mobile devices. It also handles next-generation image formats like WebP and JPEG XL.
The project underwent a significant architectural transition, being rewritten from scratch in TypeScript and merged with a related codebase to consolidate maintenance. Development shifted away from supporting older browsers, dropping Internet Explorer 8 and 9 compatibility. The modular plugin system was restructured so plugins must be passed via settings rather than polluting the global scope, and the API was redesigned with renamed events and modified method signatures, though the upgrade path attempted to maintain structural familiarity for existing users.