Skip to content
Haze UI

Gallery: project grid

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

pnpm dlx shadcn@latest add @haze/gallery-project-grid
Open preview in a new tab
Liveno JavaScript

When to use

  • Presenting several projects with equal prominence
  • Each item needs a category and an optional link to its full story

When not to use

  • The entries are written articles with dates and authors; use blog-featured-stories

Installation

Add the Haze registry to components.json once, then install Gallery: project grid with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.

pnpm dlx shadcn@latest add @haze/gallery-project-grid
First time? Registry and theme setup

1. Add to components.json:

{
  "registries": {
    "@haze": "http://localhost:4329/r/{name}.json"
  }
}

2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";

API reference

PropTypeDefaultDescription
idstring"gallery-project-grid"Unique section ID prefix.
eyebrowstring"Selected work"Label above the title.
titlestringdemo headingHeading for the collection.
descriptionstringdemo copyIntroduction; the default identifies the illustrations as examples.
headingLevel1 | 2 | 32Section heading level; project headings use the next level.
projects{ title: string; category: string; visual: "app" | "chart" | "photo"; href?: string }[]4 example projectsProject labels, decorative visual variants and optional destinations.
classstring–Additional section classes.

Keyboard interactions

Tab, Enter
Focus and open project links when provided.

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.

Notes for AI

Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.

  • 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": "http://localhost:4329/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: http://localhost:4329/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.

Dependencies

  • npm: @lucide/astro
  • @haze/placeholder
  • @haze/utils
  • @haze/theme (one-time setup)

Source · Original Haze UI work.

Catalog

↑↓ moveEnter openEsc close

Keyboard shortcuts

CtrlK
Command palette
/
Focus search
←↑→↓
Move between cards
jk
Next / previous card
ci
Copy code / install command (detail page)
[]
Previous / next entry
?
This help
Esc
Close dialog