atm

Atomix

v0.4.6

    1. Home
    2. Layouts
    3. Masonry Grid

Getting Started
  • Introduction
  • Installation
  • Quick Start
  • Migration Guide
  • CLI Reference
Design Tokens
  • Overview
  • All Tokens
  • Colors
  • Spacing
  • Typography
  • Grid
  • Elevation
Styles System
  • Architecture
  • Customization
  • Utilities
  • API Reference
Layouts
  • Grid System
  • Masonry Grid
  • Responsive Patterns
  • Customization
  • Performance
Components
  • Overview
  • Guidelines
  • Accordion
  • AtomixGlass
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • ButtonGroup
  • Card
  • Checkbox
  • Date Picker
  • Dropdown
  • Form
  • Input
  • Modal
  • Progress
  • Radio
  • Rating
  • Select
  • Slider
  • Spinner
  • Tab
  • Textarea
  • Toggle
  • Tooltip
  • Upload
  • Block
  • Callout
  • Countdown
  • Hero
  • Icon
  • List
  • Messages
  • Navbar
  • Pagination
  • Popover
  • Steps
  • SectionIntro
  • Container
  • Grid
  • GridCol
  • Row
  • River
  • MasonryGrid
  • DataTable
  • EdgePanel
  • SideMenu
  • Nav
  • NavItem
  • NavDropdown
  • VirtualizedGrid
Guides
  • Theming Guide
  • AtomixGlass Performance
  • AtomixGlass Theming
  • Theme Studio
  • Devtools
  • Theme Inspector
  • Theme Preview
  • Theme Comparator
  • Live Editor
  • CLI Tool
  • Try Live Editor
  • Try Inspector
  • Try Preview
  • Try Comparator
  • AtomixGlass Playground
Examples
  • Common Patterns
  • Landing Page
API Reference
  • React API
  • JavaScript API
  • CSS API
CLI
  • Overview
  • User Guide
  • API Reference
  • Migration Guide
  • Security Guide
Resources
  • Roadmap
  • Changelog
  • Contributing

Atomix Design System

A comprehensive design system for building modern, accessible, and performant web applications with React and vanilla JavaScript.
GitHubTwitterDiscordNPM

Getting Started

IntroductionInstallationQuick StartTheming Guide

Documentation

ComponentsDesign TokensStyles SystemLayouts

Resources

GitHub Repository↗NPM Package↗Storybook↗API Reference

Community

ContributingRoadmapChangelogReport Issue↗

© 2026 Atomix Design System. Built with ❤️ by the Shohojdhara.

Pinterest-Style Dynamic Layouts

Masonry Grid

Create beautiful Pinterest-style layouts with our flexible masonry grid component. Automatically positions items of varying heights for optimal space usage.

View ExamplesPerformance Guide

Masonry Grid System

The Atomix Masonry Grid provides a dynamic, Pinterest-style layout that automatically positions items based on their height, creating an optimal grid with minimal gaps.

The Masonry Grid uses JavaScript to calculate optimal positioning for items of varying heights, creating a visually appealing layout that maximizes space usage. Items are positioned column by column, with each new item placed in the column with the shortest current height.

Dynamic Positioning

Automatic optimal item placement

Responsive Design

Configurable columns per breakpoint

Image Loading Support

Handles image loading and layout recalculation

Performance Optimized

ResizeObserver and efficient algorithms

Smooth Animations

Optional item transition animations

Accessible

Maintains semantic HTML structure

Components

Learn how to use the masonry grid components to build dynamic layouts

MasonryGrid

The main container that manages item positioning and responsive behavior.

TypeScript / React
import { MasonryGrid, MasonryGridItem } from '@shohojdhara/atomix';

<MasonryGrid 
  columns={3}
  gap={16}
  className="my-masonry-grid"
>
  <MasonryGridItem>
    <img src="image.jpg" alt="Description" />
    <p>Item content</p>
  </MasonryGridItem>
</MasonryGrid>

Props

MasonryGrid Props

columns
Number of columns (default: 3)
gap
Gap between items in pixels (default: 16)
className
Custom CSS class
children
MasonryGridItem components

MasonryGridItem Props

className
Custom CSS class
children
Item content

Responsive Configuration

Configure columns for different breakpoints:

Responsive Example
<MasonryGrid 
  columns={{
    xs: 1,
    sm: 2,
    md: 3,
    lg: 4,
    xl: 5
  }}
  gap={16}
>
  {/* Items */}
</MasonryGrid>

Performance Tips

Use fixed aspect ratios when possible
Limit the number of items for better performance
Debounce resize events
Use virtualization for large datasets