@jassisingh/react-masonry
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i @jassisingh/react-masonry

    Weekly Downloads

    0

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    9.94 kB

    Total Files

    17

    Last publish

    Collaborators

    • jassisingh