JSFiddle - React, Tailwind, and code Playground

by Marco

HTML

<script src="http://isotope.metafizzy.co/jquery.isotope.min.js"></script>
<div class="tags">
   <input type="checkbox"  value=".flower" id="flower" /> <label for="flower">Flower </label>
   <input type="checkbox"  value=".plants" id="plants"/> <label for="plants"> Plants</label>
   <input type="checkbox"  value=".beach" id="beach" />  <label for="plants">Beach </label>
</div>



<div id="container">
  <div class="item flower">Flower</div>
  <div class="item plants">Plants</div>
  <div class="item beach">Beach</div>
</div>

CSS

.item {
  width: 60px;
  height: 60px;
  margin: 3px;
  border: 1px solid black;
  float: left;
}

.isotope,
.isotope .isotope-item {
  -webkit-transition-duration: 0.8s;
     -moz-transition-duration: 0.8s;
      -ms-transition-duration: 0.8s;
       -o-transition-duration: 0.8s;
          transition-duration: 0.8s;
}

.isotope {
  -webkit-transition-property: height, width;
     -moz-transition-property: height, width;
      -ms-transition-property: height, width;
       -o-transition-property: height, width;
          transition-property: height, width;
}

.isotope .isotope-item {
  -webkit-transition-property: -webkit-transform, opacity;
     -moz-transition-property:    -moz-transform, opacity;
      -ms-transition-property:     -ms-transform, opacity;
       -o-transition-property:         top, left, opacity;
          transition-property:         transform, opacity;
}


.isotope.no-transition,
.isotope.no-transition .isotope-item,
.isotope .isotope-item.no-transition {
  -webkit-transition-duration: 0s;
     -moz-transition-duration: 0s;
      -ms-transition-duration: 0s;
       -o-transition-duration: 0s;
          transition-duration: 0s;
}

JavaScript

var $container = $('#container')
  var $checkboxes = $('div.tags input')
  $container.isotope({itemSelector: '.item'});
  $checkboxes.change(function(){
    var arr = [];
    $checkboxes.filter(':checked').each(function(){
      arr.push( this.value );
    });
    arr = arr.join(', ');
    $container.isotope({ filter: arr });
  });