# Gallery: project grid

> A two-column project collection with image placeholders and optional detail links.

- Kind: block · Category: Gallery · Interactivity: native
- Install: `npx shadcn@latest add @haze/gallery-project-grid`
- File: `src/components/haze/blocks/gallery-project-grid.astro`
- npm dependencies: @lucide/astro
- Registry dependencies: @haze/placeholder, @haze/utils
- Docs page: https://hazeui.com/blocks/gallery-project-grid

## Use when
- Presenting several projects with equal prominence
- Each item needs a category and an optional link to its full story

## Avoid when
- The entries are written articles with dates and authors; use blog-featured-stories

## Alternatives
- [blog-featured-stories](https://hazeui.com/blocks/blog-featured-stories.md)

## Props

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| id | `string` | "gallery-project-grid" | no | Unique section ID prefix. |
| eyebrow | `string` | "Selected work" | no | Label above the title. |
| title | `string` | demo heading | no | Heading for the collection. |
| description | `string` | demo copy | no | Introduction; the default identifies the illustrations as examples. |
| headingLevel | `1 \| 2 \| 3` | 2 | no | Section heading level; project headings use the next level. |
| projects | `{ title: string; category: string; visual: "app" \| "chart" \| "photo"; href?: string }[]` | 4 example projects | no | Project labels, decorative visual variants and optional destinations. |
| class | `string` |  | no | Additional section classes. |

## Accessibility
- Each project has a heading and category; the placeholder artwork is decorative.
- A title becomes a descriptive link only when its project has a destination.
- Key Tab, Enter: Focus and open project links when provided.

## Agent prompts

### Install and use

Install the Haze UI block "Gallery: project grid" with `npx shadcn@latest add @haze/gallery-project-grid`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "https://hazeui.com/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import GalleryProjectGrid from "@/components/haze/blocks/gallery-project-grid.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: https://hazeui.com/blocks/gallery-project-grid.md

### Customize with real content

Adapt the Haze gallery-project-grid block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, projects, class. Keep the layout, the heading level rules and these accessibility details: Each project has a heading and category; the placeholder artwork is decorative. A title becomes a descriptive link only when its project has a destination. Do not add raw color classes; use the Haze tokens.

### Choose the right block

Before using gallery-project-grid, check it fits: use it when presenting several projects with equal prominence; each item needs a category and an optional link to its full story. Avoid it when the entries are written articles with dates and authors; use blog-featured-stories. Alternatives: @haze/blog-featured-stories.

## Example requests that should lead here
- Show a two-column gallery of selected projects with categories

## Source

```astro
---
import { ArrowUpRight } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
import Placeholder from "../ui/placeholder.astro";

interface Props {
  id?: string;
  eyebrow?: string;
  title?: string;
  description?: string;
  headingLevel?: 1 | 2 | 3;
  projects?: { title: string; category: string; visual: "app" | "chart" | "photo"; href?: string }[];
  class?: string;
}

const {
  id = "gallery-project-grid",
  eyebrow = "Selected work",
  title = "A few ways ideas can take shape",
  description = "An example collection of projects, with illustrations standing in for finished work.",
  headingLevel = 2,
  projects = [
    { title: "A calmer project home", category: "Workspace", visual: "app" },
    { title: "A view of the week ahead", category: "Planning", visual: "chart" },
    { title: "A shared place for decisions", category: "Collaboration", visual: "app" },
    { title: "A clearer progress report", category: "Reporting", visual: "chart" },
  ],
  class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
const ProjectHeading = ({ 1: "h2", 2: "h3", 3: "h4" } as const)[headingLevel];
---

<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-20 sm:py-24", className)}>
  <div class="mx-auto max-w-6xl">
    <div class="max-w-2xl">
      <p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
      <Heading id={`${id}-title`} class="mt-3 text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</Heading>
      <p class="mt-4 text-base/7 text-pretty text-muted-foreground">{description}</p>
    </div>
    <ul class="mt-12 grid gap-x-6 gap-y-10 sm:grid-cols-2">
      {projects.map((project) => (
        <li class="min-w-0">
          <Placeholder variant={project.visual} class="aspect-[4/3]" />
          <div class="mt-4 flex items-start justify-between gap-4">
            <div>
              <p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{project.category}</p>
              <ProjectHeading class="mt-1 text-base/6 font-semibold tracking-tight text-foreground">
                {project.href ? <a href={project.href} class="rounded-sm transition-colors duration-150 ease-snappy hover:text-foreground/80 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring">{project.title}<span class="sr-only">: view project</span></a> : project.title}
              </ProjectHeading>
            </div>
            {project.href && <ArrowUpRight aria-hidden="true" class="mt-2 size-4 shrink-0 text-muted-foreground" />}
          </div>
        </li>
      ))}
    </ul>
  </div>
</section>
```
