1.0.5 • Published 2 months ago

@jassisingh/react-masonry v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

React masonry layout

React component to create a responsive masonry layout.

Install

npm i @jassisingh/react-masonry

Features

  • Responsive, can add custom breakpoints for number of columns
  • Works fine with dynamic height components.

Usage

<div style={{ padding: 16 }}>
  <Masonry
    padding={16}
    columnBreakPoints={{
      450: 2,
      750: 3,
      1050: 4,
    }}
  >
    {items.map((item) => (
      // Add div on you item component to make it work.
      <div key={item.id}>
        <Item deleteItem={handleDelete} {...item} />
      </div>
    ))}
  </Masonry>
</div>

Example

To run the example app.

    cd example
    npm run dev

npm.io

npm.io

1.0.5

2 months ago

1.0.4

2 months ago

1.0.2

2 months ago

1.0.3

2 months ago

1.0.1

3 months ago

1.0.0

3 months ago