Skip to content

Slider ​

Draggable slider with range, marks, tooltip, gradient fill, custom thumb, and more.

30
vue
<template>
  <VxSlider v-model="value" />
</template>

Range ​

20 – 70
vue
<template>
  <VxSlider v-model="value" range />
</template>

Step with Stops ​

50
vue
<template>
  <VxSlider :step="10" show-stops />
</template>

With Input ​

vue
<template>
  <VxSlider show-input />
</template>

Input with Prefix / Suffix ​

$
%
vue
<template>
  <VxSlider show-input prefix="$" />
  <VxSlider show-input suffix="%" />
</template>

Range with Input ​

–
vue
<template>
  <VxSlider range show-input />
</template>

Show Min / Max Labels ​

0
100
vue
<template>
  <VxSlider show-min-max />
</template>

Show Value Below Thumb ​

60%
vue
<template>
  <VxSlider show-value suffix="%" />
</template>

Tooltip Always + Format ​

60%
vue
<template>
  <VxSlider tooltip-always :format-tooltip="v => v + '%'" />
</template>

Custom Color ​

vue
<template>
  <VxSlider color="#22c55e" />
</template>

Custom Track Color ​

vue
<template>
  <VxSlider color="#3b82f6" track-color="#1e3a5f" />
</template>

Gradient Fill ​

vue
<template>
  <VxSlider :gradient="['#3b82f6', '#8b5cf6', '#ec4899']" />
</template>

Thumb Shapes ​

circle
square
diamond
vue
<template>
  <VxSlider thumb-shape="circle" />
  <VxSlider thumb-shape="square" />
  <VxSlider thumb-shape="diamond" />
</template>

Custom Thumb Slot ​

50
50
vue
<template>
  <VxSlider v-model="value">
    <template #thumb="{ value, dragging }">
      <div class="my-thumb">{{ value }}</div>
    </template>
  </VxSlider>
</template>

Marks ​

0°
1°
Cold
Warm
Hot
vue
<template>
  <VxSlider :marks="{ 0: '0°', 0.5: 'Warm', 1: '1°' }" />
</template>

Snap to Marks ​

Only allows values at mark positions.

0
100%
25%
50%
75%
0.5
vue
<template>
  <VxSlider snap-to-marks :marks="{ 0: '0%', 50: '50%', 100: '100%' }" />
</template>

Reversed ​

100
0
30
vue
<template>
  <VxSlider reversed />
</template>

Precision ​

vue
<template>
  <VxSlider :min="0" :max="1" :step="0.01" :precision="2" />
</template>

Sizes ​

sm
default
lg
vue
<template>
  <VxSlider size="sm" />
  <VxSlider />
  <VxSlider size="lg" />
</template>

Vertical ​

50
vue
<template>
  <VxSlider vertical height="200px" />
</template>

Readonly ​

65%
vue
<template>
  <VxSlider :model-value="65" readonly />
</template>

Disabled ​

vue
<template>
  <VxSlider disabled />
</template>

Props ​

PropTypeDefaultDescription
modelValuenumber | [number, number]0Value (v-model)
minnumber0Minimum
maxnumber100Maximum
stepnumber1Step
disabledbooleanfalseDisable
readonlybooleanfalseRead only
rangebooleanfalseRange mode
showTooltipbooleantrueShow tooltip
tooltipAlwaysbooleanfalseAlways show tooltip
showStopsbooleanfalseStep dots
showInputbooleanfalseNumber input
showValuebooleanfalseValue below thumb
showMinMaxbooleanfalseMin/max labels
size'sm' | 'default' | 'lg''default'Size
colorstring''Fill/thumb color
trackColorstring''Inactive track color
gradientstring[]—Gradient fill colors
formatTooltip(v: number) => string—Tooltip formatter
marksRecord<number, string>—Labeled marks
snapToMarksbooleanfalseOnly allow mark values
verticalbooleanfalseVertical mode
reversedbooleanfalseFlip direction
heightstring'200px'Vertical height
lazybooleanfalseEmit change on drop only
debouncenumber0Debounce updates (ms)
precisionnumber—Decimal places
thumbShape'circle' | 'square' | 'diamond''circle'Thumb shape
prefixstring''Input prefix text
suffixstring''Input suffix text
labelstring''Accessible label

Events ​

EventTypeDescription
update:modelValue(v)Value changed
change(newVal, oldVal)Value changed (with old value)

Slots ​

SlotPropsDescription
thumb{ value, dragging }Custom thumb content