# Gallery, masonry

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

Images in balanced columns with mixed frame shapes (wide, square, tall) and a caption under each. Use when the pictures are not all the same crop.

## Import

- **CLI**

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

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

Also called

- gallery/masonry

- **About**: Images in balanced columns with mixed frame shapes (wide, square, tall) and a caption under each. Use when the pictures are not all the same crop. Empty caption hides the line.
- **Category**: A grid of images with captions. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: Images in balanced columns where each frame can be wide, square or tall, with a caption below. It suits photos that were not shot to one crop; `gallery-grid` is tidier when they are all the same.
- **Writing for it**: - Set shape for each item to wide (4 to 3), square or tall (3 to 4). Alternate them, because a run of the same shape gives you a plain grid.
- Choose columns '2' or '3' for the widest container. Narrower containers use fewer on their own.
- Add at least two items, up to twelve. Captions of up to 120 characters count in the height balancing, so empty ones change where columns break.
- **Watch out for**: Column breaks are computed from the shapes and whether a caption exists, so reordering items or clearing a caption can move pictures between columns. Reading order runs down each column, not across rows.

## Pairs well with

- **[Features, alternating](/blocks/features/alternating)**
- **[Call to action, over an image](/blocks/cta/media)**
- **[Contact, offices](/blocks/contact/offices)**

## 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 GalleryMasonry from '@/components/klarhimmel/blocks/gallery-masonry';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <GalleryMasonry props={{
          "eyebrow": "Name the topic",
          "title": "Invite them to look around the place",
          "description": "Say in one line how the pictures were taken.",
          "columns": "3",
          "items": [
            {
              "shape": "square",
              "media": {
                "src": "/pictures/photo-wed1.avif",
                "alt": "A timber barn hall dressed with white fabric and tables"
              },
              "caption": "Name what this shows"
            },
            {
              "shape": "wide",
              "media": {
                "src": "/pictures/photo-wood3.avif",
                "alt": "A workbench with hand tools on the wall"
              },
              "caption": "Name the subject"
            },
            {
              "shape": "square",
              "media": {
                "src": "/pictures/photo-bakery1.avif",
                "alt": "A bakery counter with loaves and pastries behind glass"
              },
              "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'.
- **items**: List of 2 to 12. Each item: shape ('wide' | 'square' | 'tall'), media, caption.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/gallery/grid)

[Next](/blocks/gallery/mosaic)
