# Gallery, grid

- **[Sections](/blocks/)**
- **[Gallery](/blocks/gallery/)**
- **Gallery, grid**

A grid of images with captions under a heading, filled row by row. columns "2" keeps pairs side by side, such as before and after.

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/gallery-grid
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/gallery-grid';
  ```

Also called

- gallery/grid

- **About**: A grid of images with captions under a heading, filled row by row. columns "2" keeps pairs side by side, such as before and after. Give items a price and a note to show things for sale.
- **Category**: A grid of images with captions. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: Even grid of equally cropped images with captions under a heading. Use it for a set of similar frames; when the pictures vary in shape, `gallery-masonry` avoids cropping them all to one ratio.
- **Writing for it**: - You can add one to twelve items. Six or nine fill the three-column layout without a ragged last row.
- Captions are 120 characters. A few words naming the thing shown work better than a sentence repeating the alt text.
- Use alt text to describe the picture and the caption to say why it is here, so the two do not duplicate each other.
- **Watch out for**: Every image is forced to 4 by 3, which crops portrait photos. Captions are hidden when empty, so mix captioned and uncaptioned items and the rows will have different heights.

## Pairs well with

- **[Team, grid](/blocks/team/grid)**
- **[Testimonials, wall](/blocks/testimonials/wall)**
- **[Call to action, band](/blocks/cta/banner)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import GalleryGrid from '@/components/klarhimmel/blocks/gallery-grid';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <GalleryGrid props={{
          "eyebrow": "Name the topic",
          "title": "Say what the pictures show",
          "description": "Say in one line what the pictures show and where they were taken.",
          "items": [
            {
              "media": {
                "src": "/pictures/photo-rest1.avif",
                "alt": "An empty dining room with long tables and pendant lamps"
              },
              "caption": "Name the subject"
            },
            {
              "media": {
                "src": "/pictures/photo-salon2.avif",
                "alt": "A salon interior in black and white with chairs and mirrors"
              },
              "caption": "Name the subject"
            },
            {
              "media": {
                "src": "/pictures/photo-spa1.avif",
                "alt": "A treatment room with a massage table by a window"
              },
              "caption": "Name the subject"
            }
          ]
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **eyebrow**: Text, up to 60 characters.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters.
- **columns**: One of '2', '3'. Optional; empty is not rendered.
- **actions**: List of up to 2. Optional; empty is not rendered.
- **tiles**: Optional; empty is not rendered.
- **titleSize**: One of 'heading', 'display'. Optional; empty is not rendered.
- **items**: List of 1 to 24. Each item: media, caption, price (optional), note (optional), href (optional).
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/gallery/featured)

[Next](/blocks/gallery/masonry)
