f0rextasy

Gallery Grid

Galleries 4

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

    21
  • Stamp Seal

    Stamp Seal

    18
  • Network Graph

    Network Graph

    18
  • Board Checklist

    Board Checklist

    17
  • Navbar

    Navbar

    14
  • Running Order Timeline

    Running Order Timeline

    13
  • Milestone Chart

    Milestone Chart

    11
  • Empty State Card

    Empty State Card

    9

More in Galleries

View all
  • Photo Deck

    Photo Deck

    49
  • Cylinder Tunnel Gallery

    Cylinder Tunnel Gallery

    7
  • Scattered About

    Scattered About

    54
  • Animated Gallery

    Animated Gallery

    1.6K
  • Phantom Infinite Gallery

    Phantom Infinite Gallery

    58
  • Gallery Component

    Gallery Component

    23
  • Image Gallery

    Image Gallery

    131
  • Hero Section 6

    Hero Section 6

    968