Work in Progress
This library is still a work in progress and things will likely change.
This component is included with the Astro Starter Kit.
In another component or page, import the component and use it.
---
import Lightbox from '@components/Lightbox.astro';
---
<Lightbox
class="grid grid-cols-2 md:grid-cols-4 gap-6"
name="gallery"
images={[
{ src: 'https://unsplash.it/1080?random=1' },
{ src: 'https://unsplash.it/1080?random=2' },
{ src: 'https://unsplash.it/1080?random=3' },
{ src: 'https://unsplash.it/1080?random=4' },
]}
/>
The class prop is optional, use this to style groups of images like a gallery. The name prop is also optional, but if you have more than one Lightbox or Gallery on a page, specify a unique name to ensure each Lightbox displays the correct images.
We use cookies to provide the best experience.