Skip to content

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
Open in a new tab

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

Archive contents

galerie-maconnerie-html-tailwind.zip3 files · 6 Ko

  • index.html17 Ko
  • README.md4 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

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
    Component
  • Building site photos sorted by dated step on a vertical timeline, with the current step highlighted.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component