1.0.0 • Published 3 years ago

@dinethpiyumantha/react-image-grid-gallary v1.0.0

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

react-image-grid-gallary

This React Component displays an image gallery using CSS Grid.

NPM JavaScript Style Guide

Install

npm install --save react-image-grid-gallary

Usage

Import resources

import Image1 from './assets/1.jpg'
import Image2 from './assets/2.jpg'

Using component wise

import React, { Component } from 'react'

import GalleryGrid, { GalleryImage } from 'react-image-grid-gallary'
import 'react-image-grid-gallary/dist/index.css'

class App extends Component {
  render() {
    return (
      <GalleryGrid cols={5} >
        <GalleryImage src={ Image1 } title="1 Lorem ipsum dolor sit amet" />
        <GalleryImage src={ Image2 } title="2 Lorem ipsum dolor sit amet" />
      </GalleryGrid>
    )
  }
}

Using as a list

import { GalleryImageList } from 'react-image-grid-gallary' import 'react-image-grid-gallary/dist/index.css'

class App extends Component { render() { return ( <GalleryImageList cols={3} imageList={ {src: Image2, title: "1 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente, dolorem!" }, {src: Image1, title: "2 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sapiente, dolorem!" } } /> ) } }

## License

MIT © [dinethpiyumantha](https://github.com/dinethpiyumantha)