R

Slider

4 parts

Anatomy

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

Range

No props or events — renders its element and forwards attributes.

SliderRoot

Root
PropTypeDescription
modelValue?number[]Current value(s) for controlled mode.
min?numberMin value.
max?numberMax value.
step?numberStep granularity.
minStepsBetweenThumbs?numberMinimum step count between adjacent thumbs in range mode.
orientation?SliderOrientationOrientation.
dir?SliderDirectionWriting direction.
inverted?booleanInvert the direction of interaction.
disabled?booleanDisable all interaction.
defaultValue?number | number[]Uncontrolled initial value(s). Accepts single number or array.
name?stringHidden input `name` attribute.
required?booleanMark hidden inputs as required.

SliderThumb

Thumb
PropTypeDescription
'aria-label'?stringAccessible label for this thumb.

SliderTrack

Track

No props or events — renders its element and forwards attributes.