Description
react-simple-image-viewer is a simple image viewer component for React. You pass it an array of image URLs and an index for the image to show first, and it displays the images in a modal window. Its properties cover the src array, the currentIndex, an onClose callback that runs when the viewer closes, backgroundStyle for the modal background, and a closeOnClickOutside option. You can turn off scrolling through images with the mouse wheel using disableScroll. Custom components can replace the close button and the left and right arrows. Keyboard shortcuts close the viewer with Escape, move to the next image with the right arrow or l, and move back with the left arrow or h. The mouse wheel also moves between images unless scrolling is disabled. The package can be installed with Yarn or npm. The README has a basic example and a demo on CodeSandbox, and it links to the property list in its API section. The project is open source and hosted on GitHub.…
Highlights
- Image viewer for React with an array of URLs
- Start on a chosen image with currentIndex
- Custom close and arrow components
- Keyboard shortcuts for navigation
- Mouse wheel navigation that can be turned off
Ratings & Reviews
No ratings yet
Be the first to rate react-simple-image-viewer.
People also visit

react-image-gallery
Responsive image gallery, carousel, image slider react component
react-simple-image-viewer FAQ
What is react-simple-image-viewer?
A simple image viewer component for React that shows an array of images in a modal window.
How do I use it?
Pass an array of image URLs as src and a currentIndex for the image to show first, plus an onClose callback.
What keyboard shortcuts does it have?
Escape closes the viewer, the right arrow or l goes to the next image, and the left arrow or h goes to the previous one.
Can I customize the buttons?
Yes. You can supply your own close button and left and right arrow components.
Is there a demo?
The README links a demo on CodeSandbox.
What are the best react-simple-image-viewer alternatives?
Popular alternatives to react-simple-image-viewer include react-images-viewer, react-image-gallery and react-modal-image. See all react-simple-image-viewer alternatives



















