Super Tiny Pinterest-style Grid Library – waterfall.js

Category: Javascript , Layout , Recommended | November 29, 2019
Views Total:2,486 views
Official Page:Go to website
Last Update:November 29, 2019


Super Tiny Pinterest-style Grid Library – waterfall.js


Just another pure JavaScript library that creates a responsive, fluid, Pinterest inspired grid to showcase your products, services, designs, etc. Also known as Masonry Layout.

Dead simple to use and just weights in 1kb (minified).

How to use it:

1. Install and import the waterfall.js library.

# Yarn
$ yarn add waterfall.js
$ npm install waterfall.js --save
import waterfall from './src/waterfall'

2. Or include the minified version of the waterfall.js library on the web page.

<script src="waterfall.min.js"></script>

3. Add as many items to the grid.

<div class="waterfall">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item">3</div>
  <div class="item">4</div>
  <div class="item">5</div>
  <div class="item">6</div>
  <div class="item">7</div>
  <div class="item">8</div>
  <div class="item">9</div>
  <div class="item">10</div>

4. Initialize the grid and done.

// OR
var grid = document.querySelector('waterfall');

You Might Be Interested In:

Leave a Reply