Socket
Socket
Sign inDemoInstall

react-masonry-infinite

Package Overview
Dependencies
9
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-masonry-infinite

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


Version published
Weekly downloads
493
decreased by-3.14%
Maintainers
1
Install size
491 kB
Created
Weekly downloads
 

Readme

Source

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

  • Masonry layout
  • Perfomance of Bricks.js (Bricks.js homepage)
  • Infinite scroll from a box

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(id =>
            <div key={id} />
        )
    }
</MasonryInfiniteScroller>
...

Props

PropsTypeDefaultDescription
classNameString''CSS className for root element
packBooleanfalseFlag to force pack on every update
packedStringdata-packedAn 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
sizesArray[{ 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
positionBooleantrueA Boolean indicating that the grid items should be positioned using the top and left CSS properties.
styleObject{}The inline style

And other React Infinite Scroller props.

Methods

MethodDescription
forcePackPacks Bricks.js instance (usefull when data is dynamic)
forceUpdateUpdates Bricks.js instance
createNewInstanceRecreates Bricks.js instance. E.g. when you need to dynamically handle amount of columns.

License

MIT

Keywords

FAQs

Last updated on 23 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc