Update v4.2 - New components, 10+ framework guides, and quality improvements. Visit Changelog

Tailwind CSS Range Slider Plugin

Build advanced Tailwind CSS range sliders with noUiSlider, including multi-handle ranges, tooltips, pips, formatted values, and JavaScript methods.

Requires Additional Installation

Note that this component requires the use of the third-party noUiSlider plugin.

Requires JS

Note that this component requires the use of our Advanced Range Slider plugin, else you can skip this message if you are already using Preline UI as a package.

Installation

  1. Install noUiSlider.

    Install nouislider via npm

    Terminal
                              
                                npm i nouislider
                              
                            
  2. Add the noUiSLider JavaScript

    Include the JavaScript <script> near the end of your </body> tag:

    HTML
                              
                            

Basic slider

Create a basic single-handle slider.

Gradient track

Use a gradient-filled lower track to emphasize the selected value.

Disabled slider

Set disabled to true to prevent interaction and show a non-editable slider state.

Stepped values

Use the step option to limit the slider to fixed value increments.

Tooltip values

Set tooltips to true to show the current handle value in a tooltip.

Range slider

Set start to an array of two values to create a two-handle range slider.

Range with tooltips

Combine range mode with tooltips to show both handle values while dragging.

Slider pips

Configure the pips option to display tick marks and labels along the slider.

Automatic pips

Generate pips automatically based on the configured step intervals.

Output to HTML element

Use the update event to write the current slider value into another HTML element.

Range output to HTML elements

Use the update event to write the min and max handle values into separate elements.

Formatted values

Format slider output with thousands separators and decimal precision before displaying it.

Output to input

Use the update event to sync the current slider value to an input field.

Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

Range output to inputs

Use the update event to keep two input fields in sync with the range handles.

Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

Range with charts

Use the update event values to drive a highlighted range on the foreground chart.

Requires Additional Installation

Note that this demo requires the use of the third-party Apexcharts plugin and Preline Charts helper.

Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

Range with charts in modal

Use the update event values to drive a highlighted chart range inside a modal.

Requires Additional Installation

Note that this demo requires the use of the third-party Apexcharts plugin and Preline Charts helper.

Certain JavaScript Helpers in Preline UI make use of Lodash plugin. Don't forget to install it, if you haven't done so already: npm i lodash

Destroy and reinitialize

Use the destroy method to remove a slider instance, then initialize it again when you need to restore the behavior.

© 2026 Preline Labs.