Skip to content

Range Slider with Value

Dark Bootstrap 6 photo adjustment panel with Range sliders, live output values, a value bubble, tick marks, step buttons and a filtered live preview.

Also known as: slider with live value, slider with value bubble, photo editor sliders, slider with ticks, image adjustment sliders

Bootstrap 6 Range Sliders Responsive Dark #dark #form #input #range #slider

Range Slider with Value live demo

Open in new tab

Bootstrap 6 code (HTML, CSS, JS)

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, step and value on each .form-range-input: set the scale. The soften slider shows decimal steps with step="0.5".
  • data-rsv-unit, data-rsv-scale and data-rsv-decimals on .rsv-item: control the displayed text, for example ° or dB instead of %.
  • data-rsv-default on each input: the neutral value used by "Reset all" and the adjustment counter.
  • Swap theme-warning and the other theme classes on .form-range to recolor a track and thumb.
  • Add or remove data-bs-bubble on a .form-range to show the floating bubble above its thumb.
  • Edit the <option> labels in #rsv-saturation-ticks to rename or add tick marks.
  • --rsv-panel, --rsv-card and --rsv-line on .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.

Range Slider with Value at a glance

Framework
Bootstrap 6
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 6, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Range Sliders
License
Free for personal and commercial use

Questions about this template

Can I use the Range Slider with Value code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 6 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
  • <script type="module" src="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

Built for Bootstrap 6.0.0-alpha.1. Bootstrap 6 ships as an ES module, so its script and this component's JavaScript load with type="module". Alpha releases can still change before the stable version.

Range Slider with Value – free Bootstrap 6 range slider template
Range Slider with Value · free Bootstrap 6 range slider template

More Range Sliders

Custom Range Slider – free Pure CSS range slider template

Custom Range Slider

Styled range input with a gradient fill, ring thumb and a live value bubble that follows the handle, in pure CSS and a few lines of vanilla JS.

Dual Range Price Slider – free Tailwind CSS range slider template

Dual Range Price Slider

Tailwind CSS min/max price slider with two handles, synced number inputs and a live histogram that counts products in the selected range.