Rangle Slider
Range Slider
Canvas bundles Ion.RangeSlider to create sleek single value and dual handle range inputs, ideal for price filters, numeric ranges, and stepped selectors. It attaches to a plain <input> and renders a fully styled, draggable slider.
Setup
Include the bundled stylesheet in the <head> and the plugin script before </body>, then call ionRangeSlider() on your input.
<!-- In <head> -->
<link rel="stylesheet" href="css/components/ion.rangeslider.css">
<!-- Markup -->
<label>Price</label>
<input class="range_01">
<!-- Before </body> -->
<script src="js/components/rangeslider.min.js"></script>jQuery(".range_01").ionRangeSlider();Structure
The control needs nothing more than an empty <input> with a class you can target. All behavior is set through the init options. Use type: "double" for a two handle range with from and to values.
<input class="range_02">
<input class="range_03">// Single handle with min/max/start
jQuery(".range_02").ionRangeSlider({
min: 100,
max: 1000,
from: 400
});
// Double handle with a currency prefix
jQuery(".range_03").ionRangeSlider({
type: "double",
prefix: "$",
min: 0,
max: 1000,
from: 200,
to: 800
});
// Grid, step, and negative range
jQuery(".range_05").ionRangeSlider({
type: "double",
grid: true,
min: -1000,
max: 1000,
from: -500,
to: 500,
step: 250
});
// Custom string values
jQuery(".range_09").ionRangeSlider({
grid: true,
from: 3,
values: [
"January", "February", "March",
"April", "May", "June",
"July", "August", "September",
"October", "November", "December"
]
});Options
type:"single"(one handle, default) or"double"(range withfromandto).min/max: the numeric bounds of the slider.from/to: starting positions of the handles.step: increment between values, for example250or0.1.values: an array of custom labels, used instead ofmin/max.from/tobecome array indexes.grid:trueto draw a tick scale below the track.prefix/postfix: text prepended or appended to displayed values, for example"$".
Tips
- When you supply a
valuesarray, drive the handles withfrom/toas index positions, not raw numbers. - Fractional ranges work by pairing a decimal
step(like0.1) with decimalmin/max.
Was this page helpful?
