JavaScript Range Slider

var slider = document.getElementById('slider');

noUiSlider.create(slider, {
	start: [20, 80],
	connect: true,
	range: {
		'min': 0,
		'max': 100
Download noUiSlider
noUiSlider Slider range and handles Reading & Setting values Options Tapping, dragging & fixed ranges Examples Events Scale/Pips More... Download noUiSlider

noUiSlider: lightweight JavaScript range slider

noUiSlider is a range slider without bloat. It offers a ton off features, and it is as small, lightweight and minimal as possible, which is great for mobile use on the many supported devices, including iPhone, iPad, Android devices & Windows (Phone) 8 desktops, tablets and all-in-ones. It works on desktops too, of course!

var slider = document.getElementById('range');

noUiSlider.create(slider, {
	start: [ 20, 80 ], // Handle start position
	step: 10, // Slider moves in increments of '10'
	margin: 20, // Handles must be more than '20' apart
	connect: true, // Display a colored bar between the handles
	direction: 'rtl', // Put '0' at the bottom of the slider
	orientation: 'vertical', // Orient the slider vertically
	behaviour: 'tap-drag', // Move handle on tap, bar is draggable
	range: { // Slider can select '0' to '100'
		'min': 0,
		'max': 100
	pips: { // Show a scale with the slider
		mode: 'steps',
		density: 2
Connect the input to the slider
var valueInput = document.getElementById('value-input'),
	valueSpan = document.getElementById('value-span');

// When the slider value changes, update the input and span
slider.noUiSlider.on('update', function( values, handle ) {
	if ( handle ) {
		valueInput.value = values[handle];
	} else {
		valueSpan.innerHTML = values[handle];

// When the input changes, set the slider value
valueInput.addEventListener('change', function(){
	slider.noUiSlider.set([null, this.value]);
CSS in this example
#showcase {
	margin: 0 20px;
	text-align: center;
#range {
	height: 300px;
	margin: 0 auto 30px;
#value-input {
	width: 50%;
	float: left;
	display: block;
	text-align: center;
	margin: 0;

"Lightweight JavaScript range slider with full touch support."

  • Responsive design friendly
  • Touch support for iOS, Android & Windows (phone)
  • Dragable range
  • No jQuery, jQueryUI or other dependencies
  • Tested in IE9 - IE11, Chrome, Opera, Firefox & Safari

noUiSlider works with pretty much any device, mouse, touchscreen or both, and it'll work beautifully in responsive designs. Have you tried this documentation on your phone?


Getting started

noUiSlider 8 has no dependancies, so you don't need jQuery, jQuery UI, Zepto, etc. to use it.

Putting all your scripts in the page <head> will slow down your site. If you'd like to know why, consider reading this article by Yahoo!. Put the slider CSS in your <head>, and the script at the end of the <body>.

To create a slider, call noUiSlider.create() with an element and your options.

<!-- In <head> -->
<link href="nouislider.min.css" rel="stylesheet">

<!-- In <body> -->
<script src="nouislider.min.js"></script>

Browser support

noUiSlider supports IE9 and up, and the latest versions of the 'evergreen' browsers: Chrome, Safari, Firefox and Opera.