Installation
Nothing to add. This component ships as source in your download, so it is already in your project.
File
src/vui/slider.tsxImport from
@viliha/vui-react/sliderThe 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
Plus everything React.ComponentProps<typeof SliderPrimitive.Root> accepts, passed straight through to the underlying element.
| Prop | Type | Default | What it does |
|---|---|---|---|
| thumbLabels? | readonly string[] | — | What each handle is called. |