Masonix

Responsive masonry layouts for React.

A small set of components for CSS masonry, measured shortest-column placement, and virtualized feeds. Supports responsive columns, server rendering, and custom card markup.

Get started

Virtualize large masonry feeds.

This example contains 10,000 items. Jump through the dataset while Masonix limits rendering to the visible window and its overscan.

10,000 item feed

Layout behavior without a design system.

Masonix handles placement, measurement, and windowing. It does not prescribe card markup, styling, imagery, or interaction.

View the examples
Gallery.tsx
import { MasonryBalanced } from 'masonix';

export function Gallery({ photos }) {
  return (
    <MasonryBalanced
      items={photos}
      columnWidth={260}
      maxColumns={4}
      gap={16}
      getItemHeight={(photo, _index, width) =>
        width * (photo.height / photo.width)
      }
      itemKey={(photo) => photo.id}
      render={PhotoCard}
    />
  );
}

Build your first masonry grid.

Install Masonix and start with the CSS-first component. Measurement and virtualization are available when the workload requires them.

Read getting started