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

infinite-react-carousel

v1.2.11

Published

Infinite carousel for react

Downloads

8,914

Readme

infinite-react-carousel

npm npm Bundle Size license Codecov CircleCI

Installation

npm

npm install infinite-react-carousel --save

yarn

yarn add infinite-react-carousel

Example

import React from 'react';
import Slider from 'infinite-react-carousel';

const SimpleSlider = () => (
  <Slider dots>
    <div>
      <h3>1</h3>
    </div>
    <div>
      <h3>2</h3>
    </div>
    <div>
      <h3>3</h3>
    </div>
    <div>
      <h3>4</h3>
    </div>
    <div>
      <h3>5</h3>
    </div>
  </Slider>
);

Props

| Prop | Description | Default | Type | |------|-------------|---------|------| | rows | Number of rows per slide in the slider, (enables grid mode) | 1 | Number | | slidesPerRow | Number of slides to display in grid mode, this is useful with rows option | 1 | Number | | slidesToShow | How many slides to show in one frame | 1 | Number | | className | | "" | String | | centerMode | Center current slide | false | Boolean | | swipe | Enable/disable swiping to change slides | true | Boolean | | adaptiveHeight | Adjust the slide's height automatically | false | Boolean | | centerPadding | | 50 | String, Number | | initialSlide | Index of first slide | false | Boolean, Number | | pauseOnHover | Prevents autoplay while hovering on track | true | Boolean | | autoplay | Enable/disable slider autoplay | false | Boolean | | autoplayScroll | How many slides to scroll when autoplay is true | 1 | Number | | autoplaySpeed | Delay between each auto scroll (in milliseconds) | 3000 | Number | | beforeChange | Before Index change callback. (oldIndex, newIndex) => ... | null | Function | | afterChange | Index change callback. index => ... | null | Function | | duration | Transition duration in milliseconds | 200 | Number | | shift | Set the spacing of the center item | 0 | Number | | arrows | Enable/disable arrow button | true | Boolean | | arrowsBlock | | true | Boolean | | arrowsScroll | How many slides to scroll when click arrows button | 1 | Number | | prevArrow | Custom prev arrows button | null | Element | | nextArrow | Custom next arrows button | null | Element | | dots | Enable/disable dots | false | Boolean | | dotsClass | CSS class for dots | "carousel-dots" | String | | dotsScroll | How many slides to scroll on one page | 1 | Number | | appendDots | Custom dots templates. Works same as customPaging | (dots) => <ul style={{ display: 'block' }}>{dots}</ul> | Function | | customPaging | Custom paging templates | (i) => <button type="button">{i + 1}</button> | Function | | onReszie | detect carousel resize | (e) => {} | Function | | onSwipe | Callback after slide changes by swiping | (direction) => {} | Function | | accessibility | Enable tabbing and arrow key navigation | true | Boolean | | wheel | Enable mouse wheel to slide item | false | Boolean | | wheelScroll | How many slides to scroll when wheel trigger | 1 | Number | | virtualList | | false | Boolean | | overScan | Number of items to render before/after the visible slice of the carousel | 2 | Number |

Methods

| Name | Description | |------|-------------| | slickNext | Go to the next slide | | slickPrev | Go to the previous slide | | slickGoTo | Go to any slide | | slickPause | Pause the autoplay | | slickPlay | Start the autoplay |

Development

Want to run demos locally

git clone https://github.com/g787543/infinite-react-carousel.git
cd infinite-react-carousel

npm

npm install
npm run dev

yarn

yarn
yarn dev

open http://localhost:8080

LICENSE

The project is licensed under the terms of MIT license