0.5.5 • Published 8 years ago
react-gallery-swiper v0.5.5
React Gallery Swiper
Responsive react component for creating image carousels.
Features
- Mobile friendly
- Navigation with thumbnails
- Custom render your slides
Getting started
npm install react-gallery-swiperExample
import GallerySwiper from 'react-gallery-swiper';
class App extends React.Component {
handleImageLoad = (event) => {
console.log('Image loaded ', event.target);
};
render = () => {
const images = [{
original: 'http://c7.staticflickr.com/4/3868/18982735806_b80b024040_h.jpg',
thumbnail: 'http://c7.staticflickr.com/4/3868/18982735806_cd60bcdb69_n.jpg',
originalClass: 'featured-slide',
thumbnailClass: 'featured-thumb',
originalAlt: 'I am a featured image',
thumbnailAlt: 'I am the thumbnail for the featured image',
}, {
original: 'http://c5.staticflickr.com/1/292/19003529492_214a7e3777_h.jpg',
thumbnail: 'http://c5.staticflickr.com/1/292/19003529492_226031f2c1_n.jpg'
}, {
original: 'http://c6.staticflickr.com/4/3802/19009038565_c197845618_h.jpg',
thumbnail: 'http://c6.staticflickr.com/4/3802/19009038565_17e2e21b22_n.jpg'
}];
return (
<GallerySwiper
ref={i => this._gallerySwiper = i}
images={images}
onImageLoad={this.handleImageLoad}
/>
);
};
}Props
images(required) Array of objects.showNav: Boolean, defaulttrue.lazyLoad: Boolean, defaultfalse.progressiveLazyLoad: Boolean, defaultfalse.lazyLoadAnimation: Boolean, defaultfalse.aspectRatio: String, defaultsquare. Accepts one ofsquare,3x4,4x6,5x7,8x10,4x3,6x4,7x5,10x8,infinite: Boolean, defaulttrue.showIndex: Boolean, defaultfalse.showBullets: Boolean, defaultfalse.showThumbnails: Boolean, defaulttrue.slideOnThumbnailsHover: Boolean, defaultfalse.disableThumbnailScroll: Boolean, defaultfalse.disableArrowKeys: Boolean, defaultfalse.disableSwipe: Boolean, defaultfalse.indexSeparator: String, default' : '.startIndex: Number, default0.thumbnailPosition: String, defaultX.thumbnailHoverSlideDelay: Number, default300.onSlide: Function,callback(currentIndex).onThumbnailHover: Function,callback(currentIndex, event).onThumbnailClick: Function,callback(currentIndex, event).onBulletClick: Function,callback(currentIndex, event).onArrowClick: Function,callback(type, currentIndex, event).onImageLoad: Function,callback(event).onThumbnailError: Function,callback(event).The below 2 features are not completly builtrenderItem: Function, custom item rendering.renderThumb: Function, custom item rendering of thumbnail.
#Functions
whereAmI(): returns the current index.
Mentions
Thanks to 'https://github.com/xiaolin', you were the inspiration behind this project.
Build the example locally
git clone https://github.com/sylvesteraswin/react-gallery-swiper
npm install
npm startThen open localhost:4000 in a browser.
License
MIT
Collaboration
Feel free to contribute and or provide feedback.
0.5.5
8 years ago
0.5.4
8 years ago
0.5.3
8 years ago
0.5.2
8 years ago
0.5.1
8 years ago
0.5.0
8 years ago
0.4.0
9 years ago
0.3.2
9 years ago
0.3.1
9 years ago
0.3.0
9 years ago
0.2.61
9 years ago
0.2.6
9 years ago
0.2.5
9 years ago
0.2.3
9 years ago
0.2.21
9 years ago
0.2.2
9 years ago
0.2.1
9 years ago
0.2.0
9 years ago
0.1.9
9 years ago
0.1.8
9 years ago
0.1.7
9 years ago
0.1.6
9 years ago
0.1.4
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
