A dark photo adjustment panel built on the Bootstrap 6 Range component. Each slider shows its live value in an <output>, has minus and plus step buttons, and changes a preview image as it moves. One slider has a floating value bubble and two have labelled tick marks. Use it for image editors, audio mixers or settings pages.
How it works
The root .rsv-root holds a .rsv-preview figure with an inline SVG scene and a .rsv-controls form. Each control is an .rsv-item containing a label, an output.rsv-value, two .rsv-step buttons and a Bootstrap 6 .form-range wrapper around input.form-range-input. Each wrapper has its own theme-* class, so the colors differ.
Bootstrap fills the track by updating --bs-range-fill. The script builds one formatter per item from data-rsv-unit, data-rsv-scale, data-rsv-decimals and data-rsv-signed, so 25 on the exposure input becomes +0.25 EV. Because a Range formatter only applies when passed in JavaScript, the script disposes the auto-created instance and calls new Range(wrapper, { bubble, formatter }). The bubble and the <output> then always show the same text.
On every input event, render() writes the formatted values, sets aria-valuetext, disables a step button at the min or max, and counts how many sliders differ from data-rsv-default. It also sets --rsv-brightness, --rsv-contrast, --rsv-saturate and --rsv-blur on .rsv-scene, whose CSS filter uses them. The step buttons call stepUp() / stepDown() and then range.update(), which you must call after any programmatic value change. Tick marks come from <datalist> elements linked with the list attribute. The "Reset all" button returns every slider to its neutral default.
Customization
min,max,stepandvalueon each.form-range-input: set the scale. The soften slider shows decimal steps withstep="0.5".data-rsv-unit,data-rsv-scaleanddata-rsv-decimalson.rsv-item: control the displayed text, for example°ordBinstead of%.data-rsv-defaulton each input: the neutral value used by "Reset all" and the adjustment counter.- Swap
theme-warningand the other theme classes on.form-rangeto recolor a track and thumb. - Add or remove
data-bs-bubbleon a.form-rangeto show the floating bubble above its thumb. - Edit the
<option>labels in#rsv-saturation-ticksto rename or add tick marks. --rsv-panel,--rsv-cardand--rsv-lineon.rsv-root: change the dark surfaces.
Use cases
- Photo editing tools: sliders for brightness and contrast update a filtered live preview
- Settings panels: live output values and a value bubble show the exact number
- Precision controls: step buttons nudge a value up or down when dragging is too coarse
- Design tool prototypes: tick marks make the slider scale readable
Accessibility
Every slider is a native range input with a visible <label>. Arrow keys, Page Up/Down and Home/End work, and aria-valuetext reads the formatted value, such as "+0.30 EV". <output for> ties each value to its input. The step buttons have descriptive aria-labels and are disabled at the limits. The preview SVG has a <title>, and its filter transition is turned off under prefers-reduced-motion.
Bootstrap 6 notes
In Bootstrap 5, .form-range sat directly on the input and could not show a fill. In Bootstrap 6 it is a wrapper <div class="form-range"> around .form-range-input, with a JS-driven fill, data-bs-bubble and datalist ticks. Colors come from theme-* roles, and buttons use btn-subtle theme-secondary btn-icon. Built on 6.0.0-alpha.1, so the API can still change.