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

vue3-masonry-css

v1.0.8

Published

Vue Masonry component powered by CSS, dependancy free

Readme

Vue3 Masonry CSS

A lightweight and customizable Masonry Grid component for Vue, powered by native CSS columns. Perfect for building responsive, gap-free layouts — with zero dependencies and full control over structure, styling, and breakpoints.

📚 Table of Contents

✨ Features

  • 🧱 Simple Masonry Layout using CSS columns
  • 🎯 Responsive column & gutter configuration with breakpoints
  • 💅 Built-in styling (or fully customizable)
  • 🧩 Flexible tag and class configuration for all levels
  • 💨 Lightweight and dependency-free
  • ⚙️ Fully compatible with Vue 3 Composition API + TypeScript

❓ Why Vue3 Masonry CSS?

Unlike JavaScript-heavy masonry libraries, vue3-masonry-css uses native CSS columns, offering a lightweight, dependency-free layout solution that's:

  • 🧱 Fully responsive — adapts to any screen size with breakpoint support
  • 🎨 Easy to customize — tag names, classes, and attributes are fully configurable
  • ⚡ Fast to render — no layout shift, thanks to pure CSS-based rendering
  • 🪶 Lightweight — no dependencies, no runtime overhead
  • 🛠️ Dev-friendly — built with TypeScript and Vue 3 Composition API
  • 🧩 Flexible — works with any child components or elements you provide

📦 Installation

Install using yarn

yarn add vue3-masonry-css

Install using NPM

npm install --save vue3-masonry-css

🚀 Basic Usage

<template>
  <MasonryGrid 
    :columns="{ default: 4, 1024: 3, 768: 2, 480: 1 }"
    :gutter="'1rem'"
  >
    <MasonryGridItem>
      <Component1 />
    </MasonryGridItem>
    <MasonryGridItem>
      <Component2 />
    </MasonryGridItem>
    <MasonryGridItem>
      <Component3 />
    </MasonryGridItem>
  </MasonryGrid>
</template>

<script setup lang="ts">
import { MasonryGrid, MasonryGridItem } from 'vue3-masonry-css';
</script>

⚙️ Props

| Prop | Type | Default | Description | | ----------------------------- | ------------------------------------------------------ | ----------- | --------------------------------------------------------------------- | | columns | number \| Record<number, number> | 2 | Static or responsive column count. | | gutter | number \| string \| Record<number, number \| string> | 0 | Define static gutter width or dynamic gutter width using breakpoints. | | css | boolean | true | Set to false if you want to use custom styling. | | tag | string | 'div' | The HTML tag name of the container element. | | class | any | undefined | Custom class of the container element. | | columnTag | string | 'div' | The HTML tag name of the column element. | | columnClass | any | undefined | Custom class of the column element. | | columnAttr | any | undefined | Custom attributes of the column element. | | childTag | string | 'div' | The HTML tag name of the child element. | | childClass | any | undefined | Custom class of the child element. | | childAttr | any | undefined | Custom attributes of the child element. |

columns

Define static column count or dynamic column count using breakpoints.

Static column count
<masonry :cols="3">...</masonry>
Dynamic column count
<masonry :cols="{ default: 4, 1920: 3, 1366: 2, 1280: 1 }">...</masonry>

gutter

Define static gutter width or dynamic gutter width using breakpoints.

The value can be a number (e.g. 10 for 10px) or a string value (e.g. 10px or 2rem).

Static gutter width
<masonry :gutter="10">...</masonry>
<masonry :gutter="'2rem'">...</masonry>
Dynamic gutter width
<masonry :gutter="{ default: 50, 1920: '30px', 1366: '2rem' }">...</masonry>

css

Set to false if you want to use custom styling.

Default: true

tag

The HTML tag name of the container element.

Default: 'div'

class

Custom class of the container element.

Default: undefined

columnTag

The HTML tag name of the column element.

Default: 'div'

columnClass

Custom class of the column element.

Default: undefined

columnAttr

Custom attributes of the column element.

Default: undefined

childTag

The HTML tag name of the child element.

Default: 'div'

childClass

Custom class of the child element.

Default: undefined

childAttr

Custom attributes of the child element.

Default: undefined

🤝 Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check issues and open a pull request.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feat/something)
  3. Commit your changes
  4. Push to the branch
  5. Open a PR

📝 License

Released under the MIT License
© Tobias Wälde