Install
Install via npm
The <input type="range">
HTML element can be used to create basic sliders, but it is difficult to style across browsers. The <range-slider>
custom element helps achieve accessible sliders that can be styled as needed.
Install via npm
Import as ES module
Or via CDN
Make sure to load the base styles exported via range-slider-element/style.css
.
Or via CDN
min
The minimum permitted value. The default is 0
.
max
The maximum permitted value. The default is 100
.
step
The stepping interval. The default is 1
.
value
The value. The default is 50
(min + (max - min) / 2
).
dir
Directionality. The default is ltr. Allowed options rtl
.
orientation
The default is horizontal. Allowed options vertical
.
Exposed CSS custom properties scoped within the range-slider
element.
--track-size
- The track size. The default is
0.2rem
. Can be overwritten for customization.
--thumb-size
- The thumb size, The default is 1.2rem
.
Can be overwritten for customization.
input
- Pointer move, value changed. Bubbles.change
- Pointer up, key up, value changed. Bubbles.This project uses SemVer for release versioning and maximum backward compatibility. Full changelog.
For more examples checkout the CodePen <range-slider> collection.