Skip to content
Knsept
Free playbook

Range slider with value bubble

A styled native range input with a filled track and a bubble that follows the thumb. Same look in every browser.

CSSJavaScriptUI Widgets Updated Oct 23, 2026
Live demo Reduced motion is on, so effects are toned down
<label class="range-field">
  <span class="range-title">Monthly budget</span>
  <span class="range-wrap">
    <output class="range-bubble" for="budget">$400</output>
    <input id="budget" class="range" type="range" min="0" max="1000" step="50" value="400">
  </span>
  <span class="range-scale"><span>$0</span><span>$1,000</span></span>
</label>

It's still a native <input type="range">, so dragging, touch, arrow keys, Page Up/Down and Home/End all work. appearance: none strips the browser's own styling, and the thumb is restyled with the ::-webkit-slider-thumb and ::-moz-range-thumb pseudo-elements.

The filled part of the track is a hard-stop gradient at --fill. The bubble is the slightly tricky bit: the thumb's center doesn't travel the full width (it stops half a thumb from each end), so the bubble's position adds a correction of 12px − ratio × 24px to stay centered on it.

aria-valuetext makes screen readers say "$400" instead of a bare "400", and the <output> element is tied to the input with for.

More from the library

Forms & inputs live

One-time code input

Six boxes for a verification code. Auto-advance, backspace, arrow keys, paste, and SMS autofill all work.

Forms & inputs live

Password strength meter

A live strength bar with a checklist of rules, plus a show/hide toggle. No library, no dark patterns.

Forms & inputs live

Toggle switch

An accessible on/off switch built on a real checkbox with role="switch". Keyboard, touch and screen readers work out of the box.