JSFiddle - React, Tailwind, and code Playground

by crappish

HTML

<script src="http://isotope.metafizzy.co/jquery.isotope.min.js"></script>
<article>
  <div class="tile blue"></div>
  <div class="tile black"></div>
  <div class="tile tall yellow"></div>
  <div class="tile grey"></div>
  <div class="tile wide red"></div>
  <div class="tile green"></div>
  <div class="tile grey"></div>
  <div class="tile blue"></div>
  <div class="tile green"></div>
</article>

CSS

article .tile {
    display: block;
    float: left;

    width: 100px;
    height: 100px;
    
    font-size: 10px;
    
    color: #fff;
}
article .tile.wide {
    width: 200px;
    height: 100px;
}
article .tile.tall {
    width: 100px;
    height: 200px;
}

.tile.yellow { background: yellow; }
.tile.red { background: red; }
.tile.blue { background: blue; }
.tile.black { background: black; }
.tile.grey { background: grey; }
.tile.green { background: green; }

JavaScript

$('article').isotope({
    itemSelector : '.tile',
    masonry: {
        columnWidth: 100
    }
});