Skip to content

Social-style photo grid without third-party scripts in React

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

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

Open in a new tab

The code in React

SocialPhotoGrid.tsx
import { useEffect, useRef } from "react";

const styles = `
[data-gis] [role="img"] {
  background: var(--gis-bg);
}

[data-gis] li:hover [data-gis-cap],
[data-gis][data-gis-captions] [data-gis-cap] {
  opacity: 1;
}

Free component: copy it freely, including for commercial projects.

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

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

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

    • Tailwind
    • React
    • CSS
    • WordPress
    Component
  • Projects sorted by type of work, arranged in tabs that work with the keyboard and screen readers.

    • Tailwind
    • React
    • CSS
    • WordPress
    Component