Gathering detailed insights and metrics for vue-masonry-css
Gathering detailed insights and metrics for vue-masonry-css
Gathering detailed insights and metrics for vue-masonry-css
Gathering detailed insights and metrics for vue-masonry-css
npm install vue-masonry-css
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
477 Stars
33 Commits
42 Forks
11 Watching
6 Branches
4 Contributors
Updated on 27 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
46.9%
1,554
Compared to previous day
Last week
9.1%
5,884
Compared to previous week
Last month
-3.6%
23,188
Compared to previous month
Last year
-20.1%
338,287
Compared to previous year
A new masonry component powered by CSS to be fast loading and free of jQuery or other dependencies. Build specifically for Vue.js projects.
Existing solutions like Vue wrapped DeSandro Masonry, while popular, don't actually leverage Vue's highly optimized Virtual DOM renderer and in DeSandro Masonry's case, actually renders elements twice before showing the layout. All of this is ok but we found it to lead to a slow, "laggy" user experience that would occasionally miss-render our layout.
Our need for a simple Masonry layout that was fast, used Vue's Virtual DOM without needing jQuery or other dependencies led us to explore what we could do with the latest techniques using just CSS within a React Component.
Between flexbox, css columns, css grid we settled on plain ol' div's and a dab of flexbox that allows for "fluid" responsive layouts by default but most importantly is true to Vue's rendering lifecycle.
vue-masonry-css
Is a Vue Component with a simple interface to order items into the desired columns at specified breakpoints. With minimal CSS this leads to a quick, reliable solution that also has great browser support along with fast rendering performance ..just as Vue.js intended.
😄 What does this do
🏳️ What doesn't this do
Add vue-masonry-css
to your project:
By script..
1<script src="https://unpkg.com/vue"></script> 2<script src="https://unpkg.com/vue-masonry-css"></script>
Or as a module... npm install vue-masonry-css --save-dev
1import Vue from 'vue' 2import VueMasonry from 'vue-masonry-css' 3 4Vue.use(VueMasonry);
In your HTML template...
1<masonry 2 :cols="3" 3 :gutter="30" 4 > 5 <div v-for="(item, index) in items" :key="index">Item: {{index + 1}}</div> 6</masonry>
Different columns and gutter sizes can be specified by passing an object containing key's of the window widths and their values representing the number of columns or gutter size. To have a fallback value, use the default
key.
note: The cols=
attribute needs to use Vues bind method to evaluate objects. Instead of cols=""
use either v-bind:cols="{ 700: 3 }"
or the shorthand :cols="{ 700: 3 }"
1<masonry 2 :cols="{default: 4, 1000: 3, 700: 2, 400: 1}" 3 :gutter="{default: '30px', 700: '15px'}" 4 > 5 <div v-for="(item, index) in items" :key="index">Item: {{index + 1}}</div> 6</masonry>
In the above example, the number of columns will default to 4. When the window's is between 1000px and 700px, the number of columns will be 3. The key represents the max-width
of the window, and vue-masonry-css
will use the largest key that satisfies this.
https://paulcollett.github.io/vue-masonry-css/demo/
https://github.com/paulcollett/vue-masonry-css
Contact me direct:
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
96 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More