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

react-mini-slider

v1.0.6

Published

A minimal React slider

Readme

react-mini-slider

Install

Yarn

yarn add react-mini-slider

npm

npm install react-mini-slider

Simple Example

import React from "react";
import "./App.css";
import { Slider } from "react-mini-slider";

function App() {
  return (
    <div className="App">
      <Slider className="slider-container" toolbarPosition="bottom-left">
        <SlideA />
        <SlideB />
        <SlideC />
        <SlideD />
      </Slider>
    </div>
  );
}

function SlideA() {
  return <h1>I am Slide A</h1>;
}
function SlideB() {
  return <h1>I am Slide B</h1>;
}
function SlideC() {
  return <h1>I am Slide C</h1>;
}
function SlideD() {
  return <h1>I am Slide D</h1>;
}
export default App;

Custom toolbar example

If you need a custom toolbar which in most cases you do (mine is really ugly, sorry) then you can build your toolbar component and pass it to the Slider. Here is an example:

import React from "react";
import "./App.css";
import { Slider, useSlider } from "react-mini-slider";

function App() {
  return (
    <div className="App">
      <Slider
        className="slider-container"
        toolbarPosition={{ top: 0, right: "30px" }}
        toolbar={<FancyToolbar />}
      >
        <SlideA />
        <SlideB />
        <SlideC />
        <SlideD />
      </Slider>
    </div>
  );
}

function SlideA() {
  return (
    <img
      src="https://images.unsplash.com/photo-1553284965-83fd3e82fa5a?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1951&q=80"
      alt="horse-1"
    />
  );
}
function SlideB() {
  return (
    <img
      src="https://images.unsplash.com/photo-1504310977373-186d29f99322?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80"
      alt="horse-2"
    />
  );
}
function SlideC() {
  return (
    <img
      src="https://images.unsplash.com/photo-1553284966-19b8815c7817?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80"
      alt="horse-3"
    />
  );
}
function SlideD() {
  return (
    <img
      src="https://images.unsplash.com/photo-1566251037378-5e04e3bec343?ixid=MXwxMjA3fDB8MHxzZWFyY2h8Nnx8aG9yc2V8ZW58MHx8MHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60"
      alt="horse-4"
    />
  );
}

function FancyToolbar() {
  const {
    handleNext,
    handleGoToFirst,
    handleGoToLast,
    handlePrevious,
    isFirst,
    isLast,
  } = useSlider();
  return (
    <>
      <button onClick={handleNext} disabled={isLast} className={`fancy-button`}>
        Next
      </button>
      <button
        onClick={handlePrevious}
        disabled={isFirst}
        className="fancy-button"
      >
        Previous
      </button>
      <button
        onClick={handleGoToFirst}
        disabled={isFirst}
        className="fancy-button"
      >
        Go To First
      </button>
      <button
        onClick={handleGoToLast}
        disabled={isLast}
        className="fancy-button"
      >
        Go To Last
      </button>
    </>
  );
}
export default App;