You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@prof-dev/masonry

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prof-dev/masonry

2.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

CSS Grid masonry polyfill

npm package

A simple, easy-to-use solution for creating masonry-style grids with CSS Grid. This library checks for support of grid-template-rows: masonry in the browser. If unsupported, it automatically adjusts item placement to simulate a masonry layout.

It supports any grid-template-columns configuration and allows flexible use of @media queries to adjust column layouts.

Note: This polyfill does not implement any packing algorithms. The original order of items will be preserved.

Demo

Installation

npm i @prof-dev/masonry

Example

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, auto));
  align-items: start;
  gap: 12px;
}
const grid = document.querySelector(".masonry-grid");

if (grid !== null) {
  new Masonry(grid);
}

FAQs

Package last updated on 20 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts