Slider

VdSlider styles a native <input type="range"> with a themed track, fill and thumb. It renders from pure CSS and binds with v-model (numbers) — with optional label and live value read-out.

Basic With Value
60
40
Custom Range & Step
250
2
Disabled
Decimal Steps

Current zoom: 2×

2
API Reference

Usage

<script setup lang="ts">
import { VdSlider } from "@vanduo-oss/vd3";
const volume = ref(60);
</script>

<template>
  <VdSlider v-model="volume" label="Volume" :min="0" :max="100" show-value />
</template>

CSS Classes

ClassDescription
.vd-sliderStyles a native <input type="range"> — track, fill and thumb
.vd-slider-fieldOptional wrapper grouping a label above the slider row
.vd-slider-rowFlex row that aligns the slider with its value read-out
.vd-slider-valueText element showing the current numeric value

Component API

Prop / eventDescription
v-model (modelValue)Two-way bound value (number).
:min / :maxRange bounds (defaults 0 / 100).
:stepIncrement between stops (default 1; accepts decimals).
:labelOptional label rendered above the slider.
:show-valueRenders the live numeric value beside the track.
:disabledGreys out and blocks interaction when true.
:name / :idForwarded to the underlying input for forms / labels.
@update:modelValueFired with the new number as the user drags.

Events

EventDescription
input Native event fired continuously as the thumb moves. In Vue, prefer @update:modelValue (via v-model), which emits a number.
Accessibility
  • Built on a native range input, so it's fully keyboard operable: ← / → step by step; Home / End jump to min / max.
  • The component mirrors min/max/value into aria-valuemin / aria-valuemax / aria-valuenow.
  • Pass a label (or wire id) so screen readers announce what the slider controls.