npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-masonry-infinite-with-capture

v1.2.1

Published

React component for masonry infinite grid. Based on Bricks.js, React Infinite Scroller and React Masonry Layout.

Downloads

5

Readme

React Masonry Infinite

npm

Very simple React.js component for masonry grid. Based on Bricks.js, React Infinite Scroller and React Masonry Layout.

Component is mostly suitable for static data, but can be used with dynamic with instance methods.

Demo

Demo page

Features

Instalation

Using NPM

  npm install --save react-masonry-infinite 

Using yarn

  yarn add react-masonry-infinite 

Basic example

import MasonryInfiniteScroller from 'react-masonry-infinite';

...
<MasonryInfiniteScroller hasMore={this.state.hasMore} loadMore={() => this.setState({ elements: this.state.elements.push("Element") })}>
    {
        this.state.elements.map((el, index) =>
            <div key={index}/>
        )
    }
</MasonryInfiniteScroller>
...

Props

|Props|Type|Default|Description| |:-:|:-:|:--|:--| | className | String | '' | CSS className for root element | | pack | Boolean | false | Flag to force pack on every update | | packed | String | data-packed | An attribute added to the grid items after they're positioned within the grid. If the attribute is not prefixed with data-, it will be added. See Bricks.js | | sizes | Array | [{ columns: 1, gutter: 20 }, { mq: '768px', columns: 2, gutter: 20 }, { mq: '1024px', columns: 3, gutter: 20 }] | An array of objects describing the grid's properties at different breakpoints. When defining your sizes, note the rules of Bricks.js | | position | Boolean | true | A Booleanean indicating that the grid items should be positioned using the top and left CSS properties. | | style | Object | {} | The inline style | | pageStart | Number | 0 | The page number corresponding to the initial items, defaults to 0 which means that for the first loading, loadMore will be called with 1 | | loadMore | Function | (pageToLoad) => {} | This function is called when the user scrolls down and we need to load items | | hasMore | Boolean | true | Booleanean stating whether there are more items to be loaded. Event listeners are removed if false | | loader | DOMNode | null | Loader element to be displayed while loading items | | threshold | Number | 250 | The distance between the bottom of the page and the bottom of the window's viewport that triggers the loading of new items | | useWindow | DOMNode | null | Booleanean stating whether to add listeners to the window, or else, the DOMNode | | element | String | div | Element type of infinite scroll container |

Methods

|Method|Description| |:-:|:--| |forcePack|Packs Bricks.js instance (usefull when data is dynamic)| |forceUpdate|Updates Bricks.js instance|

License

MIT