Forms
ISlider
A control for a value where the approximate size matters more than the exact number — volume, opacity, a price ceiling. Where a precise figure is typed, use INumberInput.
The model keeps its shape
Pass a number and you get a number back; pass an array and you get an array.
const volume = ref(60) // → 60
const price = ref([200, 750]) // → [200, 750]Range
Two thumbs on one track. minStepsBetweenThumbs keeps them from crossing or stacking.
Formatting
formatValue drives the displayed value, the scale captions and each thumb's accessible label at once.
Steps
A coarse step turns the track into a small set of choices. Use formatValue to name them rather than showing the raw index.
Sizes
The track and thumb scale together, with the thumb staying larger than the track at every size.
Vertical
orientation="vertical" stands the track up. showScale is horizontal only.
Saving on release
update:modelValue fires on every step; valueCommit fires once, when the drag or key repeat ends. Send the committed value to the server.
Last saved: 50
Disabled
Accessibility
The name lands on the thumb, which is the element carrying role="slider". With a label, a single thumb takes the label and a range names each end after it — "Price minimum", "Price maximum". Rename those ends with rangeLabels:
<ISlider v-model="price" label="Preis" :range-labels="['von', 'bis']" />Without a label, each thumb falls back to its own formatted value. Arrow keys step by step, Home and End jump to min and max, and PageUp/PageDown move in larger jumps.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
modelValue | number | number[] | null | min | One thumb for a number, one per entry for an array |
min | number | 0 | |
max | number | 100 | |
step | number | 1 | |
minStepsBetweenThumbs | number | — | Keeps range thumbs from crossing |
orientation | 'horizontal' | 'vertical' | 'horizontal' | |
inverted | boolean | false | Fills from the far end |
disabled | boolean | false | |
size | 'sm' | 'md' | 'lg' | 'md' | |
label | string | — | Shown above the track and used as the accessible name |
showValue | boolean | false | Show the current value beside the label |
showScale | boolean | false | min/max captions under the track; horizontal only |
formatValue | (value: number) => string | String | Drives the value, the scale and the thumb labels |
rangeLabels | [string, string] | ['minimum', 'maximum'] | How each end of a range is named |
unstyled | boolean | — | Skip built-in classes |
ui | Record<string, string> | — | Per-slot class overrides |
Events
| Event | Payload | Description |
|---|---|---|
update:modelValue | number | number[] | Every step, as the value changes |
valueCommit | number | number[] | Once, when the interaction ends |
Slots
| Slot | Props | Description |
|---|---|---|
label | — | Replaces the label text |
value | { values, text } | Replaces the value readout |
Styling
Slots: root, header, label, value, slider, track, range, thumb, scale.