range-slider.mdx 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. title: Range slider
  3. libs: nouislider
  4. description: Adjust values with range sliders.
  5. summary: Range sliders allow users to select a range of values by adjusting two handles along a track, providing an intuitive and space-efficient input method.
  6. ---
  7. To be able to use the range slider in your application you will need to install the nouislider dependency with `npm install nouislider`.
  8. All options and features can be found [**here**](https://refreshless.com/nouislider/).
  9. ## Basic range slider
  10. ```html example centered vendors libs="nouislider" columns={1}
  11. <div id="range-simple"></div>
  12. <script>
  13. document.addEventListener("DOMContentLoaded", function () {
  14. window.noUiSlider &&
  15. noUiSlider.create(document.getElementById("range-simple"), {
  16. start: 20,
  17. connect: [true, false],
  18. step: 10,
  19. range: {
  20. min: 0,
  21. max: 100,
  22. },
  23. });
  24. });
  25. </script>
  26. ```
  27. That's only the basic features and options of range slider. More possibilities can be found [**here**](https://refreshless.com/nouislider/).