Masonry gallery
A masonry grid of photos with varying heights, with no layout script, where each photo opens large with keyboard navigation.
- Tailwind
- React
- CSS
- WordPress
Description
To show work whose photos come in different formats (portrait, landscape, square), this gallery lays them out in CSS columns: no image is cropped and no layout library is loaded. Each photo is a button named “Enlarge: …” with a visible caption; it opens a large view in a native dialog element that keeps focus inside and closes with Escape, the Close button or a click on the backdrop. Arrow keys and the previous / next buttons move between photos (looping), the “Photo 3 of 8” counter and caption follow, and focus returns to the last photo viewed on close. The demo images are CSS drawings: replace them with your photos and keep the alt text. One to three columns depending on width, 44 px targets in the large view, visible focus, AA contrast in light and dark mode, no horizontal scrolling from 360 px. Example: a mason's building sites.
Code
Loading the code…
The code of this component in
Reviews
No reviews yet.
In the same spirit

A product photo that zooms in under the pointer, and from the keyboard with Enter and the arrow keys, to inspect the details.
- Tailwind
- React
- CSS
- WordPress

An Instagram-style square grid with a profile header and captions on hover, served by your own site: no social network script or cookie.
- Tailwind
- React
- CSS
- WordPress

Building site photos sorted by dated step on a vertical timeline, with the current step highlighted.
- Tailwind
- React
- CSS
- WordPress

A large photo with clickable thumbnails and arrows, for a product page or a property listing.
- Tailwind
- React
- CSS
- WordPress