atsol-masonry-react
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

atsol-masonry-react

A lightweight React responsive masonry component.


npm npm npm github

Installaton

npm i atsol-masonry-react

yarn add atsol-masonry-react

Usage example

import { Masonry, MasonryGrid } from "atsol-masonry-react"

const images = [] // Your images array

function App() {
    return (
        <MasonryGrid>
            <Masonry columnsCount={3} gutter={16} className={"waterfall"}>
                {images.map((i, idx) => {
                    return (
                        <img
                            src={i.url}
                            alt="test"
                            key={idx}
                            style={{ minWidth: "100%" }}
                        />
                    );
                })}
            </Masonry>
        </MasonryGrid>
    )
}

Docs

MasonryGrid Default values for breakpoints can be customized throught props

<MasonryGrid columnsBreakpoints={{ 320: 1, 576: 2, 768: 3, 992: 3 }} >

following props for MasonryGrid are available

  • columnsBreakpoints
  • style

Masonry following props for MasonryGrid are available

  • columnsCount
  • gutter
  • className
  • style

note gutter width is set in pixels

Readme

Keywords

Package Sidebar

Install

npm i atsol-masonry-react

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

4.67 kB

Total Files

6

Last publish

Collaborators

  • salymzade