noUiSlider can be configured with a wide variety of options, which can be use to customize a slider's behaviour.
For options regarding the slider range, see slider values.
The start option sets the number of handles and corresponding start positions.
The start option uses the slider's 'format'
option to decode the input. Number input will be cast to string and decoded.
The connect option can be used to control the bar between the handles or the edges of the slider.
Pass an array
with a boolean
for every connecting element, including the edges of the slider. The length of this array must match the handle count + 1.
Setting true
sets the bars between the handles, but not between the handles and the sliders edges.
When using two handles, the minimum distance between the handles can be set using the margin option. The margin value is relative to the value set in 'range'. This option is only available on linear sliders.
The limit option is the oposite of the margin option, limiting the maximum distance between two handles. As with the margin option, the limit option can only be used on linear sliders.
Padding limits how close to the slider edges handles can be.
By default, the slider slides fluently. In order to make the handles jump between intervals, you can use the step option.
The orientation setting can be used to set the slider to "vertical"
or "horizontal"
.
Set dimensions! Vertical sliders don't assume a default height
, so you'll need to set one. You can use any unit you want, including %
or px
.
By default the sliders are top-to-bottom and left-to-right, but you can change this using the direction option, which decides where the upper side of the slider is.
noUiSlider can provide a basic tooltip using the tooltips
option. This option can also accept formatting options to format the tooltips content. In that case, pass an array
with a formatter for each handle, true
to use the default or false
to display no tooltip.
Set the animate option to false
to prevent the slider from animating to a new value with when calling .set()
.
The animationDuration
option can be used to set the animation speed assumed by the slider library. In addition to this, you must manually alter the CSS (-webkit-)transition
property for the .noUi-state-tap .noUi-origin
selector.