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.
npm install nouislider-reactVerified import paths — ran on the pinned version, not inferred.
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.
Replace `ref={myRef}` with `instanceRef={instance => { if (instance) myRef.current = instance; }}`. The `instance` property of the `noUiSlider` object will then contain methods like `set` or `get`.Ensure `import 'nouislider/distribute/nouislider.css';` is present in your entry file or a component where the slider is used.
Always consult the official noUiSlider documentation (refreshless.com/nouislider) before filing issues related to slider behavior or options.
Upgrade to `nouislider-react@3.4.2` or higher. Review component lifecycle to ensure the slider isn't being mounted/unmounted or re-initialized unnecessarily.
Avoid using version 3.3.4. If you are on this version, upgrade to 3.3.5 or later to benefit from the corrected `format` handling and other fixes.
Use the `instanceRef` prop introduced in v3.3.0 to get the direct `noUiSlider` instance. For example, `instanceRef={instance => { this.sliderInstance = instance; }}` and then `this.sliderInstance.noUiSlider.set(...)`.Add `import 'nouislider/distribute/nouislider.css';` to your application's entry point or the component where the slider is used. Ensure the `nouislider` package is correctly installed.
Update `nouislider-react` to the latest version. For `format` issues, ensure you are on version 3.3.5 or later. For event handlers, check the types provided by the latest package version.
Upgrade `nouislider-react` to version 3.4.0 (or newer) to benefit from fixes to event handler registration. For issues with initial setup, ensure `nouislider-react@3.4.2` or later is used.