Skip to content
Ringobook v3.27.0

Range Slider

A range slider styles native <input type="range"> controls with optional tooltips, step markers, and vertical layout.

Wrap the control in .ro-range-slider and .ro-range. Set CSS variables --ro-range-min, --ro-range-max, and --start-value on the root.

<div class="ro-range-slider" style="--ro-range-min: 0; --ro-range-max: 100; --start-value: 40;">
<div class="ro-range">
<div class="ro-range-track">
<input type="range" min="0" max="100" value="40" aria-label="Volume" />
</div>
</div>
<output class="ro-range-output">40</output>
</div>
Preview
40

Use .ro-size-sm or .ro-size-lg on .ro-range-slider.

<div class="ro-range-slider ro-size-sm" style="--ro-range-min: 0; --ro-range-max: 100; --start-value: 25;"></div>
<div class="ro-range-slider ro-size-lg" style="--ro-range-min: 0; --ro-range-max: 100; --start-value: 75;"></div>

Add .ro-dir-vertical for a vertical slider.

<div class="ro-range-slider ro-dir-vertical" style="--ro-range-min: 0; --ro-range-max: 100; --start-value: 60;"></div>

Add .ro-is-disabled on .ro-range-slider and disable the input.

VariableDescription
--ro-range-minMinimum value of the range.
--ro-range-maxMaximum value of the range.
--start-valueCurrent value for single-thumb sliders.
--end-valueSecond thumb value for dual-range (.ro-is-range).
--valuePer-thumb position for tooltips.
--contentTooltip label text.
ClassDescription
.ro-size-sm, .ro-size-lgSmaller or larger track and thumb.
.ro-dir-verticalVertical orientation.
.ro-color-scheme-greyGrey output background.
.ro-is-disabledDisabled appearance.
.ro-is-rangeDual-thumb range layout.
.ro-range-outputValue display beside the track.
.ro-range-tooltipPer-thumb tooltip (--value, --content on the element).
.ro-range-stepStep marker on the track (--value; .ro-is-min / .ro-is-max for edges).
.ro-range-media, .ro-range-iconMin/max icon slots.
.ro-is-min, .ro-is-maxEdge modifiers on output, tooltip, or step markers in dual range.

JavaScript is required to sync --start-value, --end-value, and output elements when the user drags the thumb.

Changelog

Recent updates in @ringover/styles. See the full package changelog .

@ringover/styles@3.19.0
  • New range slider component based on native `<input type="range">`.