Image Lightbox Component
A responsive image lightbox component designed with Glassmorphism style using Tailwind CSS. The component supports a dark theme with frosted glass-like translucent elements and blur effects.
HTML Code
<div class="relative">
<button class="bg-white dark:bg-gray-800 text-gray-900 dark:text-white rounded-lg focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 inline-flex items-center p-2" id="open-lightbox">
<img src="https://picsum.photos/40/40?random" alt="Thumbnail" class="rounded-full">
</button>
<div class="hidden fixed inset-0 bg-black bg-opacity-50 transition-opacity" id="lightbox">
<div class="flex items-center justify-center h-full">
<div class="bg-white dark:bg-gray-800 bg-opacity-30 backdrop-blur-lg rounded-lg p-4">
<img src="https://picsum.photos/800/600?random" alt="Lightbox Image" class="rounded-md">
<button class="mt-4 bg-red-500 dark:bg-red-700 text-white rounded-lg p-2 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500" id="close-lightbox">Close</button>
</div>
</div>
</div>
</div>
<style>
/* Lightbox toggle visibility */
#lightbox:target {
display: flex;
}
</style>
Related Components
Image Lightbox Component
A simple responsive image lightbox component designed for e-commerce websites, featuring a dark mode style and analogous color scheme.
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.