Slider

Slider is an input for choosing a value, or a range, by dragging along a track.

Installation

Nothing to add. This component ships as source in your download, so it is already in your project.

Filesrc/vui/slider.tsx
Import from@viliha/vui-react/slider

The exported names are at the top of that file. The import path is an alias the download's tsconfig.json points at src/vui/, so you can move that folder and change one line rather than every file that imports from it.

Usage

Pass an array to defaultValue/value; multiple values render multiple thumbs (a range).

slider-demo.tsx
import { Slider } from "@viliha/vui-react/slider";

export function Example() {
  return <Slider defaultValue={[50]} max={100} step={1} />;
}

Slider props

It takes no props of its own. Everything you pass reaches the underlying SliderPrimitive.Root primitive, so every attribute it accepts works here unchanged and nothing is invented on top.