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-gallery-swiper

v0.5.5

Published

React Image Carousel, React Image Gallery

Downloads

86

Readme

React Gallery Swiper

Responsive react component for creating image carousels.

Features

  • Mobile friendly
  • Navigation with thumbnails
  • Custom render your slides

React Gallery Swiper

Getting started

npm install react-gallery-swiper

Example

example/src/app.jsx

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, default true.
  • lazyLoad: Boolean, default false.
  • progressiveLazyLoad: Boolean, default false.
  • lazyLoadAnimation: Boolean, default false.
  • aspectRatio: String, default square. Accepts one of square, 3x4, 4x6, 5x7, 8x10, 4x3, 6x4, 7x5, 10x8,
  • infinite: Boolean, default true.
  • showIndex: Boolean, default false.
  • showBullets: Boolean, default false.
  • showThumbnails: Boolean, default true.
  • slideOnThumbnailsHover: Boolean, default false.
  • disableThumbnailScroll: Boolean, default false.
  • disableArrowKeys: Boolean, default false.
  • disableSwipe: Boolean, default false.
  • indexSeparator: String, default ' : '.
  • startIndex: Number, default 0.
  • thumbnailPosition: String, default X.
  • thumbnailHoverSlideDelay: Number, default 300.
  • 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 built
  • renderItem: 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 start

Then open localhost:4000 in a browser.

License

MIT

Collaboration

Feel free to contribute and or provide feedback.