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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fil1pe/react-slider

v1.13.5

Published

A slider component for React

Readme

React Slider

npm version npm downloads license build status

This is a simple slider implementation in React. Make your own carousels of images, texts or whatever you need easily with this component and some stylesheet.

Installation

npm

$ npm install @fil1pe/react-slider

yarn

$ yarn add @fil1pe/react-slider

Usage

In your JSX file, import the slider component and the CSS file as in the example below. You are free to customize it using the prop className and the classes that follow.

Usage with Next.js

If you are using this package with Next.js, you need to add the following configuration to your next.config.js (or next.config.mjs) file to ensure the package is transpiled correctly:

module.exports = {
  transpilePackages: ['@fil1pe/react-slider'],
}

Classes

| Class name | Description | | :-: | :-: | | .main | div wrapping the track and arrows | | .arrow | prev/next button | | .disabled | if arrow is disabled | | .track | wraps the ul containing the slides | | .dots | ul with the dots | | .active | active slide/dot | | .pages | pagination info |

Component props

| Property | Default value | Required | Description | | :-: | :-: | :-: | :--: | | className | none | false | Class name of your slider component wrapper | | slidesToShow | 1 | false | Number of slides per page | | slidesToScroll | slidesToShow | false | Number of slides to scroll on click on prev/next | | finite | false | false | Defines whether the slider should have finite scrolling or not | | slidableWithMouse | false | false | Defines whether it can be slid with the mouse | | renderArrow | (props, type) => <button {...props}>{type === ArrowType.Next ? 'Next' : 'Previous'}</button> | false | Allows customizing the arrow buttons | | renderController | none | false | Function that renders additional controllers in the wrapper div .main (e.g. full-screen button). Receives the current slide index as argument | | autoplayTimeout | none (∞) | false | Autoplay interval in milliseconds | | slidesToAppend | none | false | Additional number of slides to append before and after | | adaptiveHeight | false | false | Variable height | | pagination | 0 | false | Shows current slide index alongside the total number of slides(1 for no spacing, 2 otherwise) | | onSlideChange(int) | none | false | Function triggered on slide change | | initialSlide | 0 | false | Number of the first slide to show |

Methods

Referencing the slider allows you to manually change the current slide through the methods below.

| Method | Arguments | Description | | :-: | :-: | :-: | | slickGoTo | slide index | Navigates to the specified slide | | slickNext | none | Goes to the next slide | | slickPrev | none | Goes to the previous slide |

Provider

The SliderProvider exported by this package is used to adjust the slides positioning during screen resizing, preventing visual bugs.

Example

import React from 'react'
import Slider from '@fil1pe/react-slider'
import '@fil1pe/react-slider/style.css'

function App() {
  return (
    <SliderProvider>
      <Slider slidesToShow={2} slidesToScroll={1} className="slider">
        <div class="slide">1</div>
        <div class="slide">2</div>
        <div class="slide">3</div>
        <div class="slide">4</div>
        <div class="slide">5</div>
      </Slider>
    </SliderProvider>
  )
}

export default App