Image Lightbox Component
A responsive image lightbox component designed in dark mode using Tailwind CSS. It features a dark background, opacity effects, and responsive designs to accommodate various screen sizes.
HTML Code
<div class="fixed inset-0 z-50 flex items-center justify-center bg-gray-900 bg-opacity-75 hidden" id="lightbox">
<div class="relative">
<img src="https://picsum.photos/800/600" alt="Lightbox Image" class="rounded-lg shadow-lg">
<button class="absolute top-2 right-2 text-white bg-gray-800 hover:bg-gray-700 rounded-full p-2 focus:outline-none" onclick="document.getElementById('lightbox').classList.add('hidden')">
×
</button>
</div>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 p-4">
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/200" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/201" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/202" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/203" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/204" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
<div class="cursor-pointer" onclick="document.getElementById('lightbox').classList.remove('hidden')">
<img src="https://picsum.photos/300/205" alt="Thumbnail" class="rounded-lg shadow-md">
</div>
</div>
Related Components
Memphis_Monochrome_Image_Lightbox
A simple, responsive image lightbox component with a Memphis Design influence, featuring a monochrome palette with a single bright accent color. Designed for job/career platforms.
Image Lightbox Component
A responsive image lightbox component with a minimalist flat design, monochromatic color scheme, and moderate complexity, suitable for social media interfaces. It supports a dark theme using Tailwind CSS's dark: prefix and does not require JavaScript. Images are sourced from picsum.photos.
Image Lightbox Component
A complex Image Lightbox Component designed in a Brutalist style, suitable for social media interfaces, featuring a grayscale color scheme and high contrast for dark mode support.