npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@masonrygrid/angular

v0.9.4

Published

Masonry grid component for Angular

Readme

@masonrygrid/angular

A responsive column masonry layout for Angular. Build flexible grids where items naturally fill the space around them, with responsive independent column control over how much space each item occupies.

Install

npm install @masonrygrid/angular

Requires Angular 20 or newer.

Basic usage

Both components are standalone:

import { Component } from '@angular/core';
import { MasonryGrid, MasonryItem } from '@masonrygrid/angular';

const heights = [227, 295, 352, 292, 180, 260];

@Component({
  selector: 'demo',
  standalone: true,
  imports: [MasonryGrid, MasonryItem],
  template: `
    <masonry-grid [spacing]="{ x: 16, y: 16 }">
      @for (height of heights; track $index) {
        <masonry-item [colSpan]="{ lg: 4 }">
          <div
            class="item"
            style="outline: 1px solid black"
            [style.height.px]="height"
          ></div>
        </masonry-item>
      }
    </masonry-grid>
  `,
})
export class Demo {
  heights = heights;
}

Attributes such as id, class or data-* work on both elements as on any other element.

Demo

see: live playground

<masonry-grid>

| Input | Type | Default | Description | | --------- | -------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ | | spacing | number \| string \| { x?: number \| string; y?: number \| string } | "1rem" | Space between items. Numbers are pixels, strings can be any CSS length. Use an object to set each axis separately. |

<masonry-item>

| Input | Type | Default | Description | | --------- | ------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- | | colSpan | number \| "auto" \| "fill" \| ResponsiveColSpan | "auto" | Columns the item spans out of 12. "auto" sizes it to its content and "fill" makes it take the remaining space of the row. |

Responsive colSpan

Pass an object to change the span per breakpoint. Each value applies from that screen width upwards (min-width):

| Key | From | | ----- | ------ | | xs | 320px | | sm | 576px | | md | 768px | | lg | 992px | | xl | 1200px | | xxl | 1400px |

<masonry-item [colSpan]="{ xs: 12, md: 6, xl: 3 }">...</masonry-item>

Things to know

  • Items must be direct content of <masonry-grid>, in the same template. @for and @if blocks around them are fine; wrapping them in your own component is not.
  • The layout is calculated in the browser. Items are measured and placed after the first render, and recalculated whenever the grid or any item changes size (for example, when an image finishes loading). With server rendering, the grid takes its final layout after hydration.

Styles

The styles are injected into the page when the package is loaded in the browser, so there is nothing to configure.

If your app is server-rendered or has a strict Content Security Policy, add the stylesheet to the styles of your angular.json as well:

"styles": ["node_modules/@masonrygrid/angular/style.css"]

License

MIT