Documentation v8.0.25

Preview Purchase

Overview

noUiSlider is a lightweight range slider with multi-touch support and a ton of features. It supports non-linear ranges, requires no external dependencies, has keyboard support, and it works great in responsive designs. For full documentation please check the plugin's site.

Usage

noUiSlider's CSS and Javascript files are bundled in the global plugin bundles and globally included in all pages:
<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css"/>
<script src="assets/plugins/global/plugins.bundle.js"></script>

Initialization

  • noUiSlider's CSS is highly customized in sass/vendors/plugins/_nouislider.scssSCSS file in order to use it as native component within the design system. The SCSS code is compiled into assets/plugins/global/plugins.bundle.cssand globally included in all pages.
  • noUiSlider's Javascript is bundled in assets/plugins/global/plugins.bundle.jsand globally included in all pages.

Basic Example

Basic example of range slider with full touch support:
Min:
Max:
var slider = document.querySelector("#kt_slider_basic");
var valueMin = document.querySelector("#kt_slider_basic_min");
var valueMax = document.querySelector("#kt_slider_basic_max");

noUiSlider.create(slider, {
    start: [20, 80],
    connect: true,
    range: {
        "min": 0,
        "max": 100
    }
});

slider.noUiSlider.on("update", function (values, handle) {
    if (handle) {
        valueMax.innerHTML = values[handle];
    } else {
        valueMin.innerHTML = values[handle];
    }
});
<div class="mb-0">
    <label class="form-label">Example</label>
    <div id=""kt_slider_basic"></div>

    <div class="pt-5">
        <div class="fw-bold mb-2">Min: <span id=""kt_slider_basic_min"></span></div>
        <div class="fw-bold mb-2">Max: <span id=""kt_slider_basic_max"></span></div>
    </div>
</div>

Sizes

Change the sliders default size by applying custom size classes .noUi-smand .noUi-lg:
<div id="kt_slider_sizes_sm" class="noUi-sm"></div>

<div id="kt_slider_sizes_default"></div>

<div id="kt_slider_sizes_lg" class="noUi-lg"></div>

Vertical Example

Example of horizontal range slider
var slider = document.querySelector("#kt_slider_vertical");

noUiSlider.create(slider, {
    start: [60, 160],
    connect: true,
    orientation: "vertical",
    range: {
        "min": 0,
        "max": 200
    }
});
<div id="kt_slider_vertical"></div>

Tooltip

noUiSlider can provide a basic tooltip using the tooltips option:
var tooltipSlider = document.querySelector("#kt_slider_tooltip");

noUiSlider.create(tooltipSlider, {
    start: [20, 80, 120],
    tooltips: [false, wNumb({decimals: 1}), true],
    range: {
        "min": 0,
        "max": 200
    }
});
<div id="kt_slider_tooltip"></div>

Soft Limits

If you want to disable the edges of a slider, the set event can be used to reset the value if a limit is passed
var slider = document.querySelector("#kt_slider_soft_limits");

noUiSlider.create(slider, {
    start: 50,
    range: {
        min: 0,
        max: 100
    },
    pips: {
        mode: "values",
        values: [20, 80],
        density: 4
    }
});
<div id="kt_slider_soft_limits"></div>

Explore Metronic

Demo1

Demo2

Demo3

Demo4

Demo5

Demo6

Demo7

Demo8

Demo9

Demo10

demo
Coming soon

Demo11

Demo12

demo
Coming soon

Demo13

Demo14

demo
Coming soon

Demo15

demo
Coming soon

Demo16

demo
Coming soon

Demo17

demo
Coming soon

Demo18

demo
Coming soon

Demo19

demo
Coming soon

Demo20

demo
Coming soon