The simplest vanilla JavaScript lightbox with zero dependencies
Get it atClick any image below to see the lightbox in action.
Why choose our vanilla JavaScript lightbox? Zero dependencies, minimal code, maximum performance. Perfect for developers who want simple, clean solutions.
Install via npm (no external dependencies required):
npm install litelight-js
Then import in your JavaScript:
<script type="module">
import { init } from 'litelight-js';
import 'litelight-js/css';
init();
</script>
If you prefer using direct file links without npm, download the files from GitHub:
<!-- In your <head> -->
<link rel="stylesheet" href="path/to/lite-light.min.css">
<!-- Before closing </body> -->
<script type="module">
import { init } from './path/to/lite-light.min.js';
init();
</script>
Note: Download the dist/lite-light.min.css and dist/lite-light.min.js files from the repository and place them in your project directory.
Add the data-lightbox attribute to any image with the URL of the high-resolution version:
<img src="thumbnail.jpg" data-lightbox="full-size.jpg" alt="Description">
That's it! Your simple vanilla JavaScript lightbox is ready. No jQuery, no frameworks, just pure JavaScript magic.