Minigrid is a minimal 2kb zero dependency cascading grid layout.
Website & Documentation: http://alves.im/minigrid.
There's a simple example on jsbin.
Using NPM
npm install minigrid --save
Or 1998 script tag from unpkg:
<script src="/load/view.php?a=aHR0cHM6Ly91bnBrZy5jb20vbWluaWdyaWRAMy4xLjEvZGlzdC9taW5pZ3JpZC5taW4uanM"></script>
It works on a grid container with a group of grid items.
<div class="cards">
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
</div>
Then:
var grid = new Minigrid({
container: '.cards',
item: '.card',
gutter: 6
});
grid.mount();
Minigrid was built having in mind "cards" with same width and different heights. If your cards have different width sizes or you need more power Minigrid might not be right for you.
Plese see CONTRIBUTING.
MIT © 2016 Henrique Alves