range-slider.mdx 1.0 KB

12345678910111213141516171819202122232425262728293031
  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 && (noUiSlider.create(document.getElementById('range-simple'), {
  15. start: 20,
  16. connect: [true, false],
  17. step: 10,
  18. range: {
  19. min: 0,
  20. max: 100
  21. }
  22. }));
  23. });
  24. </script>
  25. ```
  26. That's only the basic features and options of range slider. More possibilities can be found [**here**](https://refreshless.com/nouislider/).