npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-picture-grid

v1.0.41

Published

React Picture Grid Library

Downloads

206

Readme

Codacy Badge GitHub top language GitHub language count npm bundle size GitHub code size in bytes npm NPM npm GitHub Release Date GitHub last commit

Demo

See Demo Here

How to Use

Install react-picture-grid as dependency

npm i react-picture-grid --save

or if you use yarn

yarn install react-picture-grid

In your component first import

import { ReactPictureGrid } from 'react-picture-grid';

Set your data

const data = [
  {
    image:
      'https://images.unsplash.com/photo-1475778057357-d35f37fa89dd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80',
    title: 'Nature 01',
    description: 'This picture is taken from unsplash.com',
  },
  {
    image:
      'https://images.unsplash.com/photo-1502675135487-e971002a6adb?ixlib=rb-1.2.1&auto=format&fit=crop&w=668&q=80',
    title: 'Nature 02',
    description: 'This picture is taken from unsplash.com',
  },
  {
    image:
      'https://images.unsplash.com/photo-1501862700950-18382cd41497?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=894&q=80',
    title: 'Nature 03',
    description: 'This picture is taken from unsplash.com',
  },
  {
    image:
      'https://images.unsplash.com/photo-1532040675891-5991e7e3d0cd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80',
    title: 'Nature 04',
    description: 'This picture is taken from unsplash.com',
  },
];

then call component

<ReactPictureGrid data={data} showTitle gap={10} />

API Documentation

| Prop | Type | Details | | -------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- | | data | array of data props | This is the basic data array for your picture gallery. Please see Data prop to know how to send data or see example above | | showTitle | boolean | If this is true it will show title and description from data prop. | | showPreview | boolean | Allows you to see preview | | gap | number | The gap between each picture grid. gap is in px | | className | string | You can Pass a class to change attribute in picture grid | | imageClass | string | Any custom class if you want to pass directly to image file | | backDropColor | string | Color in Hex or Rgba format | | showImageInfo | boolean | Allows you to see Image's title and description if provided true when showPreview prop is true | | showImageCount | boolean | Allows you to see Image count in showImageInfo when both showImageInfo & showPreview is true | | closeOnClick | boolean | Allows you to see close Image Preview when user clicked on background | | pattern | array | string array of (big - tall - small - wide) . big - 2x2, small- 1x1, wide - 1x2, tall - 2x1 |

Data Prop

| Prop | Type | Details | | ----------- | ------ | ------------------------- | | image | string | Image link you show | | title | string | Title of that image | | description | string | Description of that image |

Develop

Clone the repo from github

$ git clone https://github.com/sazzadsazib/react-picture-grid

Install Dependencies

$ yarn install

Then, Run storybook

$ yarn storybook

To run tests

$ yarn test

How to Contribute

Fork the repo. pull the master branch if required. Create a issue why we need this feature, then create your feature branch do your changes. write test code if required. and Send a Pull Request . PR's are always welcome!

Release log

25 March 2020 - v 1.0.4/1.0.41

  • [x] Fixed Backdrop sizing
  • [x] Added Backdrop Color Prop as backDropColor
  • [x] Added Props showImageInfo , showImageCount & closeOnClick

24 March 2020 - v 1.0.3

  • [x] Fixed Documentation Error

24 March 2020 - v 1.0.2

  • [x] Added props showPreview for Image Preview

23 March 2020 - v 1.0.1

  • [x] Updated Documentation
  • [x] Updated storybook

23 March 2020 - v 1.0.0

  • [x] Initial Release with Component.