f0rextasy

Gallery Grid

Galleries

About

An image gallery grid of thumbnails that opens a fullscreen lightbox with keyboard arrow and escape navigation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Gallery Grid to your project and fits it to your theme.

Code

How Gallery Grid is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { GalleryGrid, type GalleryImage } from "@/components/ui/gallery-grid";

function placeholder(color: string, label: string) {
  const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><rect width='400' height='400' fill='${color}'/><text x='50%' y='50%' font-family='sans-serif' font-size='28' fill='white' text-anchor='middle' dominant-baseline='middle'>${label}</text></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

const demoImages: GalleryImage[] = [
  {
    id: "1",
    src: placeholder("#6366f1", "Photo 1"),
    alt: "Placeholder photo 1",
  },
  {
    id: "2",
    src: placeholder("#8b5cf6", "Photo 2"),
    alt: "Placeholder photo 2",
  },
  {
    id: "3",
    src: placeholder("#ec4899", "Photo 3"),
    alt: "Placeholder photo 3",
  },
  {
    id: "4",
    src: placeholder("#f59e0b", "Photo 4"),
    alt: "Placeholder photo 4",
  },
  {
    id: "5",
    src: placeholder("#10b981", "Photo 5"),
    alt: "Placeholder photo 5",
  },
  {
    id: "6",
    src: placeholder("#0ea5e9", "Photo 6"),
    alt: "Placeholder photo 6",
  },
];

export default function GalleryGridDemo() {
  return (
    <div className="w-full max-w-xl mx-auto p-6 bg-background text-foreground">
      <GalleryGrid images={demoImages} columns={3} />
    </div>
  );
}

More by f0rextasy

View all
  • Newsletter Signup Card

    Newsletter Signup Card

    5
  • Board Checklist

    Board Checklist

    4
  • Network Graph

    Network Graph

    4
  • Time Input

    Time Input

    3
  • Stamp Seal

    Stamp Seal

    3
  • Empty State Card

    Empty State Card

    2
  • Running Order Timeline

    Running Order Timeline

    2
  • Invite Modal

    Invite Modal

    2

More in Galleries

View all
  • Thumbnail image viewer

    Thumbnail image viewer

    50
  • Editorial Collage Hero

    Editorial Collage Hero

    444
  • Image Gallery

    Image Gallery

    91
  • Animated Gallery

    Animated Gallery

    1.5K
  • Hero Section 6

    Hero Section 6

    891
  • About 3

    About 3

    430
  • Shared Element Gallery

    Shared Element Gallery

    439
  • File Upload

    File Upload

    19