React Wrapper for noUiSlider

3.4.2 · active · verified Sun Apr 19

nouislider-react is a React component wrapper for the popular noUiSlider library, providing a declarative way to integrate highly customizable range sliders into React applications. The package is currently at version 3.4.2 and aims to be a well-maintained alternative to other React wrappers for noUiSlider, explicitly stating its purpose to address maintenance issues found in similar packages. It maintains a regular, though not strictly scheduled, release cadence, primarily focusing on bug fixes, dependency updates, and minor feature enhancements. Key differentiators include direct exposure of all underlying noUiSlider options, support for additional React-specific properties like `clickablePips`, and comprehensive TypeScript type definitions, making it suitable for modern React and TypeScript projects. Developers should consult the original noUiSlider documentation for core slider configuration.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and render a basic range slider with two handles, showing connection and tooltips, and logging updates to the console.

import React from 'react';
import Nouislider from 'nouislider-react';
import 'nouislider/distribute/nouislider.css';

const MySlider = () => (
  <div style={{ padding: '30px' }}>
    <Nouislider
      range={{ min: 0, max: 100 }}
      start={[20, 80]}
      connect
      tooltips
      onUpdate={(values, handle, unencoded, tap, positions) => {
        console.log(`Slider values: ${values}`);
      }}
    />
  </div>
);

export default MySlider;

view raw JSON →