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-rwd-slideshow

v1.0.16

Published

React RWD Slideshow, no dependencies

Downloads

38

Readme

React RWD Slideshow

A simple Slideshow, very customizable, works with arrows for changing slides and also with touch, so is ready for desktop, tablet and mobile. No dependencies!!

Features

  • Custom Controls
  • Toggle Dots
  • Toggle Arrows
  • Any react component can be used as an Slide
  • Custom classNames (tailwindCSS can be used)
  • Gap support for spacing between slides
  • SSR

Install


$ npm install react-rwd-slideshow --save

Use it

Import the Slideshow component from react-rwd-slideshow and put your component/image/html/etc inside Slideshow.Item

import React from 'react';
import Slideshow from 'react-rwd-slideshow';

const Gallery = () => {
  const randomImageUrl = 'https://picsum.photos/800/600?random=';
  const imgStyle = {
    height: '300px',
    width: '100%',
    borderRadius: '8px',
  };
  const wrapperStyle = {
    width: '425px',
    margin: '25px auto 50px',
  };
  return (
    <div style={wrapperStyle}>
      <Slideshow gap={100} scrollSnap showDots>
        <Slideshow.Item>
          <img width='100%' src='https://picsum.photos/800/600?random=1' />
        </Slideshow.Item>

        {[...Array(5)].map((_, index) => (
          <Slideshow.Item key={index}>
            <img src={`${randomImageUrl}${index}`} style={imgStyle} />
          </Slideshow.Item>
        ))}
      </Slideshow>
    </div>
  );
};

Props

| Prop | Type | Default | Description | | ----------------------- | -------- | ----------------------- | ------------------------------------------------------ | | gap | Number | 0 | Space (grid-gap) for each slide in the slideshow in px | | scrollSnap | Boolean | true | true for applying scroll-snap to slides | | hideArrow | Boolean | false | Show/hide the arrow prev/next arrows | | showDots | Boolean | false | Show dots indicate the current slide | | dotColorActive | String | rgb(255 255 255 / 100%) | Valid css color value for active dot | | dotColorInactive | String | rgb(255 255 255 / 44%) | Valid css color value for inactive dot | | arrowLeft | Element | | Custom left arrow | | arrowRight | Element | | Custom right arrow | | dot | Element | | Custom dot component with prop isActive | | customContainerStyle | Object | | Style object for slideshow container | | slideViewerClassName | String | | Classname for the slide viewer | | slideTrayClassName | String | | Classname for the slide tray | | slideWrapperClassName | String | | Classname for the slide wrapper | | slideClassName | String | | Classname for the slide | | arrowContainerClassName | String | | Classname for the arrow container | | arrowWrapperClassName | String | | Classname for the arrow wrapper | | arrowClassName | String | | Classname for the arrow | | dotWrapperClassName | String | | Classname for the dot wrapper | | dotClassName | String | | Classname for the dot selector | | onCurrentSlideChanged | Function | | Function to get the current Slide |

Custom dot

const customDot = ({ isActive }) => (
  <div
    style={{
      height: isActive ? '10px' : '5px',
      width: isActive ? '10px' : '5px',
      background: '#000'
    }}
  />
)

<Slideshow dot={customDot} />