vue-next-masonry

21,933
Install
npm install vue-next-masonry
Latest Version:1.1.3
Vue:3
Last Updated:Jul 25, 2021
Links: npm
Maintainer: dapotatoman

Usage

import { createApp } from 'vue';
import masonry from 'vue-next-masonry';

createApp(...)
  .use(masonry)
  .mount(...);

In your Vue template...

<masonry :cols="3" :gutter="30">
  <div v-for="(number, index) in 20" :key="index">
    {{ number }}
  </div>
</masonry>

Here's a codesandbox example

Config

Everything is similar to the original component. You can learn more about props/config here.

Slot support

If you are using a <slot /> to load child items, use the prop :resolve-slot="true".

<masonry :resolve-slot="true">
   <slot />
</masonry>

Related Packages

vue-virtual-masonry

A virtual masonry component for Vue.

851 6
vue-masonry

masonry layout for vue.js

550,378 687
vue-masonry-wall

100% vue masonry without direct dom manipulation, ssr friendly.

28,452 235
@masonrygrid/vue

Masonry grid component for Vue

400 0
@yeger/vue-masonry-wall

Responsive masonry layout with SSR support and zero dependencies for Vue 3.

842,522 380

Version History

Version Released License
1.1.3
1.1.2
1.1.1
1.0.4
1.0.3