Description
react-modal-image is a lightweight React component that shows an image in a modal lightbox. The README says it is about 3 kB gzipped, has zero dependencies, and ships builds for CommonJS and ES modules. It supports React 16, 17 and 18. The lightbox closes on Esc, on Enter, or when you click outside the image. Users can zoom and move the image, or download the highest-quality version, and the download and zoom buttons can be hidden. The image's alt text is shown as the lightbox title, and you can override the background color behind transparent images. A simple API takes a small preview image, optional srcSet, medium and large images, and flags to hide the download and zoom buttons, show a rotate button, or set the background color. The README also documents a lightbox-only API for advanced use, and it notes that old Internet Explorer needs Set and fetch polyfills.…
Highlights
- Modal image lightbox for React
- About 3 kB gzipped with zero dependencies
- Zoom, move and download the image
- Closes on Esc, Enter or outside click
- Simple API and lightbox-only API
Ratings & Reviews
No ratings yet
Be the first to rate react-modal-image.
People also visit

react-image-gallery
Responsive image gallery, carousel, image slider react component
react-modal-image FAQ
What is react-modal-image?
A lightweight React component that shows an image in a modal lightbox.
Which React versions does it support?
React 16.x, 17.x and 18.x, according to the README.
Can users download the full image?
Yes, from the lightbox, unless you hide the download button with hideDownload.
How do I close the lightbox?
Press Esc or Enter, or click outside the image.
What are the best react-modal-image alternatives?
Popular alternatives to react-modal-image include yet-another-react-lightbox, react-simple-image-viewer and react-image-gallery. See all react-modal-image alternatives




















