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-picture-show

v1.4.0

Published

Slideshow Component for React.js

Downloads

5

Readme

React Picture Show Build Status NPM version

A Bare bones slideshow component that handles transitions between slides and exposes control so that it is easy to decorate with other controls. Out of the box, it supports swiping to paginate, clicking left and right, and lasyloading slides

PictureShow Demo

installation

node

npm install react-picture-show

Usage

Basic

  
<PictureShow>
  <img src='http://...'/>
  <img src='http://...'/>
  <div>another thing</div>
  <img src='http://...'/>
  <img src='http://...'/>
</PictureShow>

Component Properties Overview

Properties | Type | Default | Description | Supported :--------- | :--- | :------ | :---------- | :-------- ratio | Array | Null | Shape of the slideshow, for example: [16,9] | yes animationSpeed | Number | 1500 | Speed of slide transitions in px/s | yes startingSlide | Number | 0 | Initial slide view | yes onClickSlide | Function | null | override click handler for slide | yes onBeforeTransition | Function | noop | Function called before transition starts | yes onAfterTransition | Function | noop | Function called after transition ends | no slideBuffer | Number | 1 | The number of slides loaded to the left and right of the slide in view | yes clickDivide | Number | 0.45 | The division between previous and next when clicking the slideshow | yes infinite | Boolean | true | Is the Slideshow continuous | no suppressPending | Boolean | true | Should slides outside the slideBuffer be suppressed | no

Public methods on mounted component

Method | Description | Supported :----- | :---------- | :-------- next | Go forward one slide | yes previous | Go backward one slide | yes goToSlide | Go to a specific slide index | yes disable | Deactivate slideshow | no enable | Acticate slideshow | no

How slides work

Slides are the direct child components of a <PictureShow/>. They are cloned with the following additional properties:

{
  slideRatio: Number, // the ratio of the outer slide (w/h)
  slidePending: Boolean // whether the slide can be lazyloaded
}

By cloning the children with these props, you are free to create 'slide' components that react to them however you want. If the child already has one of these props it will be replaced (even for <img/> components)

Note: If suppressPending property is true on <PictureShow/>, then the slide will not render, so you will not need to handle the pending prop at the slide level. suppressPending exists for edge cases where the user wants to define how 'not loading' works

Properties in Depth

ratio

Defines the shape of the slideshow as a fixed ratio so that it can flex inside its parent container.

animationSpeed

speed...

startingSlide

staring slide...

onClickSlide

function...

onBeforeTransition

function...

onAfterTransition

function...

slideBuffer

lazy loading...

clickDivide

next and prev...

infinite

more stuff...

suppressPending

control pending....

License

MIT