◇
Slider
4 partsAnatomy
Import the parts and compose them. Each part forwards attributes to its underlying element.
vue
import {
SliderRange,
SliderRoot,
SliderThumb,
SliderTrack,
} from '@robonen/primitives/slider';
<SliderRange>
<SliderRoot />
<SliderThumb />
<SliderTrack />
</SliderRange>API Reference
SliderRange
RangeNo props or events — renders its element and forwards attributes.
SliderRoot
Root| Prop | Type | Description |
|---|---|---|
modelValue? | number[] | Current value(s) for controlled mode. |
min? | number | Min value. |
max? | number | Max value. |
step? | number | Step granularity. |
minStepsBetweenThumbs? | number | Minimum step count between adjacent thumbs in range mode. |
orientation? | SliderOrientation | Orientation. |
dir? | SliderDirection | Writing direction. |
inverted? | boolean | Invert the direction of interaction. |
disabled? | boolean | Disable all interaction. |
defaultValue? | number | number[] | Uncontrolled initial value(s). Accepts single number or array. |
name? | string | Hidden input `name` attribute. |
required? | boolean | Mark hidden inputs as required. |
SliderThumb
Thumb| Prop | Type | Description |
|---|---|---|
'aria-label'? | string | Accessible label for this thumb. |
SliderTrack
TrackNo props or events — renders its element and forwards attributes.