Range Slider
Single and dual-thumb sliders with ticks and step snapping.
unreleased@magic-spells/range-slider
Not on the registry yet — clone or read it on GitHub.
Usage
<!-- single slider --> <range-slider name="rating" min="0" max="10" value="5" ticks show-labels></range-slider> <!-- dual-thumb range (declared by value-min / value-max) --> <range-slider min="0" max="500" step="10" value-min="50" value-max="250"> <input type="number" data-content-value-min name="price_min" aria-label="Minimum price" /> <input type="number" data-content-value-max name="price_max" aria-label="Maximum price" /> <span data-content-value></span> <!-- shows "50 – 250", live --> </range-slider>
About
Touch-friendly range slider web component. Supports a single-value slider and a dual-thumb min/max range, tick marks with optional labels, step snapping, auto-updating labels, two-way-bound number inputs, and CSS-variable theming. Built for mobile first — thumbs have a 44px invisible hit area, and vertical swipes on the track still scroll the page.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
| min / max | number | 0 / 100 | Slider bounds |
| step | number or "any" | 1 | Values quantize to step while dragging (detent feel); "any" = continuous |
| value | number | min | Single-mode value |
| value-min / value-max | number | min / max | Range-mode values — the presence of either switches to dual-thumb mode |
| ticks | boolean | — | Render tick marks |
| tick-step | number | step | Tick spacing in value units; also the PageUp/PageDown increment |
| show-labels | boolean | — | Plain-number label under each tick |
| name | string | — | Generates hidden form input(s); range mode derives {name}-min / {name}-max |
| disabled | boolean | — | Blocks pointer + keyboard interaction |
| label / label-min / label-max | string | "Value" / "Minimum value" / "Maximum value" | Thumb aria-labels |
About, features, usage and options are taken from the package README.