react-magnifier-gallery
v1.0.0
Published
Simple react photos gallery component with magnifier
Downloads
1
Readme
react-magnifier-gallery
Friendly for e-commerce product show
Features
- Image list show
- Keep image width-height ratio
- Support video
- Provide magnifier
Installing
yarn add react-magnifier-gallery
You can also still use npm
npm install react-magnifier-gallery --save
Or use directly in your html as UMD component
<script src="https://unpkg.com/[email protected]/dist/react-magnifier-gallery.min.js" />
Run demo
yarn start
Or
npm run start
Go to http://localhost:8080
Basic Usage
import Gallery from 'react-magnifier-gallery';
const imgUrl = [
{thumb: 'https://dummyimage.com/60x40/000/fff', full: 'https://dummyimage.com/1000x800/000/fff.png'},
{thumb: 'https://dummyimage.com/60x40/5ff011/0011ff', full: 'https://dummyimage.com/1000x800/5ff011/0011ff'},
{thumb: 'https://dummyimage.com/60x40/0e0ef0/ff0000.png', full: 'https://dummyimage.com/1000x800/0e0ef0/ff0000.png'},
{thumb: 'https://dummyimage.com/60x40/000/fff', full: 'https://dummyimage.com/1000x800/000/fff.png'},
{thumb: 'https://dummyimage.com/60x40/5ff011/0011ff', full: 'https://dummyimage.com/1000x800/5ff011/0011ff'},
{thumb: 'https://dummyimage.com/60x40/0e0ef0/ff0000.png', full: 'https://dummyimage.com/1000x800/0e0ef0/ff0000.png'},
]
const App = () => (
<div>
<Gallery photos={imgUrl}/>
</div>
)
TODO
Unit tests
Gallery size customize
Extract to fine components
Support online video
License
MIT