<!--
  range-slider-element example
  
  https://github.com/andreruffert/range-slider-element
  by André Ruffert - @andreruffert
-->

<range-slider min="0" max="100" step="1" dir="rtl"></range-slider>
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  max-width: 500px;
  margin: 0 auto;
  padding: 1em;
}

output {
  font-weight: 600;
  text-align: center;
}
View Compiled
const elements = document.querySelectorAll(['range-slider']);

elements.forEach(element => {
  element.insertAdjacentHTML('afterend', `
    <output>${element.value}</output>
  `);
});

document.addEventListener('input', e => {
  const input = e.target;
  const output = input.nextElementSibling;
  if (output) {
    output.textContent = input.value;
  }
});

External CSS

  1. https://unpkg.com/range-slider-element@latest/dist/styles.css

External JavaScript

  1. https://unpkg.com/range-slider-element@latest