Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Create a Lightbox (Modal-Image-Gallery) in ReactJS

Prompt

Build a photo gallery grid where clicking an image opens it full-screen in a lightbox modal overlay. The lightbox has previous/next navigation arrows to cycle through images, a close button, and must close on pressing the Escape key. Backdrop click should also close it.

Track selectedIndex and isOpen in useState. Set both on image click. Render modal as fixed-position overlay div. Add keydown listener for Escape in useEffect (cleanup on unmount). Previous
Test Results

Create a Lightbox (Modal-Image-Gallery) in ReactJS

Build a photo gallery grid where clicking an image opens it full-screen in a lightbox modal overlay. The lightbox has previous/next navigation arrows to cycle through images, a close button, and must close on pressing the Escape key. Backdrop click should also close it.