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/vue

v0.9.4

Published

Masonry grid component for Vue

Readme

@masonrygrid/vue

A responsive column masonry layout for Vue. 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/vue

Requires Vue 3 or newer.

Basic Usage

<script setup>

import { MasonryGrid, MasonryItem } from '@masonrygrid/vue';

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

</script>

<template>

  <MasonryGrid spacing="1rem">

    <MasonryItem
      v-for="(height, index) in heights"
      :key="index"
      :col-span="{ lg: 4 }"
    >

      <div
        class="item"
        :style="{ height: height + 'px', outline: '1px solid black' }"
      ></div>

    </MasonryItem>

  </MasonryGrid>

</template>

class, style, id, data-*, aria-* and event listeners work on both components as on any other element.

Demo

see: live playground

MasonryGrid

| Prop | 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. |

MasonryItem

| Prop | 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. In templates, use col-span. |

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 |

<MasonryItem :col-span="{ xs: 12, md: 6, xl: 3 }">...</MasonryItem>

Things to know

  • Items must be direct children of the grid in the rendered DOM. v-for and v-if around them are fine. If a wrapper component adds or removes items on its own, without MasonryGrid re-rendering, the grid doesn't notice them.
  • The grid manages height and each item's top. Don't set those yourself.
  • The layout is calculated in the browser. Items are measured and placed after they are mounted, 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 import.

If your app is server-rendered (Nuxt, for example) or has a strict Content Security Policy, import the stylesheet as well:

import "@masonrygrid/vue/style.css";

TypeScript

Types are included. ColSpan, ResponsiveColSpan and Spacing are exported if you need them.

License

MIT