2.1.0 • Published 8 years ago

react-masonry-mixin v2.1.0

Weekly downloads
34
License
MIT
Repository
github
Last release
8 years ago

React Masonry Mixin

npm version

Introduction:

A React.js Masonry mixin. (Also available as a component - you should use that instead!)

Live demo:

hearsay.me (web) hearsay.me (github)

Usage:

  • The mixin is now bundled with Masonry, so no additional dependencies needed!
  • You will have to use Masonry as a script dependency, as there is no complete npm module available at the moment.
  • You can optionally include Masonry as a script tag <script src='//cdnjs.cloudflare.com/ajax/libs/masonry/3.1.5/masonry.pkgd.min.js' />

  • To use the mixin

  • require the mixin and inject React
  • pass a reference and a masonry options object
  • make sure you use the same reference as ref in your component
  • if you need to - access the masonry object through this.masonry in your component

  • example code

var React = require('react');
var MasonryMixin = require('react-masonry-mixin')(React);
 
var masonryOptions = {
    transitionDuration: 0
};
 
var SomeComponent = React.createClass({

    mixins: [MasonryMixin(React)('masonryContainer', masonryOptions)],
 
    render: function () {
        var childElements = this.props.elements.map(function(element){
           return (
                <div className="someclass">
                    {element.name}
                </div>
            );
        });
        
        return (
            <div ref="masonryContainer">
                {childElements}
            </div>
        );
    }
});

module.exports = SomeComponent;
2.1.0

8 years ago

2.0.0

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.7

9 years ago

0.5.6

9 years ago

0.5.5

9 years ago

0.5.4

9 years ago

0.5.3

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.0

10 years ago

0.3.8

10 years ago

0.3.7

10 years ago

0.3.6

10 years ago

0.3.5

10 years ago

0.3.4

10 years ago

0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago