Slider

A draggable input for selecting a numeric value within a defined range. Supports stepped increments, keyboard navigation, and a range mode for selecting a lower and upper bound simultaneously.

By default, slider rounds output values to integers.

Source
Value: 40

Props

NameDefaultType
min0number
Minimum output value
max100number
Maximum output value
stepsnumber
Number of equal divisions between min and max
rangefalseboolean
Enables range mode with a start and end handle
roundtrueboolean | number
Round output values. true rounds to an integer, a number specifies decimal places, false disables rounding

Models

NameTypeDescription
modelValuenumberCurrent value in single mode (v-model)
startnumberLower bound of the range in range mode (v-model:start)
endnumberUpper bound of the range in range mode (v-model:end)

Examples

Range mode with 10 steps. Both handles snap to step boundaries and cannot cross each other.

20 – 80

Tokens

CSS variable tokens used for global or per-instance manipulation of certain styling.

TokenDefaultDescription
--vui-slider-height4pxTrack height
--vui-slider-backgroundvar(--color-border)Track background color
--vui-slider-indicatorvar(--color-accent)Fill indicator color
--vui-slider-handle-size20pxHandle diameter
--vui-slider-handle-roundingvar(--border-radius-pill)Handle border radius
--vui-slider-handle-colorvar(--color-border-strong)Handle border color
--vui-slider-step-indicator-width2pxStep tick width
--vui-slider-step-indicator-height4pxStep tick height