Skip to content

Slider

A more versatile and better looking alternative to a range input.

Default Component

html
<slider v-model="slider1" />

Result

10

Disabled Slider

html
<slider v-model="slider0" :disabled="true" />

Result

30

Component With Range Limits

html
<slider v-model="slider2" :min="-20" :max="20" />

Result

10

Slider With Two Or More Handles

When the bound modelValue is an array a handle will be added for each array item.

html
<slider v-model="slider3" :min="-50" :max="50" />

Result

[ 10, 20 ]

Result

[ -10, 0, 10 ]

A Vertical Slider (With Two Handles)

When the bound modelValue is an array a handle will be added for each array item.

html
<slider v-model="slider4" :min="-50" :max="50" :vertical="true"/>

Result

[ 10, 20 ]

Properties

NameTypeDefaultDescription
modelValueNumber, Number[]If an array of numbers is bound a handle is shown for each array entry
minNumberthe left (or bottom) boundary of the slider
maxNumberthe right (or top) boundary of the slider
disabledBooleandisables the slider
verticalBooleanrotates the slider by 90 degree counterclockwise (min value at bottom, max value at top)

Events

NameArgumentsDescription
update:modelValuevalue - can be a single number or an arrayEmitted when handles are moved by user interaction
dragStartEmitted when a handle is grabbed by mouse or touch
dragStopEmitted when a handle is released

Keys

KeyAction
tabEach handle can be focused
left, downDecreases bound value of selected handle by 1
right, upIncreases bound value of selected handle by 1
homeSets bound value of selected handle to min
endSets bound value of selected handle to max
pageDownDecreases bound value of selected handle by 1/10 of min-max range
pageUpIncreases bound value of selected handle by 1/10 of min-max range