TechnicalCollectible prompt
Image gallery with an accessible lightbox
Add an image gallery with a lightbox to {{page_or_feature}} in my {{tech_stack}} project. Read the existing code first, prefer the browser's native dialog or a small library over a heavy one, and show me a short plan before changing files.
The grid:
- Images come from one list or table with the file, alt text, caption and category, and alt text is required
- Responsive sizes and modern formats, width and height set to prevent layout shift, and lazy-loading below the fold
- A soft placeholder color while each image loads
- Optional category filters as real buttons
The lightbox:
- Opens as a modal dialog labeled by the caption; focus moves in, stays inside, and returns to the thumbnail on close
- Escape closes it; arrow keys and on-screen buttons move between images, and swiping works on touch screens
- A counter such as 4 of 20, with the caption shown under each image
- Pinch-to-zoom stays enabled on phones
- The next and previous images preload
- Each image has its own shareable link, and the back button closes the lightbox
- Animations switch off when the visitor prefers reduced motion
- Buttons at least 44px, and WCAG 2.2 AA throughout
When you're done, list the files changed, how to add new photos, and anything you assumed.
Technicalnvoka.com/library/nvoka-image-gallery-with-accessible-lightboxScan to open
Technical
Image gallery with an accessible lightbox
Add a fast photo gallery with a lightbox that works by keyboard, touch and screen reader.
Curated by Nvoka
CursorLovableClaude Codev0
Make it yours
Fill in the blanks and change any word. Only your copy changes, never the card.
Fill in the blanks
0 of 2 filledYour prompt
Add an image gallery with a lightbox to {{page_or_feature}} in my {{tech_stack}} project. Read the existing code first, prefer the browser's native dialog or a small library over a heavy one, and show me a short plan before changing files.
The grid:
- Images come from one list or table with the file, alt text, caption and category, and alt text is required
- Responsive sizes and modern formats, width and height set to prevent layout shift, and lazy-loading below the fold
- A soft placeholder color while each image loads
- Optional category filters as real buttons
The lightbox:
- Opens as a modal dialog labeled by the caption; focus moves in, stays inside, and returns to the thumbnail on close
- Escape closes it; arrow keys and on-screen buttons move between images, and swiping works on touch screens
- A counter such as 4 of 20, with the caption shown under each image
- Pinch-to-zoom stays enabled on phones
- The next and previous images preload
- Each image has its own shareable link, and the back button closes the lightbox
- Animations switch off when the visitor prefers reduced motion
- Buttons at least 44px, and WCAG 2.2 AA throughout
When you're done, list the files changed, how to add new photos, and anything you assumed.