Socket
Socket
Sign inDemoInstall

masonry-simple

Package Overview
Dependencies
0
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    masonry-simple

Responsive masonry grid


Version published
Maintainers
1
Install size
22.2 kB
Created

Readme

Source

masonry-simple

The MasonrySimple class is designed to create a masonry layout of elements on a page. Vue friendly.

npm GitHub package version NPM Downloads

600B gzipped

DEMO


Installation

Recommended

$ yarn add masonry-simple

Not recommended
Import the masonry-simple.min.js file using the <script> tag. You can download it here. In this connection method, no initialisation is required and it is mandatory to specify the `.masonry' class for the html container.

<script src="path-to-the-file/masonry-simple.min.js"></script>

Import

import MasonrySimple from 'masonry-simple';

Usage

The container can be specified in the following formats: a string value representing the class or id of an element in the DOM, such as '.masonry' or '#masonry'. A Vue reactive reference that contains a DOM element.

const masonry = new MasonrySimple({
  container: '.masonry',
});

masonry.init();
<div class="masonry">
  <div class="masonry__item">
    ...
  </div>
  <div class="masonry__item">
    ...
  </div>
  ...
</div>
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-flow: dense;
  grid-gap: 10px;
}

Destroy

masonry.destroy();

License

masonry-simple is released under MIT license

Keywords

FAQs

Last updated on 19 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc