Back to components
ComponentGalleryFree

Masonry Photo Gallery React component

A masonry photo gallery with category tabs under a sliding hairline, photos that glide to their new columns when filtered, hover focus that dims the rest, scroll-in reveals and a captioned keyboard lightbox.

About the Masonry Photo Gallery component

Masonry Photo Gallery lays photos of mixed shapes into tidy columns, each photo dropping into the shortest column so the wall stays even. Category tabs on top filter the set, and the photos that remain glide to their new places instead of jumping.

Hovering a photo dims the others and slides in its caption, photos fade up as they scroll into view, and clicking one opens a lightbox that steps through the current filter with the arrow keys.

When to use it

Use it for a photographer's or studio's portfolio, a press or event gallery, or any collection where photos have different shapes and visitors want to narrow it down by type.

When every image shares one shape, a plain grid reads better; masonry earns its place with mixed portrait and landscape photos.

Installation

Add the Masonry Photo Gallery component to your project with the shadcn CLI. It lands in components/masonry-photo-gallery.tsx as plain React + Tailwind CSS source you own and can edit.

Install
Copied!
npx shadcn@latest add @reactframe/masonry-photo-gallery

Or copy the source by hand and install its dependencies:

Install
Copied!
npm install clsx tailwind-merge

More Gallery components

Dome Photo Sphere
Free
Photo Album
Free
Spiral Gallery
Free
Gallery Curve
Floating Photo Wall
Free
Gallery Flow
Free