Description
React Photo Gallery is a responsive image gallery component for React. It keeps each photo's original aspect ratio and arranges the photos as a justified or masonry grid. The layout can run in rows or in columns, and a columns prop lets the number of columns change dynamically. A custom renderImage function lets you build your own image behaviour, such as selection, favourites or captions. The README describes the component as responsive, accessible, composable and customizable, and says it is compatible with server-side rendered apps. The row layout uses an algorithm adapted from Knuth and Plass line breaking. It aims to give rows of similar height, so panoramas and last-row images are not stretched or shrunk badly. The README includes a minimal setup example, an API documentation site, and CodeSandbox demos for basic row and column layouts, a lightbox, dynamic columns, selection and drag-and-drop sorting. The source is public on GitHub.…
Highlights
- Justified or masonry grid of photos
- Keeps original photo aspect ratios
- Row or column direction layouts
- Custom image renderer for selection and captions
- Works in server-rendered apps
Ratings & Reviews
No ratings yet
Be the first to rate react-photo-gallery.
People also visit

react-image-gallery
Responsive image gallery, carousel, image slider react component
react-photo-gallery FAQ
What is React Photo Gallery?
A React component that shows a set of photos in a justified or masonry grid while keeping each photo's aspect ratio.
How do I install it?
Follow the installation section of the README, then try the minimal setup example.
Can I add a lightbox or selection?
The README's demos include a lightbox and selection built with a custom renderImage function, so you build those behaviours yourself.
Does it work with server-side rendering?
Yes. The README says the component is compatible with SSR apps.
Is it open source?
Yes. The source code is public on GitHub.
What are the best react-photo-gallery alternatives?
Popular alternatives to react-photo-gallery include react-photo-album, react-grid-gallery and react-image-gallery. See all react-photo-gallery alternatives


















