A set of vertical range sliders laid out as an eight-band audio equalizer, built with plain CSS and a small vanilla JavaScript helper. Each band is a native input type="range" styled as a mixing-console fader, with a live dB readout, a filled track from 0 dB to the value and a response curve above. Use it for audio players, sound settings, studio dashboards or any control panel that needs vertical sliders.
How it works
The root section.vrs-mixer contains a header with preset buttons, an SVG .vrs-curve and the .vrs-bands row. Every .vrs-band stacks an output.vrs-value, a .vrs-slot and a label.vrs-label. The slot is a fixed vertical box; the .vrs-input inside it is a normal horizontal range that is centered and turned with rotate(-90deg), so the minimum sits at the bottom. This trick works in every modern browser and keeps full control over the track and thumb styling through ::-webkit-slider-runnable-track, ::-moz-range-track and the thumb pseudo-elements.
The script listens for input events, then sets two custom properties on the slider, --vrs-lo and --vrs-hi, which paint the accent color between 0 dB and the current value. It also updates the readout, sets aria-valuetext (for example "+3 dB") and redraws the .vrs-curve-line polyline. Clicking a .vrs-preset button applies the comma-separated values from its data-values attribute, and the matching preset gets aria-pressed="true". A vrs:change event with all values is dispatched on change and after a preset is applied. Without JavaScript the sliders still work; only the fill, readouts and curve stay static.
Customization
--vrs-accenton.vrs-mixer: the color of the filled track, fader line, curve and focus ring.--vrs-height: the slider length (200 px on phones, 220 px from 640 px); the slot ticks adjust automatically.--vrs-slot-widthand--vrs-thumb-width: the width of each band and of the fader cap.min,maxandstepon each.vrs-input: the range, e.g.min="0" max="100"for a volume mixer; the fill then starts at the bottom.data-valueson a.vrs-preset: add or change presets with one value per band, such as"4,4,2,0,0,0,2,4".- Add or remove
.vrs-bandblocks to change the number of bands; the curve uses as many points as there are sliders.
Use cases
- Audio players: eight vertical bands let listeners shape bass and treble with live dB readouts
- Studio dashboards: fader-style caps and a response curve show the current sound profile
- Sound settings: preset buttons apply a full set of band values in one click
- Volume mixers: change min and max to build vertical volume or level controls
Accessibility
Every slider is a native range input with a label and aria-orientation="vertical", so arrow keys, Page Up/Down and Home/End work as usual and Arrow Up raises the gain. aria-valuetext gives screen readers the value with its unit. The output elements are linked to their slider with for. Presets are a role="group" of toggle buttons with aria-pressed. A focused thumb gets a double ring and its band label switches to the accent color. Thumb scale transitions are disabled with prefers-reduced-motion: reduce.
Usage notes
The ids vrs-band-1 to vrs-band-8 must be unique, so rename them when you place two mixers on one page. Listen for vrs:change on .vrs-mixer to send the values to your audio engine.