@dinethpiyumantha/react-image-grid-gallary
v1.0.0
Published
JS library for easialy create a image gallary
Downloads
3
Maintainers
Readme
react-image-grid-gallary
This React Component displays an image gallery using CSS Grid.
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)