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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-bootstrap-slider-updated

v3.0.2

Published

Bootstrap Slider component for React

Readme

DEPRECATED ⛔️

I no longer have the time to maintain this project. If anybody else wants to take on ownership and maintenance then I'd be happy to hand it over, although I've no idea how one actually does that!

React Bootstrap Slider

This project was bootstrapped with Create React App. It was then ejected due to jQuery issue (see below).

Overview

A ReactJS wrapper for seiyria's Bootstrap Slider component using Bootstrap. From version 3.0.0, we are supporting Bootstrap 4 only. Please use version 2.2.3 if you are still using Bootstrap 3.

How to install

Install from npm with:

npm install --save react-bootstrap-slider

or

yarn add react-bootstrap-slider

Import like so for ES6:

import ReactBootstrapSlider from 'react-bootstrap-slider';

The control is implemented in UMD format, so should also work for AMD/RequireJS, but I've not tested that.

Peer Dependencies

React, React Dom and Bootstrap are listed as peer dependencies (peerDependencies section in package.json) for react-bootstrap-slider. They will not be installed automatically when you install this component into your own project. You will need to install them yourself, as part of that project, if you have not done so already. This command will install them for you if you don't yet have them:

npm install react react-dom prop-types bootstrap@^4 --save

or

yarn add react react-dom prop-types bootstrap@^4

jQuery

The bootstrap-slider component - and, therefore, react-bootstrap-slider - will work with jQuery if it detects it in your project setup, but it is not a requirement. It works fine without jQuery. However, if you are using Webpack or Browserify to build your project, you may get a "missing dependency" build error if jQuery is not present. This is a known, upstream issue in bootstrap-slider. Please see How do I exclude the optional JQuery dependency from my build? on the Bootstrap Slider's Readme for how you can workaround this issue. You can also see how I did it by inspecting the /examples/config/webpack.config.js file and searching for "jQuery".

You must also ensure that you have included bootstrap-slider's CSS file in your build, otherwise the control will be blank! You'll also need Bootstrap's own CSS file too, of course. If you're using Webpack, which you will be if you have a Create React App based project, then you can import the CSS file directly into your build, like so:

import "bootstrap/dist/css/bootstrap.css";
import "bootstrap-slider/dist/css/bootstrap-slider.css"

Those two imports need to be in your top-level JavaScript file, e.g. App.js.

Or you can simply add the files as links in your HTML file as a link e.g.:

<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" />
    <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/11.0.2/bootstrap-slider.min.js"></script>

checking that the versions match those of Bootstrap and Bootsrap Slider themselves.

How to use react-bootstrap-slider

Here's an example of how you might call it in your ReactJS's render method:

<ReactBootstrapSlider
    value={this.state.currentValue}
    change={this.changeValue}
    slideStop={this.changeValue}
    step={this.state.step}
    max={this.state.max}
    min={this.state.min}
    orientation="vertical"
    reversed={true}
    disabled="disabled" />

The value, step, max and min parameters should be self-explanatory. The change event is the callback method that will be called when the slider actually changes. (NB: this is the change event for the Bootstrap slider.) As of version 1.1.2, there is a new slideStop event, which only triggers when you've finished moving the slider (i.e. you release it). This makes slideStop a deal less "chatty" than the change event. Decide which one you need; you'll only ever need one or the other (unlike my example code above!).

If the optional parameter disabled is included, and is set to "disabled", then the slider will display in a disabled state. If the parameter is not included, or is set to anything else except "disabled", then the slider control will be enabled.

The default orientation value is 'horizontal', so you only need to include that prop if you want to set it to 'vertical'.

If value is a two member array, then the slider will have two handles: minimum and maximum. You should also pass win a range parameter set to true in this case.

As of version 1.0.5, other values passed into the component will also passed into the underlying bootstrap-slider component via the Object Spread Operator that's been proposed for ES2017 (yes, that's how cutting edge I am!!). See seyria's documentation for a full list of these. Those parameters have not all been tested yet but the reversed parameter definitely works, and I have included this in the demo of the vertical slider.

Version 1.0.6 fixed an issue that prevented ticks props from being rendered. Pass in ticks props like so:

ticks = {[0, 100, 200, 300, 400]}
ticks_labels = {["$0", "$100", "$200", "$300", "$400"]}
ticks_snap_bounds = { 30 }