Layout

Grid Masonry

A grid masonry component

Overview

The Grid Masonry component arranges items in a masonry layout so columns have equal width but variable height. Content of different heights flows without large gaps, which suits image galleries and cards.

Key Business & UX Benefits

  • Uses vertical space well so short and tall items sit together without gaps.
  • Suits image galleries, pins, and card layouts with mixed heights.
  • Keeps column widths consistent for a clean, predictable grid.
  • Reduces manual layout code for masonry-style UIs.
Pro-Tip from Larry: Use it for image galleries or cards so content flows without big empty spaces.

Usage

GridMasonry
<GridMasonry>
  <div>Item 1</div>
  <div>Item 2</div>
  [...]
</GridMasonry>

Feature List

  • Masonry layout with equal-width columns
  • Variable-height items without large gaps
  • Configurable column count for responsive breakpoints
  • Suitable for image galleries, pins, and card grids

API Reference

PropDefaultType
itemsrequiredunknown[]
columnWidth400number | NonEmptyArray<number>
gap0number
ssrColumns0number
scrollContainernullHTMLElement | null
minColumns1number
maxColumnsnumber
keyMapper(item: unknown, column: number, row: number, index: number): string | number | symbol | undefined
SlotType
default{ item: unknown; column: number; row: number; index: number; }
Copyright © 2026 Laioutr GmbH