1. Components
  2. Input

Basic Forms

Tailwind CSS Advanced Range Slider

The Slider component, a type of range input, offers a consistent and customizable way for users to select values within a defined range. This intuitive component is ideal for adjusting settings such as volume, brightness, or for applying filters in various applications.

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.

How to use

  1. Install noUiSlider.

    Install nouislider via npm

    npm i nouislider
  2. Add the noUiSLider JavaScript

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

                        
                      

Basic usage

Create custom range slider.

Disabled

Set the disabled parameter to true on an element to give it a grayed out appearance, remove pointer events, and prevent focusing.

Steps

By default, range inputs “snap” to integer values. To change this, you can specify a step attribute with some integer value.

Tooltip

Set the tooltips parameter to true to enable displaying current values in the tooltip.

Range

Set the start parameter to an array of two values to enable range mode.

Range with Tooltip

Combining tooltip and range demo.

Pips

Set the pips parameter to object with settings to enable pips display.

Pips auto values

Drawing pips according to the number of steps.

Pass value to HTML element

Using the update method to pass a value as the text of an element.

Value: 750

Pass values to HTML elements (Range)

Using the update method to pass values as text to the min and max elements.

250
-
750

Formatting with thousands separators and decimal points

Using the update method to pass values as text to the min and max elements.

250
-
750

Pass value to input

Using the update method to pass a value as the value of input.

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

Pass values to inputs

Using the update method to pass values as inputs value.

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 Example

Using the update method and returned values to update foreground chart width.

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

Custom range:

Range with Charts Example (Modal) New

Using the update method and returned values to update foreground chart width.

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 New

Provides destroy method that helps to destroy a range slider.