Project gallery with lightbox in React
A tradesperson's portfolio: a grid of jobs filtered by type of work, with place, year and duration, and a full-screen lightbox with captions and keyboard navigation.
Here is an excerpt of this component's code in React. The full code is free for members, ready to copy into your project.
This component also comes in
The code in React
import { useEffect, useRef, useState } from "react";
import type { KeyboardEvent, MouseEvent, PointerEvent } from "react";
// Replace each background with a real photo (an <img> with the same alt) when you have one.
const works = [
{
type: "salle-de-bain",
title: "Douche à l'italienne en zellige",
where: "Lyon 6e · 2025 · 3 semaines",
description:
"Receveur extra-plat, paroi vitrée fixe et zellige vert posé à joints fins jusqu'au plafond.",
alt: "Douche à l'italienne carrelée de zellige vert avec une paroi vitrée",Free component: copy it freely, including for commercial projects.
Other galleries and carousels components in React
Galleries and carousels components in React
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

YouTube videos shown as thumbnails: the player only loads on click, to respect privacy and keep the page light.
- Tailwind
- React
- CSS
- WordPress

A slideshow that fills the whole screen, browsed with the keyboard or a finger swipe, and closed with Escape.
- Tailwind
- React
- CSS
- WordPress