0.0.1 • Published 3 years ago

fb-react-image-grid v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

React Image Grid

Facebook-like image grid for react. (beta)

Installation

npm i react-image-grid yarn add react-image-grid

Usage

import ReactImageGrid from "react-image-grid";

const App = () => {
  const images = [
    "https://cdn.pixabay.com/photo/2021/03/26/07/18/japanese-cherry-blossoms-6125088_1280.jpg",
    "https://cdn.pixabay.com/photo/2018/07/14/15/27/cafe-3537801_1280.jpg",
    "https://cdn.pixabay.com/photo/2019/12/12/07/01/beomeosa-temple-4689959_1280.jpg",
    "https://cdn.pixabay.com/photo/2016/08/09/21/54/lake-1581879_1280.jpg",
    "https://cdn.pixabay.com/photo/2019/10/15/21/34/cat-4552983_1280.jpg",
  ];

  return <ReactImageGrid images={images} />;
};

Options

optiontypedescriptionrequireddefault
imagesarrayArray of image urlsYes[]
classNamestringClass name of containerNo''
onClickfunctionOn image clickNo() => {}

Todo

  • onClick method.
  • when image is exact square.
  • other options.